diff options
author | José Bollo <jose.bollo@iot.bzh> | 2019-08-06 23:08:07 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2019-08-06 23:08:07 +0200 |
commit | 394ca583a3ca45f25ec8549a6fb6f2582a0975db (patch) | |
tree | 318324dd6295a12bf68f6641dc453e153fec04dd | |
parent | 37645e9b47493d3a07ca59549fa830e5c1e0a637 (diff) |
Improve internal type "data_key_t"
Change-Id: I0d2d1566819dc595e46ab09cdab9b8c1dd5b6537
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r-- | src/data.h | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -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 { |