field.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _KLONE_FIELD_H_
00012 #define _KLONE_FIELD_H_
00013
00014 #include <sys/types.h>
00015 #include <u/libu.h>
00016
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020
00021 TAILQ_HEAD(param_list_s, param_s);
00022 typedef struct param_s
00023 {
00024 TAILQ_ENTRY(param_s) np;
00025 char *name;
00026 char *value;
00027 } param_t;
00028
00029 typedef struct param_list_s params_t;
00030
00031 TAILQ_HEAD(field_list_s, field_s);
00032 typedef struct field_s
00033 {
00034 TAILQ_ENTRY(field_s) np;
00035 char *name;
00036 char *value;
00037 params_t *params;
00038 } field_t;
00039
00040
00041 typedef struct field_list_s fields_t;
00042
00043 int field_create(const char* name, const char *value, field_t**);
00044 int field_set(field_t*, const char *name, const char *value);
00045 int field_set_from_line(field_t*, const char *line);
00046 int field_free(field_t*);
00047 const char* field_get_name(field_t *f);
00048 const char* field_get_value(field_t *f);
00049
00050 #ifdef __cplusplus
00051 }
00052 #endif
00053
00054 #endif