summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2022-08-06 09:28:32 -0300
committermrb0nk500 <b0nk@b0nk.xyz>2022-08-06 09:30:17 -0300
commit2555a7caaab3d5dba812940575129fd808e9e3dc (patch)
tree76ab5187a1d9397b59c8a4843eceab5a33d29cec
parentfb3db9b6f2c427a5065725b6047391fe286cfc72 (diff)
keyword: Add `delimiter` struct
This can be used to help with `create_key_value_file()`, and `create_key_value_str()`.
-rw-r--r--keyword.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/keyword.h b/keyword.h
index 64183aa..a45854b 100644
--- a/keyword.h
+++ b/keyword.h
@@ -4,6 +4,7 @@
#include <time.h>
typedef enum keyword_type keyword_type;
+typedef struct delimiter delimiter;
typedef struct keyword keyword;
typedef union keyword_val keyword_val;
typedef int (set_keyword_cb)(void *ctx, void *ret, const keyword *key, keyword_val val);
@@ -20,6 +21,12 @@ enum keyword_type {
TYPE_COUNT,
};
+struct delimiter {
+ char *delm; /* Delimiter. */
+ int lead_space; /* Leading whitespace. */
+ int trail_space; /* Trailing whitespace. */
+};
+
struct keyword {
const char *key; /* Keyword. */
const char *desc; /* Description of the keyword. */