diff options
author | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-02-20 14:36:02 +0000 |
---|---|---|
committer | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-02-20 14:36:02 +0000 |
commit | 01f4d3aa5969529357e04290c61a31b5c1265113 (patch) | |
tree | e87a1795bc8574641db6698446ed3798099f4099 | |
parent | 318f1d96d056d622e08e15f1599597ddb5390f52 (diff) | |
download | zabbix-01f4d3aa5969529357e04290c61a31b5c1265113.tar.gz zabbix-01f4d3aa5969529357e04290c61a31b5c1265113.tar.xz zabbix-01f4d3aa5969529357e04290c61a31b5c1265113.zip |
- [DEV-100] JSON
git-svn-id: svn://svn.zabbix.com/trunk@5378 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r-- | include/zbxjson.h | 1 | ||||
-rw-r--r-- | src/libs/zbxjson/json.c | 14 |
2 files changed, 7 insertions, 8 deletions
diff --git a/include/zbxjson.h b/include/zbxjson.h index 9a16168f..8fe235bc 100644 --- a/include/zbxjson.h +++ b/include/zbxjson.h @@ -47,7 +47,6 @@ typedef enum ZBX_JSON_TYPE_UNKNOWN = 0, ZBX_JSON_TYPE_STRING, ZBX_JSON_TYPE_INT, - ZBX_JSON_TYPE_FLOAT, ZBX_JSON_TYPE_ARRAY, ZBX_JSON_TYPE_OBJECT, ZBX_JSON_TYPE_NULL diff --git a/src/libs/zbxjson/json.c b/src/libs/zbxjson/json.c index 6e3fd268..de1318d2 100644 --- a/src/libs/zbxjson/json.c +++ b/src/libs/zbxjson/json.c @@ -481,7 +481,7 @@ const char *zbx_json_next(struct zbx_json_parse *jp, const char *p) return NULL; } -const char *zbx_json_decodestring(const char *p, char *string, size_t len) +static const char *zbx_json_decodestring(const char *p, char *string, size_t len) { int state = 0; /* 0 - init; 1 - inside string */ char *o = string; @@ -525,7 +525,7 @@ const char *zbx_json_decodestring(const char *p, char *string, size_t len) return NULL; } -const char *zbx_json_decodeint(const char *p, char *string, size_t len) +static const char *zbx_json_decodeint(const char *p, char *string, size_t len) { char *o = string; @@ -533,7 +533,7 @@ const char *zbx_json_decodeint(const char *p, char *string, size_t len) if (*p < '0' || *p > '9') { *o = '\0'; return p; - } else if( o - string < len - 1/*'\0'*/) + } else if (o - string < len - 1/*'\0'*/) *o++ = *p; p++; } @@ -686,13 +686,13 @@ int zbx_json_brackets_open(const char *p, struct zbx_json_parse *jp) ******************************************************************************/ zbx_json_type_t zbx_json_type(const char *p) { - if (p[0] == '"') + if (*p == '"') return ZBX_JSON_TYPE_STRING; - if (p[0] >= '0' && p[0] <= '9') + if (*p >= '0' && *p <= '9') return ZBX_JSON_TYPE_INT; - if (p[0] == '[') + if (*p == '[') return ZBX_JSON_TYPE_ARRAY; - if (p[0] == '{') + if (*p == '{') return ZBX_JSON_TYPE_OBJECT; if (p[0] == 'n' && p[1] == 'u' && p[2] == 'l' && p[3] == 'l') return ZBX_JSON_TYPE_NULL; |