#ifndef PDL_H #define PDL_H #include "nextgen.h" #include #undef TRUE #undef FALSE #undef BOOL #define TRUE 1 #define FALSE (!TRUE) extern const char* _pdl_path; extern int yylex(void); extern int yyparse(void); extern FILE* yyin; FILE* file; extern int yylex_destroy(void); typedef struct record_s { char* string; //!< Hold the symbol that lex has found. int lineno; //!< Hold the line number the symbol has been found. } record_t; /*! * \brief Structure keeps track of the state and the true/false * braches. * */ typedef struct rule_s { const char* state; //!< Name of the state. unsigned int lineno; //!< Line number where rule appeared. struct rule_s* true_branch; //!< Name of the true_branch, or 0 if none. struct rule_s* false_branch; //!< Name of the false_branch, or 0 if none. } rule_t; typedef struct policy_s { lcmaps_plugindl_t* current; lcmaps_plugindl_t* next_success; lcmaps_plugindl_t* next_failure; struct rule_s* head_rule; } policy_t; NG_RC pdl_init(const char*); NG_RC pdl_term(); record_t* concat_strings(record_t*, record_t*); record_t* concat_strings_with_space(record_t*, record_t*); int yyerror(const char*); void set_path(record_t*); void add_policy(record_t*, rule_t*); rule_t* add_rule(record_t*, record_t*, record_t*); const char* pdl_path(void); void remove_policy(record_t* policy); void add_variable(record_t* name, record_t* value); NG_RC allow_rules(int); NG_RC allowed_policy_rule(const char* label); #endif