Crossfire Server, Trunk
|
#include <cfpython.h>
#include <Python.h>
#include <stddef.h>
#include <stdio.h>
#include <ctype.h>
#include <math.h>
Go to the source code of this file.
Data Structures | |
struct | JSONData |
Macros | |
#define | False 0 |
#define | INFINITY HUGE_VAL |
#define | MODULE_VERSION "1.0.5" |
#define | NAN (HUGE_VAL-HUGE_VAL) |
#define | Py_IS_NAN(X) ((X) != (X)) |
#define | PY_SSIZE_T_MAX INT_MAX |
#define | PY_SSIZE_T_MIN INT_MIN |
#define | skipSpaces(d) while (*((d)->ptr) && isspace(*((d)->ptr))) (d)->ptr++ |
#define | SSIZE_T_F "%d" |
#define | True 1 |
Typedefs | |
typedef struct JSONData | JSONData |
typedef int | Py_ssize_t |
Functions | |
static PyObject * | cjson_PyObject_Str (PyObject *obj) |
static PyObject * | decode_array (JSONData *jsondata) |
static PyObject * | decode_bool (JSONData *jsondata) |
static PyObject * | decode_inf (JSONData *jsondata) |
static PyObject * | decode_json (JSONData *jsondata) |
static PyObject * | decode_nan (JSONData *jsondata) |
static PyObject * | decode_null (JSONData *jsondata) |
static PyObject * | decode_number (JSONData *jsondata) |
static PyObject * | decode_object (JSONData *jsondata) |
static PyObject * | decode_string (JSONData *jsondata) |
static PyObject * | encode_dict (PyObject *object) |
static PyObject * | encode_list (PyObject *object) |
static PyObject * | encode_object (PyObject *object) |
static PyObject * | encode_string (PyObject *object) |
static PyObject * | encode_tuple (PyObject *object) |
static PyObject * | encode_unicode (PyObject *object) |
static void | getRowAndCol (char *begin, char *current, int *row, int *col) |
static void | initcjson_shared (PyObject *m) |
static PyObject * | JSON_decode (PyObject *self, PyObject *args, PyObject *kwargs) |
static PyObject * | JSON_encode (PyObject *self, PyObject *object) |
PyDoc_STRVAR (module_doc, "Fast JSON encoder/decoder module.") | |
PyObject * | PyInit_cjson (void) |
Variables | |
static PyMethodDef | cjson_methods [] |
static PyModuleDef | cjsonModule |
static PyObject * | JSON_DecodeError |
static PyObject * | JSON_EncodeError |
static PyObject * | JSON_Error |
#define skipSpaces | ( | d | ) | while (*((d)->ptr) && isspace(*((d)->ptr))) (d)->ptr++ |
typedef int Py_ssize_t |
|
static |
Same as PyObject_Str but return a UTF-8 encoded Bytes object instead.
Definition at line 75 of file cjson.c.
References rotate-tower::result.
Referenced by encode_object().
|
static |
Definition at line 349 of file cjson.c.
References c, decode_json(), False, getRowAndCol(), say::item, JSON_DecodeError, JSONData::ptr, rotate-tower::result, skipSpaces, SSIZE_T_F, JSONData::str, and True.
Referenced by decode_json().
|
static |
Definition at line 116 of file cjson.c.
References JSONData::end, getRowAndCol(), JSON_DecodeError, JSONData::ptr, SSIZE_T_F, and JSONData::str.
Referenced by decode_json().
|
static |
Definition at line 238 of file cjson.c.
References JSONData::end, getRowAndCol(), INFINITY, JSON_DecodeError, JSONData::ptr, SSIZE_T_F, and JSONData::str.
Referenced by decode_json().
|
static |
Definition at line 508 of file cjson.c.
References decode_array(), decode_bool(), decode_inf(), decode_nan(), decode_null(), decode_number(), decode_object(), decode_string(), JSON_DecodeError, JSONData::ptr, and skipSpaces.
Referenced by decode_array(), decode_object(), and JSON_decode().
|
static |
Definition at line 265 of file cjson.c.
References JSONData::end, getRowAndCol(), JSON_DecodeError, NAN, JSONData::ptr, SSIZE_T_F, and JSONData::str.
Referenced by decode_json().
|
static |
Definition at line 98 of file cjson.c.
References JSONData::end, getRowAndCol(), JSON_DecodeError, JSONData::ptr, SSIZE_T_F, and JSONData::str.
Referenced by decode_json().
|
static |
Definition at line 283 of file cjson.c.
References c, False, getRowAndCol(), JSON_DecodeError, JSONData::ptr, SSIZE_T_F, JSONData::str, make_face_from_files::str, and True.
Referenced by decode_json().
|
static |
Definition at line 413 of file cjson.c.
References c, decode_json(), False, getRowAndCol(), JSON_DecodeError, castle_read::key, JSONData::ptr, rotate-tower::result, skipSpaces, SSIZE_T_F, JSONData::str, True, and autojail::value.
Referenced by decode_json().
|
static |
Definition at line 138 of file cjson.c.
References JSONData::all_unicode, c, False, getRowAndCol(), JSON_DecodeError, JSONData::ptr, SSIZE_T_F, JSONData::str, True, is_valid_types_gen::type, and autojail::value.
Referenced by decode_json().
|
static |
Definition at line 935 of file cjson.c.
References autojail::dict, encode_object(), JSON_EncodeError, castle_read::key, rotate-tower::result, takeitem::status, guildbuy::temp, and autojail::value.
Referenced by encode_object().
|
static |
Definition at line 856 of file cjson.c.
References encode_object(), JSON_EncodeError, guildoracle::list, rotate-tower::result, takeitem::status, and guildbuy::temp.
Referenced by encode_object().
|
static |
Definition at line 1023 of file cjson.c.
References cjson_PyObject_Str(), encode_dict(), encode_list(), encode_string(), encode_tuple(), encode_unicode(), JSON_EncodeError, and Py_IS_NAN.
Referenced by encode_dict(), encode_list(), encode_tuple(), and JSON_encode().
|
static |
Definition at line 586 of file cjson.c.
References c, give::op, and PY_SSIZE_T_MAX.
Referenced by encode_object().
|
static |
Definition at line 793 of file cjson.c.
References encode_object(), rotate-tower::result, and guildbuy::temp.
Referenced by encode_object().
|
static |
Definition at line 651 of file cjson.c.
References PY_SSIZE_T_MAX, and rotate-tower::result.
Referenced by encode_object().
|
static |
Definition at line 87 of file cjson.c.
References replace::current.
Referenced by decode_array(), decode_bool(), decode_inf(), decode_nan(), decode_null(), decode_number(), decode_object(), and decode_string().
|
static |
Definition at line 1149 of file cjson.c.
References JSON_DecodeError, JSON_EncodeError, JSON_Error, m, and MODULE_VERSION.
Referenced by PyInit_cjson().
|
static |
Definition at line 1072 of file cjson.c.
References JSONData::all_unicode, make_face_from_files::args, decode_json(), JSONData::end, JSON_DecodeError, JSONData::ptr, skipSpaces, SSIZE_T_F, JSONData::str, make_face_from_files::str, True, and nlohmann::detail::void().
|
static |
Definition at line 1065 of file cjson.c.
References encode_object(), and nlohmann::detail::void().
PyDoc_STRVAR | ( | module_doc | , |
"Fast JSON encoder/decoder module." | |||
) |
PyObject* PyInit_cjson | ( | void | ) |
Definition at line 1185 of file cjson.c.
References cjsonModule, initcjson_shared(), and m.
Referenced by initPlugin().
|
static |
|
static |
Definition at line 1173 of file cjson.c.
Referenced by PyInit_cjson().
|
static |
Definition at line 42 of file cjson.c.
Referenced by decode_array(), decode_bool(), decode_inf(), decode_json(), decode_nan(), decode_null(), decode_number(), decode_object(), decode_string(), initcjson_shared(), and JSON_decode().
|
static |
Definition at line 41 of file cjson.c.
Referenced by encode_dict(), encode_list(), encode_object(), and initcjson_shared().
|
static |
Definition at line 40 of file cjson.c.
Referenced by initcjson_shared().