File: pscan.h

package info (click to toggle)
pscan 1.2-9
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, lenny, sid, squeeze, stretch, wheezy
  • size: 116 kB
  • ctags: 43
  • sloc: ansic: 310; lex: 141; makefile: 17; sh: 1
file content (60 lines) | stat: -rw-r--r-- 2,137 bytes parent folder | download | duplicates (2)
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
#ifndef PSCAN_H
#define PSCAN_H
/**********************************************************************
 * pscan: http://www.striker.ottawa.on.ca/~aland/pscan/
 *
 * Copyright (C) 2000 Alan DeKok <aland@ox.org>
 * 
 * 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: pscan.h,v 1.2 2000/07/07 17:25:02 aland Exp $
 *
 **********************************************************************/

#ifndef FALSE
#define FALSE (0)
#define TRUE (!FALSE)
#endif

#define PROBLEMATIC     TRUE
#define NOT_PROBLEMATIC FALSE

/*
 *  The maximum number of user-defined problem functions which may be
 *  read from a .pscan problem definition file.
 */
#define MAX_USER_PROBLEMS 2048

typedef struct problem_t {
  const char *function;
  int fmt_arg;
} problem_t;

typedef struct parser_state_t {
  const problem_t *problem;
  int line;			/* source file line at which we found
                                   the problem function */
  int args;			/* number of arguments used by the function */
  int constant_string;		/* is the last argument a constant string? */
  int last_token;		/* was the last token problematic, or not? */
  int braces;			/* the number of braces... */
} parser_state_t;
extern parser_state_t *state;

extern parser_state_t *pop_stack(void);
extern parser_state_t *push_stack(parser_state_t *current);
extern void check_function(parser_state_t *state);
extern parser_state_t *setup_checks(const char *yytext, parser_state_t *state);
#endif /* PSCAN_H */