webmcp

changeset 159:ddb9b9b0d210

Removed json.isnull function from JSON library (use json.type(...) == "null" instead)
author jbe
date Thu Jul 31 03:54:57 2014 +0200 (2014-07-31)
parents d42a7a840358
children d5e5e8a9b79a
files libraries/json/json.c
line diff
     1.1 --- a/libraries/json/json.c	Thu Jul 31 03:49:43 2014 +0200
     1.2 +++ b/libraries/json/json.c	Thu Jul 31 03:54:57 2014 +0200
     1.3 @@ -545,21 +545,6 @@
     1.4    return json_path(L, 1);
     1.5  }
     1.6  
     1.7 -// checks if a value in a JSON document (first argument) is
     1.8 -// explicitly set to null:
     1.9 -static int json_isnull(lua_State *L) {
    1.10 -  const char *jsontype;
    1.11 -  // call json_type function with variable arguments:
    1.12 -  lua_pushcfunction(L, json_type);
    1.13 -  lua_insert(L, 1);
    1.14 -  lua_call(L, lua_gettop(L) - 1, 1);
    1.15 -  // return true if result equals to string "null", otherwise return false:
    1.16 -  jsontype = lua_tostring(L, -1);
    1.17 -  if (jsontype && !strcmp(jsontype, "null")) lua_pushboolean(L, 1);
    1.18 -  else lua_pushboolean(L, 0);
    1.19 -  return 1;
    1.20 -}
    1.21 -
    1.22  // returns the length of a JSON array (or zero for a table without numeric keys):
    1.23  static int json_len(lua_State *L) {
    1.24    // stack shall contain one function argument:
    1.25 @@ -832,7 +817,6 @@
    1.26    {"export", json_export},
    1.27    {"get", json_get},
    1.28    {"type", json_type},
    1.29 -  {"isnull", json_isnull},
    1.30    {NULL, NULL}
    1.31  };
    1.32  

Impressum / About Us