00001 #ifndef _GROK_PROGRAM_H_
00002 #define _GROK_PROGRAM_H_
00003
00004 #include <sys/types.h>
00005 #include <sys/stat.h>
00006 #include <event.h>
00007
00008
00009
00010
00011 typedef struct grok_program grok_program_t;
00012 typedef struct grok_collection grok_collection_t;
00013 struct grok_input;
00014 struct grok_matchconfig;
00015
00016 struct grok_program {
00017 char *name;
00018
00019 struct grok_input *inputs;
00020 int ninputs;
00021 int input_size;
00022
00023 struct grok_matchconf *matchconfigs;
00024 int nmatchconfigs;
00025 int matchconfig_size;
00026
00027 char **patternfiles;
00028 int npatternfiles;
00029 int patternfile_size;
00030
00031 int logmask;
00032 int logdepth;
00033
00034 grok_collection_t *gcol;
00035 int reactions;
00036 };
00037
00038 struct grok_collection {
00039 grok_program_t **programs;
00040 int nprograms;
00041 int program_size;
00042
00043 struct event_base *ebase;
00044 struct event *ev_sigchld;
00045
00046 int logmask;
00047 int logdepth;
00048 int exit_code;
00049 };
00050
00051 grok_collection_t *grok_collection_init();
00052 void grok_collection_add(grok_collection_t *gcol, grok_program_t *gprog);
00053 void grok_collection_loop(grok_collection_t *gcol);
00054 void grok_collection_check_end_state(grok_collection_t *gcol);
00055
00056 #endif