Changed the tokens from being define's to enums. This allows
[freeradius.git] / src / include / token.h
1 #ifndef LRAD_TOKEN_H
2 #define LRAD_TOKEN_H
3
4 /*
5  * token.h      Special tokens.
6  *
7  * $Id$
8  *
9  *   This program is free software; you can redistribute it and/or modify
10  *   it under the terms of the GNU General Public License as published by
11  *   the Free Software Foundation; either version 2 of the License, or
12  *   (at your option) any later version.
13  *
14  *   This program is distributed in the hope that it will be useful,
15  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *   GNU General Public License for more details.
18  *
19  *   You should have received a copy of the GNU General Public License
20  *   along with this program; if not, write to the Free Software
21  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22  *
23  * Copyright 2001  The FreeRADIUS server project
24  */
25
26 typedef enum lrad_token_t {
27   T_INVALID = 0,                /* invalid token */
28   T_EOL,                        /* end of line */
29   T_LCBRACE,                    /* { */
30   T_RCBRACE,                    /* } */
31   T_LBRACE,                     /* ( */
32   T_RBRACE,                     /* ) */
33   T_COMMA,                      /* , */
34   T_SEMICOLON,                  /* ; */
35   
36   T_OP_ADD,                     /* += */
37   T_OP_SUB,                     /* -= */
38   T_OP_SET,                     /* := */
39   T_OP_EQ,                      /* = */
40   T_OP_NE,                      /* != */
41   T_OP_GE,                      /* >= */
42   T_OP_GT,                      /* > */
43   T_OP_LE,                      /* <= */
44   T_OP_LT,                      /* < */
45   T_OP_REG_EQ,                  /* =~ */
46   T_OP_REG_NE,                  /* !~ */
47   T_OP_CMP_EQ,                  /* == */
48   T_HASH,                       /* # */
49 } LRAD_TOKEN;
50
51 #define T_EQSTART       T_OP_ADD
52 #define T_EQEND         (T_OP_CMP_EQ + 1)
53
54 LRAD_TOKEN      getword (char **ptr, char *buf, int buflen);
55 LRAD_TOKEN      gettoken(char **ptr, char *buf, int buflen);
56
57 #endif /* LRAD_TOKEN_H */