1 #ifndef PSCAN_H 2 #define PSCAN_H 3 /********************************************************************** 4 * pscan: http://deployingradius.com/pscan/ 5 * 6 * Copyright (C) 2000,2007 Alan DeKok <aland@deployingradius.com> 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 21 * 22 **********************************************************************/ 23 24 #ifndef FALSE 25 #define FALSE (0) 26 #define TRUE (!FALSE) 27 #endif 28 29 #define PROBLEMATIC TRUE 30 #define NOT_PROBLEMATIC FALSE 31 32 /* 33 * The maximum number of user-defined problem functions which may be 34 * read from a .pscan problem definition file. 35 */ 36 #define MAX_USER_PROBLEMS 2048 37 38 typedef struct problem_t { 39 const char *function; 40 int fmt_arg; 41 } problem_t; 42 43 typedef struct parser_state_t { 44 const problem_t *problem; 45 int line; /* source file line at which we found 46 the problem function */ 47 int args; /* number of arguments used by the function */ 48 int constant_string; /* is the last argument a constant string? */ 49 int last_token; /* was the last token problematic, or not? */ 50 int braces; /* the number of braces... */ 51 } parser_state_t; 52 extern parser_state_t *state; 53 54 extern parser_state_t *pop_stack(void); 55 extern parser_state_t *push_stack(parser_state_t *current); 56 extern void check_function(parser_state_t *state); 57 extern parser_state_t *setup_checks(const char *yytext, parser_state_t *state); 58 #endif /* PSCAN_H */ 59