From 9a1170d7413b4fd39d2b68614bc6ce07d7a15775 Mon Sep 17 00:00:00 2001 From: "Deomid \"rojer\" Ryabkov" Date: Fri, 12 Feb 2021 21:28:54 +0300 Subject: [PATCH] Add float config value type ("f") --- include/mgos_config_util.h | 1 + src/mgos_config_util.c | 40 ++++++++++++++++++- src/test/data/golden/mgos_config.c | 42 +++++++++++++------- src/test/data/golden/mgos_config.h | 22 ++++++++++ src/test/data/golden/mgos_config_pretty.json | 4 +- src/test/data/golden/mgos_config_schema.json | 2 + src/test/data/overrides.json | 4 +- src/test/data/sys_conf_debug.yaml | 2 + src/test/unit_test.c | 5 +++ tools/mgos_gen_config.py | 14 ++++--- 10 files changed, 113 insertions(+), 23 deletions(-) diff --git a/include/mgos_config_util.h b/include/mgos_config_util.h index 5e62d098b..1cd0c65ed 100644 --- a/include/mgos_config_util.h +++ b/include/mgos_config_util.h @@ -65,6 +65,7 @@ enum mgos_conf_type { CONF_TYPE_STRING = 3, CONF_TYPE_OBJECT = 4, CONF_TYPE_UNSIGNED_INT = 5, + CONF_TYPE_FLOAT = 6, }; /* Configuration entry */ diff --git a/src/mgos_config_util.c b/src/mgos_config_util.c index c2b5d6db2..a95fe0658 100644 --- a/src/mgos_config_util.c +++ b/src/mgos_config_util.c @@ -119,6 +119,8 @@ void mgos_conf_parse_cb(void *data, const char *name, size_t name_len, #endif char *vp = (((char *) ctx->cfg) + e->offset - ctx->offset_adj); switch (e->type) { + case CONF_TYPE_FLOAT: + /* fall through */ case CONF_TYPE_DOUBLE: #ifdef MGOS_BOOT_BUILD ctx->result = false; @@ -143,6 +145,9 @@ void mgos_conf_parse_cb(void *data, const char *name, size_t name_len, *((unsigned int *) vp) = strtoul(tok->ptr, &endptr, 0); break; #ifndef MGOS_BOOT_BUILD + case CONF_TYPE_FLOAT: + *((float *) vp) = strtof(tok->ptr, &endptr); + break; case CONF_TYPE_DOUBLE: *((double *) vp) = strtod(tok->ptr, &endptr); break; @@ -273,6 +278,8 @@ static bool mgos_conf_value_eq(const void *cfg, const void *base, /* fall through */ case CONF_TYPE_UNSIGNED_INT: return *((int *) vp) == *((int *) bvp); + case CONF_TYPE_FLOAT: + return *((float *) vp) == *((float *) bvp); case CONF_TYPE_DOUBLE: return *((double *) vp) == *((double *) bvp); case CONF_TYPE_STRING: { @@ -325,9 +332,13 @@ static void mgos_conf_emit_entry(struct emit_ctx *ctx, mbuf_append(ctx->out, s, len); break; } + case CONF_TYPE_FLOAT: + /* fall through */ case CONF_TYPE_DOUBLE: { - len = snprintf(buf, sizeof(buf), "%lf", - *((double *) (((char *) ctx->cfg) + e->offset))); + char *ptr = (((char *) ctx->cfg) + e->offset); + double v = + (e->type == CONF_TYPE_DOUBLE ? *((double *) ptr) : *((float *) ptr)); + len = snprintf(buf, sizeof(buf), "%lf", v); mbuf_append(ctx->out, buf, len); break; } @@ -450,6 +461,11 @@ bool mgos_conf_copy(const struct mgos_conf_entry *schema, const void *src, case CONF_TYPE_UNSIGNED_INT: *((int *) dvp) = *((const int *) svp); break; + case CONF_TYPE_FLOAT: +#ifndef MGOS_BOOT_BUILD + *((float *) dvp) = *((const float *) svp); +#endif + break; case CONF_TYPE_DOUBLE: #ifndef MGOS_BOOT_BUILD *((double *) dvp) = *((const double *) svp); @@ -539,6 +555,14 @@ int mgos_conf_value_int(const void *cfg, const struct mgos_conf_entry *e) { return 0; } +float mgos_conf_value_float(const void *cfg, const struct mgos_conf_entry *e) { + char *vp = (((char *) cfg) + e->offset); + if (e->type == CONF_TYPE_FLOAT) { + return *((float *) vp); + } + return 0; +} + double mgos_conf_value_double(const void *cfg, const struct mgos_conf_entry *e) { char *vp = (((char *) cfg) + e->offset); @@ -567,6 +591,9 @@ bool mgos_config_get(const struct mg_str key, struct mg_str *value, value->len = mg_asprintf( cp, 0, "%s", (mgos_conf_value_int(cfg, e) ? "true" : "false")); break; + case CONF_TYPE_FLOAT: + value->len = mg_asprintf(cp, 0, "%f", mgos_conf_value_float(cfg, e)); + break; case CONF_TYPE_DOUBLE: value->len = mg_asprintf(cp, 0, "%lf", mgos_conf_value_double(cfg, e)); break; @@ -630,6 +657,15 @@ bool mgos_config_set(const struct mg_str key, const struct mg_str value, ret = true; break; } + case CONF_TYPE_FLOAT: { + float *vp = (float *) (((char *) cfg) + e->offset); + char *endptr; + value_nul = mg_strdup_nul(value); + *vp = strtof(value_nul.p, &endptr); + if (endptr != value_nul.p + value_nul.len) goto out; + ret = true; + break; + } case CONF_TYPE_DOUBLE: { double *vp = (double *) (((char *) cfg) + e->offset); char *endptr; diff --git a/src/test/data/golden/mgos_config.c b/src/test/data/golden/mgos_config.c index d1107282f..7be62640b 100644 --- a/src/test/data/golden/mgos_config.c +++ b/src/test/data/golden/mgos_config.c @@ -13,7 +13,7 @@ /* struct mgos_config */ static const struct mgos_conf_entry mgos_config_schema_[] = { - {.type = CONF_TYPE_OBJECT, .key = "", .offset = 0, .num_desc = 38}, + {.type = CONF_TYPE_OBJECT, .key = "", .offset = 0, .num_desc = 40}, {.type = CONF_TYPE_OBJECT, .key = "wifi", .offset = offsetof(struct mgos_config, wifi), .num_desc = 8}, {.type = CONF_TYPE_OBJECT, .key = "sta", .offset = offsetof(struct mgos_config, wifi.sta), .num_desc = 2}, {.type = CONF_TYPE_STRING, .key = "ssid", .offset = offsetof(struct mgos_config, wifi.sta.ssid)}, @@ -27,12 +27,14 @@ static const struct mgos_conf_entry mgos_config_schema_[] = { {.type = CONF_TYPE_OBJECT, .key = "http", .offset = offsetof(struct mgos_config, http), .num_desc = 2}, {.type = CONF_TYPE_BOOL, .key = "enable", .offset = offsetof(struct mgos_config, http.enable)}, {.type = CONF_TYPE_INT, .key = "port", .offset = offsetof(struct mgos_config, http.port)}, - {.type = CONF_TYPE_OBJECT, .key = "debug", .offset = offsetof(struct mgos_config, debug), .num_desc = 7}, + {.type = CONF_TYPE_OBJECT, .key = "debug", .offset = offsetof(struct mgos_config, debug), .num_desc = 9}, {.type = CONF_TYPE_INT, .key = "level", .offset = offsetof(struct mgos_config, debug.level)}, {.type = CONF_TYPE_STRING, .key = "dest", .offset = offsetof(struct mgos_config, debug.dest)}, {.type = CONF_TYPE_STRING, .key = "file_level", .offset = offsetof(struct mgos_config, debug.file_level)}, {.type = CONF_TYPE_DOUBLE, .key = "test_d1", .offset = offsetof(struct mgos_config, debug.test_d1)}, {.type = CONF_TYPE_DOUBLE, .key = "test_d2", .offset = offsetof(struct mgos_config, debug.test_d2)}, + {.type = CONF_TYPE_FLOAT, .key = "test_f1", .offset = offsetof(struct mgos_config, debug.test_f1)}, + {.type = CONF_TYPE_FLOAT, .key = "test_f2", .offset = offsetof(struct mgos_config, debug.test_f2)}, {.type = CONF_TYPE_UNSIGNED_INT, .key = "test_ui", .offset = offsetof(struct mgos_config, debug.test_ui)}, {.type = CONF_TYPE_OBJECT, .key = "empty", .offset = offsetof(struct mgos_config, debug.empty), .num_desc = 0}, {.type = CONF_TYPE_OBJECT, .key = "test", .offset = offsetof(struct mgos_config, test), .num_desc = 16}, @@ -107,7 +109,7 @@ void mgos_config_http_set_defaults(struct mgos_config_http *cfg) { /* struct mgos_config_debug_empty */ const struct mgos_conf_entry *mgos_config_debug_empty_get_schema(void) { - return &mgos_config_schema_[21]; + return &mgos_config_schema_[23]; } void mgos_config_debug_empty_set_defaults(struct mgos_config_debug_empty *cfg) { @@ -125,13 +127,15 @@ void mgos_config_debug_set_defaults(struct mgos_config_debug *cfg) { cfg->file_level = "mg_foo.c=4"; cfg->test_d1 = 2.0; cfg->test_d2 = 0.0; + cfg->test_f1 = 0.123; + cfg->test_f2 = 123.0; cfg->test_ui = 4294967295; mgos_config_debug_empty_set_defaults(&cfg->empty); } /* struct mgos_config_baz */ const struct mgos_conf_entry *mgos_config_baz_get_schema(void) { - return &mgos_config_schema_[37]; + return &mgos_config_schema_[39]; } void mgos_config_baz_set_defaults(struct mgos_config_baz *cfg) { @@ -140,7 +144,7 @@ void mgos_config_baz_set_defaults(struct mgos_config_baz *cfg) { /* struct mgos_config_bar_inner */ const struct mgos_conf_entry *mgos_config_bar_inner_get_schema(void) { - return &mgos_config_schema_[34]; + return &mgos_config_schema_[36]; } void mgos_config_bar_inner_set_defaults(struct mgos_config_bar_inner *cfg) { @@ -150,7 +154,7 @@ void mgos_config_bar_inner_set_defaults(struct mgos_config_bar_inner *cfg) { /* struct mgos_config_baz */ const struct mgos_conf_entry *mgos_config_bar_baz_get_schema(void) { - return &mgos_config_schema_[37]; + return &mgos_config_schema_[39]; } void mgos_config_bar_baz_set_defaults(struct mgos_config_baz *cfg) { @@ -159,7 +163,7 @@ void mgos_config_bar_baz_set_defaults(struct mgos_config_baz *cfg) { /* struct mgos_config_bar */ const struct mgos_conf_entry *mgos_config_bar_get_schema(void) { - return &mgos_config_schema_[31]; + return &mgos_config_schema_[33]; } void mgos_config_bar_set_defaults(struct mgos_config_bar *cfg) { @@ -171,7 +175,7 @@ void mgos_config_bar_set_defaults(struct mgos_config_bar *cfg) { /* struct mgos_config_bar_inner */ const struct mgos_conf_entry *mgos_config_test_bar1_inner_get_schema(void) { - return &mgos_config_schema_[34]; + return &mgos_config_schema_[36]; } void mgos_config_test_bar1_inner_set_defaults(struct mgos_config_bar_inner *cfg) { @@ -181,7 +185,7 @@ void mgos_config_test_bar1_inner_set_defaults(struct mgos_config_bar_inner *cfg) /* struct mgos_config_baz */ const struct mgos_conf_entry *mgos_config_test_bar1_baz_get_schema(void) { - return &mgos_config_schema_[37]; + return &mgos_config_schema_[39]; } void mgos_config_test_bar1_baz_set_defaults(struct mgos_config_baz *cfg) { @@ -190,7 +194,7 @@ void mgos_config_test_bar1_baz_set_defaults(struct mgos_config_baz *cfg) { /* struct mgos_config_bar */ const struct mgos_conf_entry *mgos_config_test_bar1_get_schema(void) { - return &mgos_config_schema_[31]; + return &mgos_config_schema_[33]; } void mgos_config_test_bar1_set_defaults(struct mgos_config_bar *cfg) { @@ -202,7 +206,7 @@ void mgos_config_test_bar1_set_defaults(struct mgos_config_bar *cfg) { /* struct mgos_config_bar_inner */ const struct mgos_conf_entry *mgos_config_test_bar2_inner_get_schema(void) { - return &mgos_config_schema_[34]; + return &mgos_config_schema_[36]; } void mgos_config_test_bar2_inner_set_defaults(struct mgos_config_bar_inner *cfg) { @@ -212,7 +216,7 @@ void mgos_config_test_bar2_inner_set_defaults(struct mgos_config_bar_inner *cfg) /* struct mgos_config_baz */ const struct mgos_conf_entry *mgos_config_test_bar2_baz_get_schema(void) { - return &mgos_config_schema_[37]; + return &mgos_config_schema_[39]; } void mgos_config_test_bar2_baz_set_defaults(struct mgos_config_baz *cfg) { @@ -221,7 +225,7 @@ void mgos_config_test_bar2_baz_set_defaults(struct mgos_config_baz *cfg) { /* struct mgos_config_bar */ const struct mgos_conf_entry *mgos_config_test_bar2_get_schema(void) { - return &mgos_config_schema_[31]; + return &mgos_config_schema_[33]; } void mgos_config_test_bar2_set_defaults(struct mgos_config_bar *cfg) { @@ -233,7 +237,7 @@ void mgos_config_test_bar2_set_defaults(struct mgos_config_bar *cfg) { /* struct mgos_config_test */ const struct mgos_conf_entry *mgos_config_test_get_schema(void) { - return &mgos_config_schema_[22]; + return &mgos_config_schema_[24]; } void mgos_config_test_set_defaults(struct mgos_config_test *cfg) { @@ -364,6 +368,16 @@ double mgos_config_get_debug_test_d2(const struct mgos_config *cfg) { return cfg double mgos_config_get_default_debug_test_d2(void) { return 0.0; } void mgos_config_set_debug_test_d2(struct mgos_config *cfg, double v) { cfg->debug.test_d2 = v; } +/* debug.test_f1 */ +float mgos_config_get_debug_test_f1(const struct mgos_config *cfg) { return cfg->debug.test_f1; } +float mgos_config_get_default_debug_test_f1(void) { return 0.123; } +void mgos_config_set_debug_test_f1(struct mgos_config *cfg, float v) { cfg->debug.test_f1 = v; } + +/* debug.test_f2 */ +float mgos_config_get_debug_test_f2(const struct mgos_config *cfg) { return cfg->debug.test_f2; } +float mgos_config_get_default_debug_test_f2(void) { return 123.0; } +void mgos_config_set_debug_test_f2(struct mgos_config *cfg, float v) { cfg->debug.test_f2 = v; } + /* debug.test_ui */ unsigned int mgos_config_get_debug_test_ui(const struct mgos_config *cfg) { return cfg->debug.test_ui; } unsigned int mgos_config_get_default_debug_test_ui(void) { return 4294967295; } diff --git a/src/test/data/golden/mgos_config.h b/src/test/data/golden/mgos_config.h index 7f62baf01..7b234a9d5 100644 --- a/src/test/data/golden/mgos_config.h +++ b/src/test/data/golden/mgos_config.h @@ -144,6 +144,8 @@ struct mgos_config_debug { const char * file_level; double test_d1; double test_d2; + float test_f1; + float test_f2; unsigned int test_ui; struct mgos_config_debug_empty empty; }; @@ -650,6 +652,26 @@ static inline double mgos_sys_config_get_default_debug_test_d2(void) { return mg void mgos_config_set_debug_test_d2(struct mgos_config *cfg, double v); static inline void mgos_sys_config_set_debug_test_d2(double v) { mgos_config_set_debug_test_d2(&mgos_sys_config, v); } +/* debug.test_f1 */ +#define MGOS_CONFIG_HAVE_DEBUG_TEST_F1 +#define MGOS_SYS_CONFIG_HAVE_DEBUG_TEST_F1 +float mgos_config_get_debug_test_f1(const struct mgos_config *cfg); +float mgos_config_get_default_debug_test_f1(void); +static inline float mgos_sys_config_get_debug_test_f1(void) { return mgos_config_get_debug_test_f1(&mgos_sys_config); } +static inline float mgos_sys_config_get_default_debug_test_f1(void) { return mgos_config_get_default_debug_test_f1(); } +void mgos_config_set_debug_test_f1(struct mgos_config *cfg, float v); +static inline void mgos_sys_config_set_debug_test_f1(float v) { mgos_config_set_debug_test_f1(&mgos_sys_config, v); } + +/* debug.test_f2 */ +#define MGOS_CONFIG_HAVE_DEBUG_TEST_F2 +#define MGOS_SYS_CONFIG_HAVE_DEBUG_TEST_F2 +float mgos_config_get_debug_test_f2(const struct mgos_config *cfg); +float mgos_config_get_default_debug_test_f2(void); +static inline float mgos_sys_config_get_debug_test_f2(void) { return mgos_config_get_debug_test_f2(&mgos_sys_config); } +static inline float mgos_sys_config_get_default_debug_test_f2(void) { return mgos_config_get_default_debug_test_f2(); } +void mgos_config_set_debug_test_f2(struct mgos_config *cfg, float v); +static inline void mgos_sys_config_set_debug_test_f2(float v) { mgos_config_set_debug_test_f2(&mgos_sys_config, v); } + /* debug.test_ui */ #define MGOS_CONFIG_HAVE_DEBUG_TEST_UI #define MGOS_SYS_CONFIG_HAVE_DEBUG_TEST_UI diff --git a/src/test/data/golden/mgos_config_pretty.json b/src/test/data/golden/mgos_config_pretty.json index 4d1520a37..52b083ffb 100644 --- a/src/test/data/golden/mgos_config_pretty.json +++ b/src/test/data/golden/mgos_config_pretty.json @@ -21,7 +21,9 @@ "dest": "uart1", "file_level": "mgos_bar=1", "test_d1": 2.000000, - "test_d2": 0.000000, + "test_d2": 111.000000, + "test_f1": 0.123000, + "test_f2": 11.500000, "test_ui": 4294967295, "empty": { } diff --git a/src/test/data/golden/mgos_config_schema.json b/src/test/data/golden/mgos_config_schema.json index 3f41626e6..78b3f0232 100644 --- a/src/test/data/golden/mgos_config_schema.json +++ b/src/test/data/golden/mgos_config_schema.json @@ -18,6 +18,8 @@ ["debug.file_level", "s", {"title": "File level"}], ["debug.test_d1", "d", {"title": "Test doubles 1"}], ["debug.test_d2", "d", {}], + ["debug.test_f1", "f", {"title": "Test float 1"}], + ["debug.test_f2", "f", {}], ["debug.test_ui", "ui", {}], ["debug.empty", "o", {"title": "Empty object with no fields"}], ["test", "o", {}], diff --git a/src/test/data/overrides.json b/src/test/data/overrides.json index 2ebe3c578..9c8dfa913 100644 --- a/src/test/data/overrides.json +++ b/src/test/data/overrides.json @@ -13,6 +13,8 @@ }, "debug": { "level": 1, - "file_level": "mgos_bar=1" + "file_level": "mgos_bar=1", + "test_d2": 111, + "test_f2": 11.5 } } diff --git a/src/test/data/sys_conf_debug.yaml b/src/test/data/sys_conf_debug.yaml index bbca06ad2..67461b147 100644 --- a/src/test/data/sys_conf_debug.yaml +++ b/src/test/data/sys_conf_debug.yaml @@ -16,6 +16,8 @@ ["debug.file_level", "s", "mg_foo.c=4", {title: "File level"}], ["debug.test_d1", "d", 0.123, {title: "Test doubles 1"}], ["debug.test_d2", "d", 0, {}], + ["debug.test_f1", "f", 0.123, {title: "Test float 1"}], + ["debug.test_f2", "f", 123, {}], ["debug.test_ui", "ui", 4294967295, {}], ["debug.empty", "o", {title: "Empty object with no fields"}], diff --git a/src/test/unit_test.c b/src/test/unit_test.c index 06c5d81b9..cc1a7b1a6 100644 --- a/src/test/unit_test.c +++ b/src/test/unit_test.c @@ -44,6 +44,10 @@ static const char *test_config(void) { ASSERT_EQ(conf.debug.level, 1); /* Override integer */ ASSERT(conf.wifi.ap.pass == NULL); /* Reset string - set to NULL */ ASSERT_EQ(conf.http.enable, 0); /* Override boolean */ + ASSERT_EQ(conf.debug.test_d2, 111.0); + ASSERT_EQ(sizeof(conf.debug.test_d2), sizeof(double)); + ASSERT_EQ(conf.debug.test_f2, 11.5); + ASSERT_EQ(sizeof(conf.debug.test_f2), sizeof(float)); ASSERT_EQ(conf.test.bar1.param1, 1111); ASSERT_EQ(conf.test.bar2.param1, 2222); @@ -70,6 +74,7 @@ static const char *test_config(void) { ASSERT_STREQ(conf.debug.file_level, conf_debug.file_level); ASSERT_EQ(conf.debug.level, conf_debug.level); ASSERT_EQ(conf.debug.test_d1, conf_debug.test_d1); + ASSERT_EQ(conf.debug.test_f1, conf_debug.test_f1); mgos_config_debug_free(&conf_debug); diff --git a/tools/mgos_gen_config.py b/tools/mgos_gen_config.py index bf428c204..755c434a5 100755 --- a/tools/mgos_gen_config.py +++ b/tools/mgos_gen_config.py @@ -117,6 +117,7 @@ class SchemaEntry: V_INT = "i" V_UNSIGNED_INT = "ui" V_BOOL = "b" + V_FLOAT = "f" V_DOUBLE = "d" V_STRING = "s" V_OBJECT = "o" @@ -125,6 +126,7 @@ class SchemaEntry: V_INT: "CONF_TYPE_INT", V_UNSIGNED_INT: "CONF_TYPE_UNSIGNED_INT", V_BOOL: "CONF_TYPE_BOOL", + V_FLOAT: "CONF_TYPE_FLOAT", V_DOUBLE: "CONF_TYPE_DOUBLE", V_STRING: "CONF_TYPE_STRING", V_OBJECT: "CONF_TYPE_OBJECT", @@ -147,7 +149,7 @@ def __init__(self, e, schema=None): self.default = 0 elif self.vtype == SchemaEntry.V_UNSIGNED_INT: self.default = 0 - elif self.vtype == SchemaEntry.V_DOUBLE: + elif self.vtype in (SchemaEntry.V_FLOAT, SchemaEntry.V_DOUBLE): self.default = 0.0 elif self.vtype == SchemaEntry.V_STRING: self.default = "" @@ -171,7 +173,7 @@ def __init__(self, e, schema=None): self.orig_path = None if self.vtype is not None: - if self.vtype == SchemaEntry.V_DOUBLE and isinstance(self.default, int): + if self.vtype in (SchemaEntry.V_FLOAT, SchemaEntry.V_DOUBLE) and isinstance(self.default, int): self.default = float(self.default) if self.IsPrimitiveType(): self.ValidateDefault() @@ -194,18 +196,18 @@ def __init__(self, e, schema=None): def IsPrimitiveType(self): return self.vtype in ( self.V_OBJECT, self.V_BOOL, self.V_INT, self.V_UNSIGNED_INT, - self.V_DOUBLE, self.V_STRING) + self.V_FLOAT, self.V_DOUBLE, self.V_STRING) def ValidateDefault(self): - if self.vtype == SchemaEntry.V_DOUBLE and type(self.default) is int: + if self.vtype in (SchemaEntry.V_FLOAT, SchemaEntry.V_DOUBLE) and type(self.default) is int: self.default = float(self.default) if (self.vtype == SchemaEntry.V_BOOL and not isinstance(self.default, bool) or self.vtype == SchemaEntry.V_INT and not isinstance(self.default, int) or self.vtype == SchemaEntry.V_UNSIGNED_INT and not isinstance(self.default, int) or # In Python, boolvalue is an instance of int, but we don't want that. self.vtype == SchemaEntry.V_INT and isinstance(self.default, bool) or - self.vtype == SchemaEntry.V_DOUBLE and not isinstance(self.default, float) or + self.vtype in (SchemaEntry.V_FLOAT, SchemaEntry.V_DOUBLE) and not isinstance(self.default, float) or self.vtype == SchemaEntry.V_STRING and not isinstance(self.default, str)): raise TypeError("%s: Invalid default value type (%s)" % (self.path, type(self.default))) if self.vtype == SchemaEntry.V_UNSIGNED_INT and self.default < 0: @@ -219,6 +221,8 @@ def GetCType(self, struct_prefix): return "int" elif self.vtype == SchemaEntry.V_UNSIGNED_INT: return "unsigned int" + elif self.vtype == SchemaEntry.V_FLOAT: + return "float" elif self.vtype == SchemaEntry.V_DOUBLE: return "double" elif self.vtype == SchemaEntry.V_STRING: