Aestate
Classes | Macros | Typedefs | Functions | Variables
_speedups.c File Reference
#include "Python.h"
#include "structmember.h"
Include dependency graph for _speedups.c:

Go to the source code of this file.

Classes

struct  JSON_Accu
 
struct  _PyScannerObject
 
struct  _PyEncoderObject
 

Macros

#define PY2_UNUSED   UNUSED
 
#define PY3_UNUSED
 
#define PyBytes_Check   PyString_Check
 
#define PyUnicode_READY(obj)   0
 
#define PyUnicode_KIND(obj)   (sizeof(Py_UNICODE))
 
#define PyUnicode_DATA(obj)   ((void *)(PyUnicode_AS_UNICODE(obj)))
 
#define PyUnicode_READ(kind, data, index)   ((JSON_UNICHR)((const Py_UNICODE *)(data))[(index)])
 
#define PyUnicode_GET_LENGTH   PyUnicode_GET_SIZE
 
#define JSON_UNICHR   Py_UNICODE
 
#define JSON_InternFromString   PyString_InternFromString
 
#define PyOS_string_to_double   json_PyOS_string_to_double
 
#define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
 
#define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
 
#define PyVarObject_HEAD_INIT(type, size)   PyObject_HEAD_INIT(type) size,
 
#define UNUSED
 
#define DEFAULT_ENCODING   "utf-8"
 
#define PyScanner_Check(op)   PyObject_TypeCheck(op, &PyScannerType)
 
#define PyScanner_CheckExact(op)   (Py_TYPE(op) == &PyScannerType)
 
#define PyEncoder_Check(op)   PyObject_TypeCheck(op, &PyEncoderType)
 
#define PyEncoder_CheckExact(op)   (Py_TYPE(op) == &PyEncoderType)
 
#define JSON_ALLOW_NAN   1
 
#define JSON_IGNORE_NAN   2
 
#define ERR_EXPECTING_VALUE   "Expecting value"
 
#define ERR_ARRAY_DELIMITER   "Expecting ',' delimiter or ']'"
 
#define ERR_ARRAY_VALUE_FIRST   "Expecting value or ']'"
 
#define ERR_OBJECT_DELIMITER   "Expecting ',' delimiter or '}'"
 
#define ERR_OBJECT_PROPERTY   "Expecting property name enclosed in double quotes"
 
#define ERR_OBJECT_PROPERTY_FIRST   "Expecting property name enclosed in double quotes or '}'"
 
#define ERR_OBJECT_PROPERTY_DELIMITER   "Expecting ':' delimiter"
 
#define ERR_STRING_UNTERMINATED   "Unterminated string starting at"
 
#define ERR_STRING_CONTROL   "Invalid control character %r at"
 
#define ERR_STRING_ESC1   "Invalid \\X escape sequence %r"
 
#define ERR_STRING_ESC4   "Invalid \\uXXXX escape sequence"
 
#define S_CHAR(c)   (c >= ' ' && c <= '~' && c != '\\' && c != '"')
 
#define IS_WHITESPACE(c)   (((c) == ' ') || ((c) == '\t') || ((c) == '\n') || ((c) == '\r'))
 
#define MIN_EXPANSION   6
 
#define APPEND_OLD_CHUNK
 

Typedefs

typedef struct _PyScannerObject PyScannerObject
 
typedef struct _PyEncoderObject PyEncoderObject
 

Functions

static double json_PyOS_string_to_double (const char *s, char **endptr, PyObject *overflow_exception)
 
static int JSON_Accu_Init (JSON_Accu *acc)
 
static int JSON_Accu_Accumulate (JSON_Accu *acc, PyObject *unicode)
 
static PyObject * JSON_Accu_FinishAsList (JSON_Accu *acc)
 
static void JSON_Accu_Destroy (JSON_Accu *acc)
 
static PyObject * join_list_unicode (PyObject *lst)
 
static PyObject * JSON_ParseEncoding (PyObject *encoding)
 
static PyObject * maybe_quote_bigint (PyEncoderObject *s, PyObject *encoded, PyObject *obj)
 
static Py_ssize_t ascii_char_size (JSON_UNICHR c)
 
static Py_ssize_t ascii_escape_char (JSON_UNICHR c, char *output, Py_ssize_t chars)
 
static PyObject * ascii_escape_unicode (PyObject *pystr)
 
static PyObject * ascii_escape_str (PyObject *pystr)
 
static PyObject * py_encode_basestring_ascii (PyObject *self UNUSED, PyObject *pystr)
 
static PyObject * join_list_string (PyObject *lst)
 
static PyObject * scan_once_str (PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr)
 
static PyObject * scanstring_str (PyObject *pystr, Py_ssize_t end, char *encoding, int strict, Py_ssize_t *next_end_ptr)
 
static PyObject * _parse_object_str (PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr)
 
static PyObject * scanstring_unicode (PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next_end_ptr)
 
static PyObject * scan_once_unicode (PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr)
 
static PyObject * _build_rval_index_tuple (PyObject *rval, Py_ssize_t idx)
 
static PyObject * scanner_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
 
static void scanner_dealloc (PyObject *self)
 
static int scanner_clear (PyObject *self)
 
static PyObject * encoder_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
 
static void encoder_dealloc (PyObject *self)
 
static int encoder_clear (PyObject *self)
 
static int is_raw_json (PyObject *obj)
 
static PyObject * encoder_stringify_key (PyEncoderObject *s, PyObject *key)
 
static int encoder_listencode_list (PyEncoderObject *s, JSON_Accu *rval, PyObject *seq, Py_ssize_t indent_level)
 
static int encoder_listencode_obj (PyEncoderObject *s, JSON_Accu *rval, PyObject *obj, Py_ssize_t indent_level)
 
static int encoder_listencode_dict (PyEncoderObject *s, JSON_Accu *rval, PyObject *dct, Py_ssize_t indent_level)
 
static PyObject * _encoded_const (PyObject *obj)
 
static void raise_errmsg (char *msg, PyObject *s, Py_ssize_t end)
 
static PyObject * encoder_encode_string (PyEncoderObject *s, PyObject *obj)
 
static int _convertPyInt_AsSsize_t (PyObject *o, Py_ssize_t *size_ptr)
 
static PyObject * _convertPyInt_FromSsize_t (Py_ssize_t *size_ptr)
 
static PyObject * encoder_encode_float (PyEncoderObject *s, PyObject *obj)
 
static int _is_namedtuple (PyObject *obj)
 
static int _has_for_json_hook (PyObject *obj)
 
static PyObject * moduleinit (void)
 
static int flush_accumulator (JSON_Accu *acc)
 
static int IS_DIGIT (JSON_UNICHR c)
 
static PyObject * encoder_dict_iteritems (PyEncoderObject *s, PyObject *dct)
 
 PyDoc_STRVAR (pydoc_scanstring, "scanstring(basestring, end, encoding, strict=True) -> (str, end)\n" "\n" "Scan the string s for a JSON string. End is the index of the\n" "character in s after the quote that started the JSON string.\n" "Unescapes all valid JSON string escape sequences and raises ValueError\n" "on attempt to decode an invalid string. If strict is False then literal\n" "control characters are allowed in the string.\n" "\n" "Returns a tuple of the decoded string and the index of the character in s\n" "after the end quote.")
 
static PyObject * py_scanstring (PyObject *self UNUSED, PyObject *args)
 
 PyDoc_STRVAR (pydoc_encode_basestring_ascii, "encode_basestring_ascii(basestring) -> str\n" "\n" "Return an ASCII-only JSON representation of a Python string")
 
static int scanner_traverse (PyObject *self, visitproc visit, void *arg)
 
static PyObject * _parse_object_unicode (PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr)
 
static PyObject * _parse_array_str (PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr)
 
static PyObject * _parse_array_unicode (PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr)
 
static PyObject * _parse_constant (PyScannerObject *s, PyObject *constant, Py_ssize_t idx, Py_ssize_t *next_idx_ptr)
 
static PyObject * _match_number_str (PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_ssize_t *next_idx_ptr)
 
static PyObject * _match_number_unicode (PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_ssize_t *next_idx_ptr)
 
static PyObject * scanner_call (PyObject *self, PyObject *args, PyObject *kwds)
 
 PyDoc_STRVAR (scanner_doc, "JSON scanner object")
 
static PyObject * encoder_call (PyObject *self, PyObject *args, PyObject *kwds)
 
static int _steal_accumulate (JSON_Accu *accu, PyObject *stolen)
 
static int encoder_traverse (PyObject *self, visitproc visit, void *arg)
 
 PyDoc_STRVAR (encoder_doc, "_iterencode(obj, _current_indent_level) -> iterable")
 
 PyDoc_STRVAR (module_doc, "simplejson speedups\n")
 
PyObject * import_dependency (char *module_name, char *attr_name)
 
static int init_constants (void)
 
void init_speedups (void)
 

Variables

static PyObject * JSON_Infinity = NULL
 
static PyObject * JSON_NegInfinity = NULL
 
static PyObject * JSON_NaN = NULL
 
static PyObject * JSON_EmptyUnicode = NULL
 
static PyObject * JSON_EmptyStr = NULL
 
static PyTypeObject PyScannerType
 
static PyTypeObject PyEncoderType
 
static PyMemberDef scanner_members []
 
static PyMemberDef encoder_members []
 
static PyObject * RawJSONType = NULL
 
static PyObject * JSONDecodeError = NULL
 
static PyMethodDef speedups_methods []
 

Macro Definition Documentation

◆ APPEND_OLD_CHUNK

#define APPEND_OLD_CHUNK
Value:
if (chunk != NULL) { \
if (chunks == NULL) { \
chunks = PyList_New(0); \
if (chunks == NULL) { \
goto bail; \
} \
} \
if (PyList_Append(chunks, chunk)) { \
goto bail; \
} \
Py_CLEAR(chunk); \
}

Definition at line 828 of file _speedups.c.

◆ DEFAULT_ENCODING

#define DEFAULT_ENCODING   "utf-8"

Definition at line 65 of file _speedups.c.

◆ ERR_ARRAY_DELIMITER

#define ERR_ARRAY_DELIMITER   "Expecting ',' delimiter or ']'"

Definition at line 101 of file _speedups.c.

◆ ERR_ARRAY_VALUE_FIRST

#define ERR_ARRAY_VALUE_FIRST   "Expecting value or ']'"

Definition at line 102 of file _speedups.c.

◆ ERR_EXPECTING_VALUE

#define ERR_EXPECTING_VALUE   "Expecting value"

Definition at line 100 of file _speedups.c.

◆ ERR_OBJECT_DELIMITER

#define ERR_OBJECT_DELIMITER   "Expecting ',' delimiter or '}'"

Definition at line 103 of file _speedups.c.

◆ ERR_OBJECT_PROPERTY

#define ERR_OBJECT_PROPERTY   "Expecting property name enclosed in double quotes"

Definition at line 104 of file _speedups.c.

◆ ERR_OBJECT_PROPERTY_DELIMITER

#define ERR_OBJECT_PROPERTY_DELIMITER   "Expecting ':' delimiter"

Definition at line 106 of file _speedups.c.

◆ ERR_OBJECT_PROPERTY_FIRST

#define ERR_OBJECT_PROPERTY_FIRST   "Expecting property name enclosed in double quotes or '}'"

Definition at line 105 of file _speedups.c.

◆ ERR_STRING_CONTROL

#define ERR_STRING_CONTROL   "Invalid control character %r at"

Definition at line 108 of file _speedups.c.

◆ ERR_STRING_ESC1

#define ERR_STRING_ESC1   "Invalid \\X escape sequence %r"

Definition at line 109 of file _speedups.c.

◆ ERR_STRING_ESC4

#define ERR_STRING_ESC4   "Invalid \\uXXXX escape sequence"

Definition at line 110 of file _speedups.c.

◆ ERR_STRING_UNTERMINATED

#define ERR_STRING_UNTERMINATED   "Unterminated string starting at"

Definition at line 107 of file _speedups.c.

◆ IS_WHITESPACE

#define IS_WHITESPACE (   c)    (((c) == ' ') || ((c) == '\t') || ((c) == '\n') || ((c) == '\r'))

Definition at line 256 of file _speedups.c.

◆ JSON_ALLOW_NAN

#define JSON_ALLOW_NAN   1

Definition at line 72 of file _speedups.c.

◆ JSON_IGNORE_NAN

#define JSON_IGNORE_NAN   2

Definition at line 73 of file _speedups.c.

◆ JSON_InternFromString

#define JSON_InternFromString   PyString_InternFromString

Definition at line 25 of file _speedups.c.

◆ JSON_UNICHR

#define JSON_UNICHR   Py_UNICODE

Definition at line 24 of file _speedups.c.

◆ MIN_EXPANSION

#define MIN_EXPANSION   6

Definition at line 258 of file _speedups.c.

◆ PY2_UNUSED

#define PY2_UNUSED   UNUSED

Definition at line 16 of file _speedups.c.

◆ PY3_UNUSED

#define PY3_UNUSED

Definition at line 17 of file _speedups.c.

◆ Py_SIZE

#define Py_SIZE (   ob)    (((PyVarObject*)(ob))->ob_size)

Definition at line 52 of file _speedups.c.

◆ Py_TYPE

#define Py_TYPE (   ob)    (((PyObject*)(ob))->ob_type)

Definition at line 49 of file _speedups.c.

◆ PyBytes_Check

#define PyBytes_Check   PyString_Check

Definition at line 18 of file _speedups.c.

◆ PyEncoder_Check

#define PyEncoder_Check (   op)    PyObject_TypeCheck(op, &PyEncoderType)

Definition at line 69 of file _speedups.c.

◆ PyEncoder_CheckExact

#define PyEncoder_CheckExact (   op)    (Py_TYPE(op) == &PyEncoderType)

Definition at line 70 of file _speedups.c.

◆ PyOS_string_to_double

#define PyOS_string_to_double   json_PyOS_string_to_double

Definition at line 30 of file _speedups.c.

◆ PyScanner_Check

#define PyScanner_Check (   op)    PyObject_TypeCheck(op, &PyScannerType)

Definition at line 67 of file _speedups.c.

◆ PyScanner_CheckExact

#define PyScanner_CheckExact (   op)    (Py_TYPE(op) == &PyScannerType)

Definition at line 68 of file _speedups.c.

◆ PyUnicode_DATA

#define PyUnicode_DATA (   obj)    ((void *)(PyUnicode_AS_UNICODE(obj)))

Definition at line 21 of file _speedups.c.

◆ PyUnicode_GET_LENGTH

#define PyUnicode_GET_LENGTH   PyUnicode_GET_SIZE

Definition at line 23 of file _speedups.c.

◆ PyUnicode_KIND

#define PyUnicode_KIND (   obj)    (sizeof(Py_UNICODE))

Definition at line 20 of file _speedups.c.

◆ PyUnicode_READ

#define PyUnicode_READ (   kind,
  data,
  index 
)    ((JSON_UNICHR)((const Py_UNICODE *)(data))[(index)])

Definition at line 22 of file _speedups.c.

◆ PyUnicode_READY

#define PyUnicode_READY (   obj)    0

Definition at line 19 of file _speedups.c.

◆ PyVarObject_HEAD_INIT

#define PyVarObject_HEAD_INIT (   type,
  size 
)    PyObject_HEAD_INIT(type) size,

Definition at line 55 of file _speedups.c.

◆ S_CHAR

#define S_CHAR (   c)    (c >= ' ' && c <= '~' && c != '\\' && c != '"')

Definition at line 255 of file _speedups.c.

◆ UNUSED

#define UNUSED

Definition at line 62 of file _speedups.c.

Typedef Documentation

◆ PyEncoderObject

◆ PyScannerObject

Function Documentation

◆ _build_rval_index_tuple()

static PyObject * _build_rval_index_tuple ( PyObject *  rval,
Py_ssize_t  idx 
)
static

Definition at line 800 of file _speedups.c.

Here is the caller graph for this function:

◆ _convertPyInt_AsSsize_t()

static int _convertPyInt_AsSsize_t ( PyObject *  o,
Py_ssize_t *  size_ptr 
)
static

Definition at line 414 of file _speedups.c.

Here is the caller graph for this function:

◆ _convertPyInt_FromSsize_t()

static PyObject * _convertPyInt_FromSsize_t ( Py_ssize_t *  size_ptr)
static

Definition at line 424 of file _speedups.c.

Here is the caller graph for this function:

◆ _encoded_const()

static PyObject * _encoded_const ( PyObject *  obj)
static

Definition at line 2682 of file _speedups.c.

Here is the caller graph for this function:

◆ _has_for_json_hook()

static int _has_for_json_hook ( PyObject *  obj)
static

Definition at line 400 of file _speedups.c.

Here is the caller graph for this function:

◆ _is_namedtuple()

static int _is_namedtuple ( PyObject *  obj)
static

Definition at line 386 of file _speedups.c.

Here is the caller graph for this function:

◆ _match_number_str()

static PyObject* _match_number_str ( PyScannerObject s,
PyObject *  pystr,
Py_ssize_t  start,
Py_ssize_t *  next_idx_ptr 
)
static

Definition at line 1862 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _match_number_unicode()

static PyObject* _match_number_unicode ( PyScannerObject s,
PyObject *  pystr,
Py_ssize_t  start,
Py_ssize_t *  next_idx_ptr 
)
static

Definition at line 1967 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _parse_array_str()

static PyObject* _parse_array_str ( PyScannerObject s,
PyObject *  pystr,
Py_ssize_t  idx,
Py_ssize_t *  next_idx_ptr 
)
static

Definition at line 1680 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _parse_array_unicode()

static PyObject* _parse_array_unicode ( PyScannerObject s,
PyObject *  pystr,
Py_ssize_t  idx,
Py_ssize_t *  next_idx_ptr 
)
static

Definition at line 1760 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _parse_constant()

static PyObject* _parse_constant ( PyScannerObject s,
PyObject *  constant,
Py_ssize_t  idx,
Py_ssize_t *  next_idx_ptr 
)
static

Definition at line 1840 of file _speedups.c.

Here is the caller graph for this function:

◆ _parse_object_str()

static PyObject * _parse_object_str ( PyScannerObject s,
PyObject *  pystr,
Py_ssize_t  idx,
Py_ssize_t *  next_idx_ptr 
)
static

Definition at line 1355 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _parse_object_unicode()

static PyObject* _parse_object_unicode ( PyScannerObject s,
PyObject *  pystr,
Py_ssize_t  idx,
Py_ssize_t *  next_idx_ptr 
)
static

Definition at line 1516 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _steal_accumulate()

static int _steal_accumulate ( JSON_Accu accu,
PyObject *  stolen 
)
static

Definition at line 2785 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ascii_char_size()

static Py_ssize_t ascii_char_size ( JSON_UNICHR  c)
static

Definition at line 475 of file _speedups.c.

Here is the caller graph for this function:

◆ ascii_escape_char()

static Py_ssize_t ascii_escape_char ( JSON_UNICHR  c,
char *  output,
Py_ssize_t  chars 
)
static

Definition at line 431 of file _speedups.c.

Here is the caller graph for this function:

◆ ascii_escape_str()

static PyObject * ascii_escape_str ( PyObject *  pystr)
static

Definition at line 557 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ascii_escape_unicode()

static PyObject * ascii_escape_unicode ( PyObject *  pystr)
static

Definition at line 500 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ encoder_call()

static PyObject* encoder_call ( PyObject *  self,
PyObject *  args,
PyObject *  kwds 
)
static

Definition at line 2659 of file _speedups.c.

Here is the call graph for this function:

◆ encoder_clear()

static int encoder_clear ( PyObject *  self)
static

Definition at line 3207 of file _speedups.c.

Here is the caller graph for this function:

◆ encoder_dealloc()

static void encoder_dealloc ( PyObject *  self)
static

Definition at line 3175 of file _speedups.c.

Here is the call graph for this function:

◆ encoder_dict_iteritems()

static PyObject* encoder_dict_iteritems ( PyEncoderObject s,
PyObject *  dct 
)
static

Definition at line 667 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ encoder_encode_float()

static PyObject * encoder_encode_float ( PyEncoderObject s,
PyObject *  obj 
)
static

Definition at line 2716 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ encoder_encode_string()

static PyObject * encoder_encode_string ( PyEncoderObject s,
PyObject *  obj 
)
static

Definition at line 2760 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ encoder_listencode_dict()

static int encoder_listencode_dict ( PyEncoderObject s,
JSON_Accu rval,
PyObject *  dct,
Py_ssize_t  indent_level 
)
static

Definition at line 2942 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ encoder_listencode_list()

static int encoder_listencode_list ( PyEncoderObject s,
JSON_Accu rval,
PyObject *  seq,
Py_ssize_t  indent_level 
)
static

Definition at line 3081 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ encoder_listencode_obj()

static int encoder_listencode_obj ( PyEncoderObject s,
JSON_Accu rval,
PyObject *  obj,
Py_ssize_t  indent_level 
)
static

Definition at line 2794 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ encoder_new()

static PyObject * encoder_new ( PyTypeObject *  type,
PyObject *  args,
PyObject *  kwds 
)
static

Definition at line 2483 of file _speedups.c.

Here is the call graph for this function:

◆ encoder_stringify_key()

static PyObject * encoder_stringify_key ( PyEncoderObject s,
PyObject *  key 
)
static

Definition at line 606 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ encoder_traverse()

static int encoder_traverse ( PyObject *  self,
visitproc  visit,
void *  arg 
)
static

Definition at line 3184 of file _speedups.c.

◆ flush_accumulator()

static int flush_accumulator ( JSON_Accu acc)
static

Definition at line 279 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ import_dependency()

PyObject* import_dependency ( char *  module_name,
char *  attr_name 
)

Definition at line 3306 of file _speedups.c.

Here is the caller graph for this function:

◆ init_constants()

static int init_constants ( void  )
static

Definition at line 3318 of file _speedups.c.

Here is the caller graph for this function:

◆ init_speedups()

void init_speedups ( void  )

Definition at line 3380 of file _speedups.c.

Here is the call graph for this function:

◆ IS_DIGIT()

static int IS_DIGIT ( JSON_UNICHR  c)
static

Definition at line 360 of file _speedups.c.

Here is the caller graph for this function:

◆ is_raw_json()

static int is_raw_json ( PyObject *  obj)
static

Definition at line 262 of file _speedups.c.

Here is the caller graph for this function:

◆ join_list_string()

static PyObject * join_list_string ( PyObject *  lst)
static

Definition at line 786 of file _speedups.c.

Here is the caller graph for this function:

◆ join_list_unicode()

static PyObject * join_list_unicode ( PyObject *  lst)
static

Definition at line 776 of file _speedups.c.

Here is the caller graph for this function:

◆ JSON_Accu_Accumulate()

static int JSON_Accu_Accumulate ( JSON_Accu acc,
PyObject *  unicode 
)
static

Definition at line 309 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ JSON_Accu_Destroy()

static void JSON_Accu_Destroy ( JSON_Accu acc)
static

Definition at line 353 of file _speedups.c.

Here is the caller graph for this function:

◆ JSON_Accu_FinishAsList()

static PyObject * JSON_Accu_FinishAsList ( JSON_Accu acc)
static

Definition at line 334 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ JSON_Accu_Init()

static int JSON_Accu_Init ( JSON_Accu acc)
static

Definition at line 268 of file _speedups.c.

Here is the caller graph for this function:

◆ JSON_ParseEncoding()

static PyObject * JSON_ParseEncoding ( PyObject *  encoding)
static

Definition at line 2353 of file _speedups.c.

Here is the caller graph for this function:

◆ json_PyOS_string_to_double()

static double json_PyOS_string_to_double ( const char *  s,
char **  endptr,
PyObject *  overflow_exception 
)
static

Definition at line 34 of file _speedups.c.

◆ maybe_quote_bigint()

static PyObject * maybe_quote_bigint ( PyEncoderObject s,
PyObject *  encoded,
PyObject *  obj 
)
static

Definition at line 366 of file _speedups.c.

Here is the caller graph for this function:

◆ moduleinit()

static PyObject * moduleinit ( void  )
static

Definition at line 3344 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ py_encode_basestring_ascii()

static PyObject * py_encode_basestring_ascii ( PyObject *self  UNUSED,
PyObject *  pystr 
)
static

Definition at line 1290 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ py_scanstring()

static PyObject* py_scanstring ( PyObject *self  UNUSED,
PyObject *  args 
)
static

Definition at line 1248 of file _speedups.c.

Here is the call graph for this function:

◆ PyDoc_STRVAR() [1/5]

PyDoc_STRVAR ( encoder_doc  ,
"_iterencode(obj, _current_indent_level) -> iterable"   
)

◆ PyDoc_STRVAR() [2/5]

PyDoc_STRVAR ( module_doc  ,
"simplejson speedups\n"   
)

◆ PyDoc_STRVAR() [3/5]

PyDoc_STRVAR ( pydoc_encode_basestring_ascii  ,
"encode_basestring_ascii(basestring) -> str\n" "\n" "Return an ASCII-only JSON representation of a Python string"   
)

◆ PyDoc_STRVAR() [4/5]

PyDoc_STRVAR ( pydoc_scanstring  ,
"scanstring(basestring, end, encoding, strict=True) -> (str, end)\n" "\n" "Scan the string s for a JSON string. End is the index of the\n" "character in s after the quote that started the JSON string.\n" "Unescapes all valid JSON string escape sequences and raises ValueError\n" "on attempt to decode an invalid string. If strict is False then literal\n" "control characters are allowed in the string.\n" "\n" "Returns a tuple of the decoded string and the index of the character in s\n" "after the end quote."   
)

◆ PyDoc_STRVAR() [5/5]

PyDoc_STRVAR ( scanner_doc  ,
"JSON scanner object"   
)

◆ raise_errmsg()

static void raise_errmsg ( char *  msg,
PyObject *  s,
Py_ssize_t  end 
)
static

Definition at line 766 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scan_once_str()

static PyObject * scan_once_str ( PyScannerObject s,
PyObject *  pystr,
Py_ssize_t  idx,
Py_ssize_t *  next_idx_ptr 
)
static

Definition at line 2079 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scan_once_unicode()

static PyObject * scan_once_unicode ( PyScannerObject s,
PyObject *  pystr,
Py_ssize_t  idx,
Py_ssize_t *  next_idx_ptr 
)
static

Definition at line 2186 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scanner_call()

static PyObject* scanner_call ( PyObject *  self,
PyObject *  args,
PyObject *  kwds 
)
static

Definition at line 2318 of file _speedups.c.

Here is the call graph for this function:

◆ scanner_clear()

static int scanner_clear ( PyObject *  self)
static

Definition at line 1337 of file _speedups.c.

Here is the caller graph for this function:

◆ scanner_dealloc()

static void scanner_dealloc ( PyObject *  self)
static

Definition at line 1311 of file _speedups.c.

Here is the call graph for this function:

◆ scanner_new()

static PyObject * scanner_new ( PyTypeObject *  type,
PyObject *  args,
PyObject *  kwds 
)
static

Definition at line 2378 of file _speedups.c.

Here is the call graph for this function:

◆ scanner_traverse()

static int scanner_traverse ( PyObject *  self,
visitproc  visit,
void *  arg 
)
static

Definition at line 1320 of file _speedups.c.

◆ scanstring_str()

static PyObject * scanstring_str ( PyObject *  pystr,
Py_ssize_t  end,
char *  encoding,
int  strict,
Py_ssize_t *  next_end_ptr 
)
static

Definition at line 844 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scanstring_unicode()

static PyObject * scanstring_unicode ( PyObject *  pystr,
Py_ssize_t  end,
int  strict,
Py_ssize_t *  next_end_ptr 
)
static

Definition at line 1051 of file _speedups.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ encoder_members

PyMemberDef encoder_members[]
static
Initial value:
= {
{"markers", T_OBJECT, offsetof(PyEncoderObject, markers), READONLY, "markers"},
{"default", T_OBJECT, offsetof(PyEncoderObject, defaultfn), READONLY, "default"},
{"encoder", T_OBJECT, offsetof(PyEncoderObject, encoder), READONLY, "encoder"},
{"encoding", T_OBJECT, offsetof(PyEncoderObject, encoder), READONLY, "encoding"},
{"indent", T_OBJECT, offsetof(PyEncoderObject, indent), READONLY, "indent"},
{"key_separator", T_OBJECT, offsetof(PyEncoderObject, key_separator), READONLY, "key_separator"},
{"item_separator", T_OBJECT, offsetof(PyEncoderObject, item_separator), READONLY, "item_separator"},
{"sort_keys", T_OBJECT, offsetof(PyEncoderObject, sort_keys), READONLY, "sort_keys"},
{"skipkeys", T_OBJECT, offsetof(PyEncoderObject, skipkeys_bool), READONLY, "skipkeys"},
{"key_memo", T_OBJECT, offsetof(PyEncoderObject, key_memo), READONLY, "key_memo"},
{"item_sort_key", T_OBJECT, offsetof(PyEncoderObject, item_sort_key), READONLY, "item_sort_key"},
{"max_long_size", T_OBJECT, offsetof(PyEncoderObject, max_long_size), READONLY, "max_long_size"},
{"min_long_size", T_OBJECT, offsetof(PyEncoderObject, min_long_size), READONLY, "min_long_size"},
{NULL}
}

Definition at line 164 of file _speedups.c.

◆ JSON_EmptyStr

PyObject* JSON_EmptyStr = NULL
static

Definition at line 80 of file _speedups.c.

◆ JSON_EmptyUnicode

PyObject* JSON_EmptyUnicode = NULL
static

Definition at line 78 of file _speedups.c.

◆ JSON_Infinity

PyObject* JSON_Infinity = NULL
static

Definition at line 75 of file _speedups.c.

◆ JSON_NaN

PyObject* JSON_NaN = NULL
static

Definition at line 77 of file _speedups.c.

◆ JSON_NegInfinity

PyObject* JSON_NegInfinity = NULL
static

Definition at line 76 of file _speedups.c.

◆ JSONDecodeError

PyObject* JSONDecodeError = NULL
static

Definition at line 764 of file _speedups.c.

◆ PyEncoderType

static PyTypeObject PyEncoderType
static

Definition at line 84 of file _speedups.c.

◆ PyScannerType

static PyTypeObject PyScannerType
static

Definition at line 83 of file _speedups.c.

◆ RawJSONType

PyObject* RawJSONType = NULL
static

Definition at line 260 of file _speedups.c.

◆ scanner_members

PyMemberDef scanner_members[]
static
Initial value:
= {
{"encoding", T_OBJECT, offsetof(PyScannerObject, encoding), READONLY, "encoding"},
{"strict", T_OBJECT, offsetof(PyScannerObject, strict_bool), READONLY, "strict"},
{"object_hook", T_OBJECT, offsetof(PyScannerObject, object_hook), READONLY, "object_hook"},
{"object_pairs_hook", T_OBJECT, offsetof(PyScannerObject, pairs_hook), READONLY, "object_pairs_hook"},
{"parse_float", T_OBJECT, offsetof(PyScannerObject, parse_float), READONLY, "parse_float"},
{"parse_int", T_OBJECT, offsetof(PyScannerObject, parse_int), READONLY, "parse_int"},
{"parse_constant", T_OBJECT, offsetof(PyScannerObject, parse_constant), READONLY, "parse_constant"},
{NULL}
}

Definition at line 125 of file _speedups.c.

◆ speedups_methods

PyMethodDef speedups_methods[]
static
Initial value:
= {
{"encode_basestring_ascii",
METH_O,
pydoc_encode_basestring_ascii},
{"scanstring",
(PyCFunction)py_scanstring,
METH_VARARGS,
pydoc_scanstring},
{NULL, NULL, 0, NULL}
}

Definition at line 3276 of file _speedups.c.

py_encode_basestring_ascii
static PyObject * py_encode_basestring_ascii(PyObject *self UNUSED, PyObject *pystr)
Definition: _speedups.c:1290
_PyScannerObject
Definition: _speedups.c:112
py_scanstring
static PyObject * py_scanstring(PyObject *self UNUSED, PyObject *args)
Definition: _speedups.c:1248
_PyEncoderObject
Definition: _speedups.c:136