@@ -42,8 +42,8 @@ Encoder notes:
42
42
------------------
43
43
44
44
:: Cyclic references ::
45
- Cyclic referenced objects are not detected.
46
- Set JSONObjectEncoder.recursionMax to suitable value or make sure input object
45
+ Cyclic referenced objects are not detected.
46
+ Set JSONObjectEncoder.recursionMax to suitable value or make sure input object
47
47
tree doesn't have cyclic references.
48
48
49
49
*/
@@ -80,9 +80,7 @@ Dictates and limits how much stack space for buffers UltraJSON will use before r
80
80
typedef __int64 JSINT64 ;
81
81
typedef unsigned __int64 JSUINT64 ;
82
82
83
- #ifndef __MINGW32__
84
83
typedef unsigned __int32 uint32_t ;
85
- #endif
86
84
typedef __int32 JSINT32 ;
87
85
typedef uint32_t JSUINT32 ;
88
86
typedef unsigned __int8 JSUINT8 ;
@@ -93,7 +91,7 @@ typedef __int64 JSLONG;
93
91
#define EXPORTFUNCTION __declspec(dllexport)
94
92
95
93
#define FASTCALL_MSVC __fastcall
96
- #define FASTCALL_ATTR
94
+ #define FASTCALL_ATTR
97
95
#define INLINE_PREFIX __inline
98
96
99
97
#else
@@ -105,7 +103,7 @@ typedef u_int64_t JSUINT64;
105
103
typedef int32_t JSINT32 ;
106
104
typedef u_int32_t JSUINT32 ;
107
105
108
- #define FASTCALL_MSVC
106
+ #define FASTCALL_MSVC
109
107
#define FASTCALL_ATTR __attribute__((fastcall))
110
108
#define INLINE_PREFIX inline
111
109
@@ -144,7 +142,7 @@ enum JSTYPES
144
142
JT_DOUBLE , //(double)
145
143
JT_UTF8 , //(char 8-bit)
146
144
JT_ARRAY , // Array structure
147
- JT_OBJECT , // Key/Value structure
145
+ JT_OBJECT , // Key/Value structure
148
146
JT_INVALID , // Internal, do not return nor expect
149
147
};
150
148
@@ -179,8 +177,8 @@ typedef struct __JSONObjectEncoder
179
177
double (* getDoubleValue )(JSOBJ obj , JSONTypeContext * tc );
180
178
181
179
/*
182
- Begin iteration of an iteratable object (JS_ARRAY or JS_OBJECT)
183
- Implementor should setup iteration state in ti->prv
180
+ Begin iteration of an iteratable object (JS_ARRAY or JS_OBJECT)
181
+ Implementor should setup iteration state in ti->prv
184
182
*/
185
183
JSPFN_ITERBEGIN iterBegin ;
186
184
@@ -201,20 +199,20 @@ typedef struct __JSONObjectEncoder
201
199
The is responsible for the life-cycle of the returned string. Use iterNext/iterEnd and ti->prv to keep track of current object
202
200
*/
203
201
JSPFN_ITERGETVALUE iterGetValue ;
204
-
202
+
205
203
/*
206
- Return name of iterator.
204
+ Return name of iterator.
207
205
The is responsible for the life-cycle of the returned string. Use iterNext/iterEnd and ti->prv to keep track of current object
208
206
*/
209
207
JSPFN_ITERGETNAME iterGetName ;
210
-
208
+
211
209
/*
212
210
Release a value as indicated by setting ti->release = 1 in the previous getValue call.
213
211
The ti->prv array should contain the necessary context to release the value
214
212
*/
215
213
void (* releaseObject )(JSOBJ obj );
216
214
217
- /* Library functions
215
+ /* Library functions
218
216
Set to NULL to use STDLIB malloc,realloc,free */
219
217
JSPFN_MALLOC malloc ;
220
218
JSPFN_REALLOC realloc ;
@@ -258,11 +256,11 @@ buffer - Preallocated buffer to store result in. If NULL function allocates own
258
256
cbBuffer - Length of buffer (ignored if buffer is NULL)
259
257
260
258
Returns:
261
- Encoded JSON object as a null terminated char string.
259
+ Encoded JSON object as a null terminated char string.
262
260
263
261
NOTE:
264
- If the supplied buffer wasn't enough to hold the result the function will allocate a new buffer.
265
- Life cycle of the provided buffer must still be handled by caller.
262
+ If the supplied buffer wasn't enough to hold the result the function will allocate a new buffer.
263
+ Life cycle of the provided buffer must still be handled by caller.
266
264
267
265
If the return value doesn't equal the specified buffer caller must release the memory using
268
266
JSONObjectEncoder.free or free() as specified when calling this function.
0 commit comments