From: <al...@us...> - 2003-06-15 01:14:25
|
Update of /cvsroot/msyslog/syslog/src In directory sc8-pr-cvs1:/tmp/cvs-serv24081/src Modified Files: syslogd.h modules.h Log Message: use typedefs on structure definitions Index: syslogd.h =================================================================== RCS file: /cvsroot/msyslog/syslog/src/syslogd.h,v retrieving revision 1.123 retrieving revision 1.124 diff -u -d -r1.123 -r1.124 --- syslogd.h 13 Jun 2003 19:37:28 -0000 1.123 +++ syslogd.h 15 Jun 2003 01:14:22 -0000 1.124 @@ -187,7 +187,7 @@ * It contains also the state information for a message. * */ -struct m_msg { +typedef struct m_msg { struct m_msg *next; uint32_t fields; /* active fields in this msg */ uint32_t flags; /* module flags */ @@ -203,7 +203,7 @@ uint32_t hlen; /* host length */ uint32_t plen; /* program (name) length */ uint32_t ulen; /* user (name) length */ -}; +} m_msg; #define CLEAR_MSG(m) { (m)->next = NULL; (m)->fields = 0; (m)->flags = 0; \ (m)->msg[0] = '\0'; (m)->host[0] = '\0'; \ @@ -217,9 +217,9 @@ } } -struct m_msg *get_mmsg(void); -void dispose_msgs(struct m_msg *); -int parse_lines(struct m_msg *, char *, size_t, int *); +m_msg *get_mmsg(void); +void dispose_msgs(m_msg *); +int parse_lines(m_msg *, char *, size_t, int *); /* * This structure represents the line rules @@ -228,23 +228,23 @@ * It also keeps last message sent to check for duplicates. */ -struct filed { +typedef struct filed { struct filed *next; /* next in linked list */ time_t time; /* time this filed was last written */ u_short pmask[LOG_NFACILITIES+1]; /* priority mask */ char program[MAX_PROGNAME_SIZE]; /* program name */ /* XXX: this should be some short hash instead */ - struct m_msg prevmsg; /* last message logged */ + m_msg prevmsg; /* last message logged */ int prevcount; /* repetition cnt of prevline */ int repeatcount; /* number of "repeated" msgs */ - struct o_module *omod; /* module details */ -}; + o_module *omod; /* module details */ +} filed; -struct global { +typedef struct m_global { char *prog; /* program name */ char *FileListing; /* File Listing */ FILE *flist_des; /* File Listing descriptor */ -}; +} m_global; void logerror(char *); void logmsg(int, char *, char *, int); @@ -254,21 +254,21 @@ #define MLIB_MAX 10 /* max external libs per module */ -struct omodule { +typedef struct omodule { char *name; - int (*init) (int, char **, struct filed *, struct global*, void **, char **); - int (*write) (struct filed *, struct m_msg *, void *); - int (*flush) (struct filed *, void *); - int (*close) (struct filed *, void *); -}; + int (*init) (int, char **, filed *, m_ global *, void **, char **); + int (*write) (filed *, m_msg *, void *); + int (*flush) (filed *, void *); + int (*close) (filed *, void *); +} omodule; -struct imodule { +typedef struct imodule { char *name; - int (*init) (struct i_module *, char **, int); - int (*read) (struct i_module *, int, struct m_msg *); - int (*close) (struct i_module *); /* close input, optional */ - int (*poll) (struct i_module *); -}; + int (*init) (i_module *, char **, int); + int (*read) (i_module *, int, m_msg *); + int (*close) (i_module *); /* close input, optional */ + int (*poll) (i_module *); +} imodule; #define MAXREPEAT ((sizeof(repeatinterval) / sizeof(repeatinterval[0])) - 1) Index: modules.h =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules.h,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- modules.h 28 May 2003 18:05:39 -0000 1.55 +++ modules.h 15 Jun 2003 01:14:22 -0000 1.56 @@ -51,19 +51,19 @@ * This structure represents main details for the output modules */ -struct o_module { +typedef struct o_module { struct o_module *next; struct omodule *func; /* where are this puppy's functions? */ void *ctx; /* XXX: remove this */ char *status; -}; +} o_module; /* * This structure represents main details for the input modules */ -struct i_module { +typedef struct i_module { struct i_module *next; struct imodule *func; /* where are this puppy's functions? */ int fd; /* the main file descriptor */ @@ -71,9 +71,9 @@ int blen; int flags; /* internal module flags */ void *ctx; -}; +} i_module; -int watch_fd_input(char, int , struct i_module *); /* add this fd to poll array */ +int watch_fd_input(char, int , i_module *); /* add this fd to poll array */ void unwatch_fd_input(char, int); /* remove this fd from poll arrays */ #endif |