1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
/*
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
$Id: tp_triggers.h,v 1.2 2007-05-13 13:41:44 johnnycz Exp $
*/
#define RE_PRINT_LOW 1
#define RE_PRINT_NEDIUM 2
#define RE_PRINT_HIGH 4
#define RE_PRINT_CHAT 8
#define RE_PRINT_CENTER 16
#define RE_PRINT_ECHO 32
#define RE_PRINT_INTERNAL 64
#define RE_PRINT_ALL 31 // all of the above except internal
#define RE_FINAL 256 // do not look for other triggers if matching is succesful
#define RE_REMOVESTR 512 // do not display string if matching is uccesful
#define RE_NOLOG 1024 // do not log string if matching is succesful
#define RE_ENABLED 2048 // trigger is enabled
#define RE_NOACTION 4096 // do not call alias
typedef struct pcre_trigger_s {
char *name;
char *regexpstr;
struct pcre_trigger_s* next;
pcre* regexp;
pcre_extra* regexp_extra;
unsigned flags;
float min_interval;
double lasttime;
int counter;
} pcre_trigger_t;
typedef void internal_trigger_func (const char *s);
typedef struct pcre_internal_trigger_s {
struct pcre_internal_trigger_s *next;
pcre *regexp;
pcre_extra *regexp_extra;
internal_trigger_func *func;
unsigned flags;
} pcre_internal_trigger_t;
// re-triggers
qbool CL_SearchForReTriggers (const char *s, unsigned trigger_type);
// if true, string should not be displayed
pcre_trigger_t *CL_FindReTrigger (char *name);
void CL_RE_Trigger_ResetLasttime (void);
// message triggers
void TP_SearchForMsgTriggers (const char *s, int level);
|