summaryrefslogtreecommitdiffabout
path: root/src/grecs.h
Side-by-side diff
Diffstat (limited to 'src/grecs.h') (more/less context) (ignore whitespace changes)
-rw-r--r--src/grecs.h180
1 files changed, 90 insertions, 90 deletions
diff --git a/src/grecs.h b/src/grecs.h
index ec98979..5769736 100644
--- a/src/grecs.h
+++ b/src/grecs.h
@@ -28,37 +28,37 @@
# endif
#endif
#ifndef _
-# define _(msgid) gettext (msgid)
+# define _(msgid) gettext(msgid)
#endif
#ifndef N_
# define N_(s) s
#endif
typedef struct {
- char *file;
- int line;
+ char *file;
+ int line;
} grecs_locus_t;
extern grecs_locus_t grecs_locus;
enum grecs_data_type {
- grecs_type_void,
- grecs_type_string,
- grecs_type_short,
- grecs_type_ushort,
- grecs_type_int,
- grecs_type_uint,
- grecs_type_long,
- grecs_type_ulong,
- grecs_type_size,
+ grecs_type_void,
+ grecs_type_string,
+ grecs_type_short,
+ grecs_type_ushort,
+ grecs_type_int,
+ grecs_type_uint,
+ grecs_type_long,
+ grecs_type_ulong,
+ grecs_type_size,
/* grecs_type_off,*/
- grecs_type_time,
- grecs_type_bool,
- grecs_type_ipv4,
- grecs_type_cidr,
- grecs_type_host,
- grecs_type_sockaddr,
- grecs_type_section
+ grecs_type_time,
+ grecs_type_bool,
+ grecs_type_ipv4,
+ grecs_type_cidr,
+ grecs_type_host,
+ grecs_type_sockaddr,
+ grecs_type_section
};
#define GRECS_LIST 0x8000
@@ -67,9 +67,9 @@ enum grecs_data_type {
#define GRECS_IS_LIST(c) ((c) & GRECS_LIST)
enum grecs_callback_command {
- grecs_callback_section_begin,
- grecs_callback_section_end,
- grecs_callback_set_value
+ grecs_callback_section_begin,
+ grecs_callback_section_end,
+ grecs_callback_set_value
};
#define GRECS_TYPE_STRING 0
@@ -89,45 +89,45 @@ struct grecs_list {
};
typedef struct grecs_value {
- int type;
- union {
- struct grecs_list *list;
- const char *string;
- struct {
- size_t c;
- struct grecs_value *v;
- } arg;
- } v;
+ int type;
+ union {
+ struct grecs_list *list;
+ const char *string;
+ struct {
+ size_t c;
+ struct grecs_value *v;
+ } arg;
+ } v;
} grecs_value_t;
-typedef int (*grecs_callback_fn) (
- enum grecs_callback_command cmd,
- grecs_locus_t * /* locus */,
- void * /* varptr */,
- grecs_value_t * /* value */,
- void * /* cb_data */
- );
+typedef int (*grecs_callback_fn)(
+ enum grecs_callback_command cmd,
+ grecs_locus_t * /* locus */,
+ void * /* varptr */,
+ grecs_value_t * /* value */,
+ void * /* cb_data */
+ );
struct grecs_keyword {
- const char *ident;
- const char *argname;
- const char *docstring;
- enum grecs_data_type type;
- void *varptr;
- size_t offset;
- grecs_callback_fn callback;
- void *callback_data;
- struct grecs_keyword *kwd;
+ const char *ident;
+ const char *argname;
+ const char *docstring;
+ enum grecs_data_type type;
+ void *varptr;
+ size_t offset;
+ grecs_callback_fn callback;
+ void *callback_data;
+ struct grecs_keyword *kwd;
};
struct grecs_sockaddr {
- int len;
- struct sockaddr *sa;
+ int len;
+ struct sockaddr *sa;
};
extern void *(*grecs_malloc_fun)(size_t size);
extern void *(*grecs_realloc_fun)(void *ptr, size_t size);
-extern void (*grecs_alloc_die_fun) (void);
+extern void (*grecs_alloc_die_fun)(void);
void *grecs_malloc(size_t size);
void *grecs_zalloc(size_t size);
@@ -146,22 +146,22 @@ void grecs_error(grecs_locus_t *locus, int errcode, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
void grecs_set_keywords(struct grecs_keyword *kwd);
void grecs_gram_trace(int n);
-void grecs_lex_trace (int n);
+void grecs_lex_trace(int n);
int grecs_lex_begin(const char*);
void grecs_lex_end(void);
-int grecs_parse (const char *name);
+int grecs_parse(const char *name);
-void grecs_line_begin (void);
-void grecs_line_add (const char *text, size_t len);
-char *grecs_line_finish (void);
+void grecs_line_begin(void);
+void grecs_line_add(const char *text, size_t len);
+char *grecs_line_finish(void);
-extern int grecs_string_convert (void *target, enum grecs_data_type type,
- const char *string, grecs_locus_t *locus);
-extern void grecs_process_ident (struct grecs_keyword *kwp,
- grecs_value_t *value,
- void *base,
- grecs_locus_t *locus);
+extern int grecs_string_convert(void *target, enum grecs_data_type type,
+ const char *string, grecs_locus_t *locus);
+extern void grecs_process_ident(struct grecs_keyword *kwp,
+ grecs_value_t *value,
+ void *base,
+ grecs_locus_t *locus);
extern grecs_locus_t grecs_current_locus;
extern int grecs_error_count;
@@ -169,48 +169,48 @@ extern int grecs_default_port;
extern const char *grecs_preprocessor;
extern int grecs_log_to_stderr;
-extern void (*grecs_log_setup_hook) ();
+extern void (*grecs_log_setup_hook)();
-size_t grecs_preproc_fill_buffer (char *buf, size_t size);
-void grecs_preproc_add_include_dir (char *dir);
-int grecs_preproc_init (const char *name);
-void grecs_preproc_done (void);
-int grecs_preproc_run (const char *config_file, const char *extpp);
+size_t grecs_preproc_fill_buffer(char *buf, size_t size);
+void grecs_preproc_add_include_dir(char *dir);
+int grecs_preproc_init(const char *name);
+void grecs_preproc_done(void);
+int grecs_preproc_run(const char *config_file, const char *extpp);
-FILE *grecs_preproc_extrn_start (const char *file, pid_t *ppid);
-void grecs_preproc_extrn_shutdown (pid_t pid);
+FILE *grecs_preproc_extrn_start(const char *file, pid_t *ppid);
+void grecs_preproc_extrn_shutdown(pid_t pid);
-char *grecs_install_text (const char *str);
-void grecs_destroy_text (void);
+char *grecs_install_text(const char *str);
+void grecs_destroy_text(void);
-void grecs_include_path_setup (const char *dir, ...);
-void grecs_include_path_setup_v (char **dirs);
+void grecs_include_path_setup(const char *dir, ...);
+void grecs_include_path_setup_v(char **dirs);
-const char *grecs_data_type_string (enum grecs_data_type type);
-void grecs_format_docstring (FILE *stream, const char *docstring,
+const char *grecs_data_type_string(enum grecs_data_type type);
+void grecs_format_docstring(FILE *stream, const char *docstring,
unsigned level);
-void grecs_format_simple_statement (FILE *stream, struct grecs_keyword *kwp,
+void grecs_format_simple_statement(FILE *stream, struct grecs_keyword *kwp,
unsigned level);
-void grecs_format_block_statement (FILE *stream, struct grecs_keyword *kwp,
+void grecs_format_block_statement(FILE *stream, struct grecs_keyword *kwp,
unsigned level);
-void grecs_format_statement_array (FILE *stream, struct grecs_keyword *kwp,
+void grecs_format_statement_array(FILE *stream, struct grecs_keyword *kwp,
unsigned n,
unsigned level);
-struct grecs_list *grecs_list_create (void);
-size_t grecs_list_size (struct grecs_list *lp);
-void grecs_list_append (struct grecs_list *lp, void *val);
-void grecs_list_push (struct grecs_list *lp, void *val);
-void *grecs_list_pop (struct grecs_list *lp);
-void *grecs_list_locate (struct grecs_list *lp, void *data);
-void *grecs_list_index (struct grecs_list *lp, size_t idx);
-void *grecs_list_remove_tail (struct grecs_list *lp);
-void grecs_list_clear (struct grecs_list *lp);
-void grecs_list_free (struct grecs_list *lp);
+struct grecs_list *grecs_list_create(void);
+size_t grecs_list_size(struct grecs_list *lp);
+void grecs_list_append(struct grecs_list *lp, void *val);
+void grecs_list_push(struct grecs_list *lp, void *val);
+void *grecs_list_pop(struct grecs_list *lp);
+void *grecs_list_locate(struct grecs_list *lp, void *data);
+void *grecs_list_index(struct grecs_list *lp, size_t idx);
+void *grecs_list_remove_tail(struct grecs_list *lp);
+void grecs_list_clear(struct grecs_list *lp);
+void grecs_list_free(struct grecs_list *lp);
-int grecs_vasprintf (char **pbuf, size_t *psize, const char *fmt, va_list ap);
-int grecs_asprintf (char **pbuf, size_t *psize, const char *fmt, ...);
+int grecs_vasprintf(char **pbuf, size_t *psize, const char *fmt, va_list ap);
+int grecs_asprintf(char **pbuf, size_t *psize, const char *fmt, ...);
struct grecs_symtab;

Return to:

Send suggestions and report system problems to the System administrator.