/[pdpsoft]/trunk/grid-mw-security/ees/include/common/pdl.h
ViewVC logotype

Annotation of /trunk/grid-mw-security/ees/include/common/pdl.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 530 - (hide annotations) (download) (as text)
Wed Jul 15 10:55:33 2009 UTC (12 years, 10 months ago) by aramv
File MIME type: text/x-csrc
File size: 1405 byte(s)
Made the parser work without memory leaks, for now.
1 aramv 530 #ifndef PDL_H
2     #define PDL_H
3     #include "nextgen.h"
4     #include <stdio.h>
5    
6     #undef TRUE
7     #undef FALSE
8     #undef BOOL
9     #define TRUE 1
10     #define FALSE (!TRUE)
11    
12     const char* _pdl_path;
13    
14     extern int yylex(void);
15     extern FILE* yyin;
16     FILE* file;
17     extern yylex_destroy(void);
18    
19     typedef struct record_s {
20     char* string; //!< Hold the symbol that lex has found.
21     int lineno; //!< Hold the line number the symbol has been found.
22     } record_t;
23    
24     /*!
25     * \brief Structure keeps track of the state and the true/false
26     * braches.
27     *
28     */
29     typedef struct rule_s {
30     const char* state; //!< Name of the state.
31     const char* true_branch; //!< Name of the true_branch, or 0 if none.
32     const char* false_branch; //!< Name of the false_branch, or 0 if none.
33     unsigned int lineno; //!< Line number where rule appeared.
34     struct rule_s* next; //!< Next rule, or 0 if none.
35     } rule_t;
36    
37     typedef struct policy_s {
38     lcmaps_plugindl_t* current;
39     lcmaps_plugindl_t* next_success;
40     lcmaps_plugindl_t* next_failure;
41     } policy_t;
42    
43     NG_RC pdl_init(const char*);
44     NG_RC pdl_term();
45     record_t* concat_strings(record_t*, record_t*);
46    
47     int yyerror(const char*);
48     void set_path(record_t*);
49     void add_policy(record_t*, rule_t*);
50     const char* pdl_path(void);
51     void remove_policy(record_t* policy);
52     void add_variable(record_t* name, record_t* value);
53     NG_RC allow_rules(int);
54     NG_RC allowed_policy_rule(const char* label);
55    
56     #endif

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28