summaryrefslogtreecommitdiff
path: root/keyword.h
diff options
context:
space:
mode:
Diffstat (limited to 'keyword.h')
-rw-r--r--keyword.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/keyword.h b/keyword.h
index 5fccbc4..c39f13c 100644
--- a/keyword.h
+++ b/keyword.h
@@ -6,7 +6,8 @@
typedef enum keyword_type keyword_type;
typedef struct keyword keyword;
typedef union keyword_val keyword_val;
-typedef int (keyword_cb)(void *ctx, void *ret, const keyword *key, keyword_val val);
+typedef int (set_keyword_cb)(void *ctx, void *ret, const keyword *key, keyword_val val);
+typedef int (get_keyword_cb)(void *ctx, void *data, const keyword *key, keyword_val *val);
typedef int (parse_callback)(void **ret, void *ctx, char *buf);
enum keyword_type {
@@ -20,12 +21,13 @@ enum keyword_type {
};
struct keyword {
- const char *key; /* Keyword. */
- const char *desc; /* Description of the keyword. */
- const char *time_fmt; /* Format string used to parse a timestamp (if needed). */
- keyword_type type; /* Datatype of the keyword. */
- size_t *offsets; /* Offset(s) of member(s) in a struct (if needed). */
- keyword_cb *callback; /* Callback to keyword specific parsing function (if needed). */
+ const char *key; /* Keyword. */
+ const char *desc; /* Description of the keyword. */
+ const char *time_fmt; /* Format string used to parse a timestamp (if needed). */
+ keyword_type type; /* Datatype of the keyword. */
+ size_t *offsets; /* Offset(s) of member(s) in a struct (if needed). */
+ set_keyword_cb *set_callback; /* Callback to keyword specific setter function (if needed). */
+ get_keyword_cb *get_callback; /* Callback to keyword specific getter function (if needed). */
};
union keyword_val {