config_file.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef CONFIG_FILE_H
00024 #define CONFIG_FILE_H
00025
00026 #include <stdio.h>
00027 #include <stdlib.h>
00028 #include <string.h>
00029 #include <libguile.h>
00030 #include <ctype.h>
00031 #include "xalloc.h"
00032 #include "sequence.h"
00033 #include "path.h"
00034 #include "guile.h"
00035
00036
00037
00038
00039
00040 struct directive_t_func
00041 {
00042 char scmp;
00043 void (*func)(char *);
00044 };
00045
00046 struct directive_t_scm
00047 {
00048 char scmp;
00049 SCM lambda;
00050 };
00051
00052 typedef union
00053 {
00054 char scmp;
00055 struct directive_t_func cfunc;
00056 struct directive_t_scm scmfunc;
00057 } directive_t_callee;
00058
00059 typedef struct
00060 {
00061 char* name;
00062 directive_t_callee func;
00063 } directive_t;
00064
00065 extern sequence directives;
00066
00067 #define BLOCK_SIZE 256
00068
00069 char* getline(FILE* stream);
00070 void exec_config_file(char* filename);
00071 void directives_init();
00072 void register_scm_directive(char* name, SCM func);
00073 void register_directive(char* name,void (*func)(char*));
00074 void remove_directive(char* name);
00075 directive_t get_obj_directive_t(object o);
00076 object make_directive_t_obj(directive_t d);
00077
00078 #endif