]> git.ipfire.org Git - thirdparty/bird.git/blobdiff - conf/conf.h
Filter: Methods rework
[thirdparty/bird.git] / conf / conf.h
index b7c97ce5897f436ed04c5340007c3cf0c25a3e90..1413cb581bd09fff80ec7191e0bf38b4ce6a3cd0 100644 (file)
@@ -126,6 +126,7 @@ struct symbol {
     struct f_val *val;                 /* For SYM_CONSTANT */
     uint offset;                       /* For SYM_VARIABLE */
     const struct keyword *keyword;     /* For SYM_KEYWORD */
+    const struct f_method *method;     /* For SYM_METHOD */
   };
 
   char name[0];
@@ -144,13 +145,9 @@ struct sym_scope {
   byte readonly:1;                     /* Do not add new symbols */
 };
 
-enum keyword_scope {
-  CFK_KEYWORDS,
-  CFK_METHODS,
-  CFK__MAX
-};
-
 extern struct sym_scope *global_root_scope;
+extern pool *global_root_scope_pool;
+extern linpool *global_root_scope_linpool;
 
 struct bytestring {
   size_t length;
@@ -168,6 +165,7 @@ struct bytestring {
 #define SYM_TABLE 5
 #define SYM_ATTRIBUTE 6
 #define SYM_KEYWORD 7
+#define SYM_METHOD 8
 
 #define SYM_VARIABLE 0x100     /* 0x100-0x1ff are variable types */
 #define SYM_VARIABLE_RANGE SYM_VARIABLE ... (SYM_VARIABLE | 0xff)
@@ -215,6 +213,9 @@ struct symbol *cf_localize_symbol(struct config *conf, struct symbol *sym);
 static inline int cf_symbol_is_local(struct config *conf, struct symbol *sym)
 { return (sym->scope == conf->current_scope) && !conf->current_scope->soft_scopes; }
 
+/* internal */
+struct symbol *cf_new_symbol(struct sym_scope *scope, pool *p, struct linpool *lp, const byte *c);
+
 /**
  * cf_define_symbol - define meaning of a symbol
  * @sym: symbol to be defined