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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 881 - (show annotations) (download) (as text)
Wed Oct 7 11:46:12 2009 UTC (12 years, 3 months ago) by aramv
File MIME type: text/x-csrc
File size: 1932 byte(s)
Rearranged some declarations to satisfy lex/yacc warnings
1 #ifndef PDL_H
2 #define PDL_H
3 #if HAVE_CONFIG_H
4 #include "config.h"
5 #endif
6 #if HAVE_STDIO_H
7 #include <stdio.h>
8 #endif
9 #if HAVE_STDLIB_H
10 #include <stdlib.h>
11 #endif
12 #include "plugin_manager.h"
13 #include "eef_log.h"
14
15 #undef TRUE
16 #undef FALSE
17 #undef BOOL
18 #define TRUE 1
19 #define FALSE (!TRUE)
20
21 typedef struct record_s {
22 char* string; /*!< Hold the symbol that lex has found. */
23 int lineno; /*!< Hold the line number the symbol has been found. */
24 } record_t;
25
26 /*!
27 * \brief Structure keeps track of the state and the true/false
28 * braches.
29 *
30 */
31 typedef struct rule_s {
32 const char* state; /*!< Name of the state.*/
33 unsigned int lineno; /*!< Line number where rule appeared. */
34 struct rule_s* true_branch; /*!< Name of the true_branch, or 0 if none. */
35 struct rule_s* false_branch; /*!< Name of the false_branch, or 0 if none. */
36 } rule_t;
37
38 typedef struct policy_s {
39 eef_plugindl_t* current;
40 eef_plugindl_t* next_success;
41 eef_plugindl_t* next_failure;
42 struct rule_s* head_rule;
43 } policy_t;
44
45
46 /* lifecycle functions */
47 EES_RC pdl_init(const char*);
48 EES_RC pdl_term(void);
49
50 /* callback functions */
51 void set_path(record_t*);
52 void add_policy(record_t*, rule_t*);
53 rule_t * add_rule(record_t*, record_t*, record_t*);
54 const char * get_pdl_path(void);
55 void remove_policy(record_t* policy);
56 void add_variable(record_t* name, record_t* value);
57 EES_RC allow_rules(int);
58 EES_RC allowed_policy_rule(const char* label);
59
60 /* convenience methods used by the lexer */
61 record_t * concat_strings(record_t*, record_t*);
62 record_t * concat_strings_with_space(record_t*, record_t*);
63 char ** _var_to_argv(char*, int*);
64
65
66 /* Lex/Yacc stuff */
67 int yyerror(char*);
68 void set_yylval(record_t* r);
69
70 #endif

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