File tree Expand file tree Collapse file tree 2 files changed +31
-29
lines changed Expand file tree Collapse file tree 2 files changed +31
-29
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,36 @@ struct JsonbParseState
41
41
struct JsonbParseState * next ;
42
42
};
43
43
44
+ struct JsonbIterator
45
+ {
46
+ /* Container being iterated */
47
+ JsonbContainer * container ;
48
+ uint32 nElems ; /* Number of elements in children array (will
49
+ * be nPairs for objects) */
50
+ bool isScalar ; /* Pseudo-array scalar value? */
51
+ JEntry * children ; /* JEntrys for child nodes */
52
+ /* Data proper. This points to the beginning of the variable-length data */
53
+ char * dataProper ;
54
+
55
+ /* Current item in buffer (up to nElems) */
56
+ int curIndex ;
57
+
58
+ /* Data offset corresponding to current item */
59
+ uint32 curDataOffset ;
60
+
61
+ /*
62
+ * If the container is an object, we want to return keys and values
63
+ * alternately; so curDataOffset points to the current key, and
64
+ * curValueOffset points to the current value.
65
+ */
66
+ uint32 curValueOffset ;
67
+
68
+ /* Private state */
69
+ JsonbIterState state ;
70
+
71
+ struct JsonbIterator * parent ;
72
+ };
73
+
44
74
static void fillJsonbValue (JsonbContainer * container , int index ,
45
75
char * base_addr , uint32 offset ,
46
76
JsonbValue * result );
Original file line number Diff line number Diff line change @@ -316,35 +316,7 @@ typedef enum
316
316
JBI_OBJECT_VALUE
317
317
} JsonbIterState ;
318
318
319
- typedef struct JsonbIterator
320
- {
321
- /* Container being iterated */
322
- JsonbContainer * container ;
323
- uint32 nElems ; /* Number of elements in children array (will
324
- * be nPairs for objects) */
325
- bool isScalar ; /* Pseudo-array scalar value? */
326
- JEntry * children ; /* JEntrys for child nodes */
327
- /* Data proper. This points to the beginning of the variable-length data */
328
- char * dataProper ;
329
-
330
- /* Current item in buffer (up to nElems) */
331
- int curIndex ;
332
-
333
- /* Data offset corresponding to current item */
334
- uint32 curDataOffset ;
335
-
336
- /*
337
- * If the container is an object, we want to return keys and values
338
- * alternately; so curDataOffset points to the current key, and
339
- * curValueOffset points to the current value.
340
- */
341
- uint32 curValueOffset ;
342
-
343
- /* Private state */
344
- JsonbIterState state ;
345
-
346
- struct JsonbIterator * parent ;
347
- } JsonbIterator ;
319
+ typedef struct JsonbIterator JsonbIterator ;
348
320
349
321
350
322
/* Support functions */
You can’t perform that action at this time.
0 commit comments