summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2019-08-06 23:08:07 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2019-08-06 23:08:07 +0200
commit394ca583a3ca45f25ec8549a6fb6f2582a0975db (patch)
tree318324dd6295a12bf68f6641dc453e153fec04dd
parent37645e9b47493d3a07ca59549fa830e5c1e0a637 (diff)
Improve internal type "data_key_t"
Change-Id: I0d2d1566819dc595e46ab09cdab9b8c1dd5b6537 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/data.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/data.h b/src/data.h
index ef387f8..0e1a3b0 100644
--- a/src/data.h
+++ b/src/data.h
@@ -28,7 +28,8 @@
#define Data_Any_String "#"
#define Data_Wide_String "*"
-typedef struct data_key data_key_t;
+typedef enum data_keyidx data_keyidx_t;
+typedef union data_key data_key_t;
typedef struct data_value data_value_t;
enum data_keyidx {
@@ -39,16 +40,16 @@ enum data_keyidx {
KeyIdx_Count
};
-struct data_key {
- union {
- struct {
- const char *client;
- const char *session;
- const char *user;
- const char *permission;
- };
- const char *keys[KeyIdx_Count];
+union data_key {
+ /* name access */
+ struct {
+ const char *client;
+ const char *session;
+ const char *user;
+ const char *permission;
};
+ /* arrayed access, see data_keyidx_t */
+ const char *keys[KeyIdx_Count];
};
struct data_value {