00001 #ifndef _GROK_MATCHCONF_H_
00002 #define _GROK_MATCHCONF_H_
00003
00004 #include "grok.h"
00005 #include "grok_input.h"
00006 #include "grok_program.h"
00007 #include <stdio.h>
00008
00009 typedef struct grok_matchconf grok_matchconf_t;
00010 typedef struct grok_reaction grok_reaction_t;
00011
00012 struct grok_reaction {
00013 char *cmd;
00014 };
00015
00016 struct grok_matchconf {
00017 TCLIST *grok_list;
00018 char *reaction;
00019 char *shell;
00020 int flush;
00021 int is_nomatch;
00022 int no_reaction;
00023
00024 FILE *shellinput;
00025 int pid;
00026 int break_if_match;
00027 int matches;
00028 };
00029
00030 void grok_matchconfig_init(grok_program_t *gprog, grok_matchconf_t *gmc);
00031 void grok_matchconfig_close(grok_program_t *gprog, grok_matchconf_t *gmc);
00032 void grok_matchconfig_global_cleanup(void);
00033
00034
00035 void grok_matchconfig_exec(grok_program_t *gprog, grok_input_t *ginput,
00036 const char *text);
00037 void grok_matchconfig_exec_nomatch(grok_program_t *gprog, grok_input_t *ginput);
00038 void grok_matchconfig_react(grok_program_t *gprog, grok_input_t *ginput,
00039 grok_matchconf_t *gmc, grok_match_t *gm);
00040
00041 void grok_matchconfig_start_shell(grok_program_t *gprog, grok_matchconf_t *gmc);
00042 char *grok_matchconfig_filter_reaction(const char *str, grok_match_t *gm);
00043
00044 #endif