cScm Configuration Daemon

cScm – is a tool to convert SCM configuration files into binary format and store its in shared memory for reading by cSvn-ui and cGit-ui CGI scripts

12 Commits   0 Branches   1 Tag
Index: symtab.h
===================================================================
--- symtab.h	(nonexistent)
+++ symtab.h	(revision 5)
@@ -0,0 +1,67 @@
+
+#ifndef    __SYMTAB_H
+#define    __SYMTAB_H
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/******************************
+  SYMBOL is a node of symlist:
+ */
+typedef struct symbol SYMBOL;
+struct symbol
+{
+  char *name;          /* Variable name */
+  int   type;          /* VARIABLE, SECTION, REPO, NUMERICAL, STRING, PATH */
+  union
+  {
+    int   value;       /* for NUMERICAL */
+    char *string;      /* for STRING */
+    char *path;        /* for PATH */
+  } u;
+
+  struct symbol *list; /* The list of variables. Used for SECTION and REPO */
+
+  struct symbol *next; /* Next Symbol */
+};
+
+/**********************************************
+  SYMTAB is an entry of the stack of symlists:
+ */
+typedef struct symtab SYMTAB;
+struct symtab
+{
+  SYMBOL **symlist;
+  struct symtab *next; /* Next Entry */
+};
+
+
+extern SYMBOL *symlist;
+
+extern void init_symtab( void );
+extern void push_symlist( SYMBOL **head );
+extern void pop_symlist( void );
+extern void fini_symtab( void );
+
+extern void reverse_symlist( SYMBOL **head );
+extern void remove_consts( SYMBOL **head );
+
+//debug
+extern void print_symlist( int indent, SYMBOL *head );
+
+extern SYMBOL *install( const char *s, int type, ... );
+extern SYMBOL *lookup( const char *s );
+extern SYMBOL *lookup_section( const char *s );
+extern SYMBOL *lookup_repo( const char *s );
+
+extern SYMBOL *assign_value( SYMBOL *dest, SYMBOL *src );
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  /* __SYMTAB_H */