Atrinik Server  4.0
re-cmp.h
Go to the documentation of this file.
1 /*************************************************************************
2  * Atrinik, a Multiplayer Online Role Playing Game *
3  * *
4  * Copyright (C) 2009-2014 Alex Tokar and Atrinik Development Team *
5  * *
6  * Fork from Crossfire (Multiplayer game for X-windows). *
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, or *
11  * (at your option) any later version. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program; if not, write to the Free Software *
20  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
21  * *
22  * The author can be reached at admin@atrinik.org *
23  ************************************************************************/
24 
32 /* Regexp's with syntax errors will core dump if
33  * this is undefined. */
34 #define SAFE_CHECKS
35 
36 /*
37  * Max amount of tokens in a regexp.
38  * Each token uses ~264 bytes. They are allocated
39  * as needed, but never de-allocated.
40  * E.g. [A-Za-z0-9_] counts as one token, so 64
41  * should be plenty for most purposes. */
42 #define RE_TOKEN_MAX 64
43 
44 typedef enum {
45  /* corresponds to e.g. . */
46  sel_any,
47 
48  /* " $ */
49  sel_end,
50 
51  /* " q */
52  sel_single,
53 
54  /* " [A-F] */
55  sel_range,
56 
57  /* " [AF-RqO-T] */
58  sel_array,
59 
60  /* " [^f] */
61  sel_not_single,
62 
63  /* " [^A-F] */
64  sel_not_range
65 } selection_type;
66 
67 typedef enum {
68  /* corresponds to no meta-char */
69  rep_once,
70 
71  /* " + */
72  rep_once_or_more,
73 
74  /* " ? */
75  rep_null_or_once,
76 
77  /* " * */
78  rep_null_or_more
79 } repetetion_type;
80 
81 typedef struct {
82  selection_type type;
83 
84  union {
85  unsigned char single;
86 
87  struct {
88  unsigned char low, high;
89  } range;
90 
91  int array[UCHAR_MAX];
92  } u;
93 
94  repetetion_type repeat;
95 } selection;
uint8_t type
One of operation types.
Definition: sound_ambient.c:45