From bc95eb65ec89e021ec04f7d43bfbc8c7d718570c Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 30 Mar 2011 12:34:44 -0400 Subject: Working delete-all command "delA" --- duser.h | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'duser.h') diff --git a/duser.h b/duser.h index 6ecb9f0..600c96f 100644 --- a/duser.h +++ b/duser.h @@ -2,20 +2,12 @@ #define DUSER_H #include -#define REGEX_MAX 60 -#define CMD_FLAG_NOOPT 0x00 -#define CMD_FLAG_DEL 0x02 -#define CMD_FLAG_MOD 0x04 -#define CMD_FLAG_ADD 0x08 -#define CMD_FLAG_LIST 0x16 -#define CMD_FLAG_HELP 0x32 -#define CMD_FLAG_LOOK 0x64 -#define CMD_FLAG_NULL 0x254 - +#define REGEX_MAX 255 #define regex_fmt "\%s$" -#define LOGFILE "/var/log/duser" +//#define regex_fmt "m/%s$/" #define list_path "/internal/1/domotest/opt/majordomo/majordomo-1.94.3/lists/" - +#define LOGFILE "/var/log/duser" +#define SELF __FUNCTION__ typedef struct stats_t { int lines; @@ -39,16 +31,18 @@ typedef struct record_t int pad3; } record_t; - +int logcleanup(); +int COM(const char* func, char *format, ...); char* basename(const char* path); record_t* find_in_file(const char* filename, const char* needle); int get_file_count(const char* path); char** get_file_list(const char* path, int count); +void free_file_list(char** list); void stats_init(stats_t *s); int user_list(const char* needle); int find_in_file_ex(record_t* rec); int user_del(record_t* rec); -int user_cmd(const char* arg); +int user_cmd(const int argc, char* argv[]); int user_choice(char c); #endif -- cgit