| 1405 | } |
| 1406 | |
| 1407 | int luaopen_cjson(lua_State *l) |
| 1408 | { |
| 1409 | lua_cjson_new(l); |
| 1410 | |
| 1411 | #ifdef ENABLE_CJSON_GLOBAL |
| 1412 | /* Register a global "cjson" table. */ |
| 1413 | lua_pushvalue(l, -1); |
| 1414 | lua_setglobal(l, CJSON_MODNAME); |
| 1415 | #endif |
| 1416 | |
| 1417 | /* Return cjson table */ |
| 1418 | return 1; |
| 1419 | } |
| 1420 | |
| 1421 | int luaopen_cjson_safe(lua_State *l) |
| 1422 | { |