5 * token.h Special tokens.
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.
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.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 * Copyright 2001,2006 The FreeRADIUS server project
26 //#include <freeradius-devel/ident.h>
27 //RCSIDH(token_h, "$Id$")
29 typedef enum fr_token_t {
30 T_OP_INVALID = 0, /* invalid token */
31 T_EOL, /* end of line */
50 T_OP_CMP_TRUE, /* =* */
51 T_OP_CMP_FALSE, /* !* 20 */
54 T_BARE_WORD, /* bare word */
55 T_DOUBLE_QUOTED_STRING, /* "foo" */
56 T_SINGLE_QUOTED_STRING, /* 'foo' 25 */
57 T_BACK_QUOTED_STRING, /* `foo` */
61 #define T_EQSTART T_OP_ADD
62 #define T_EQEND (T_OP_CMP_EQ + 1)
64 typedef struct FR_NAME_NUMBER {
69 int fr_str2int(const FR_NAME_NUMBER *table, const char *name, int def);
70 const char *fr_int2str(const FR_NAME_NUMBER *table, int number,
74 int getword (const char **ptr, char *buf, int buflen);
75 int getbareword (const char **ptr, char *buf, int buflen);
76 FR_TOKEN gettoken(const char **ptr, char *buf, int buflen);
77 FR_TOKEN getstring(const char **ptr, char *buf, int buflen);
79 #endif /* FR_TOKEN_H */