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 @@ -45,6 +45,36 @@ struct JsonbParseState
45
45
struct JsonbParseState * next ;
46
46
};
47
47
48
+ struct JsonbIterator
49
+ {
50
+ /* Container being iterated */
51
+ JsonbContainer * container ;
52
+ uint32 nElems ; /* Number of elements in children array (will
53
+ * be nPairs for objects) */
54
+ bool isScalar ; /* Pseudo-array scalar value? */
55
+ JEntry * children ; /* JEntrys for child nodes */
56
+ /* Data proper. This points to the beginning of the variable-length data */
57
+ char * dataProper ;
58
+
59
+ /* Current item in buffer (up to nElems) */
60
+ int curIndex ;
61
+
62
+ /* Data offset corresponding to current item */
63
+ uint32 curDataOffset ;
64
+
65
+ /*
66
+ * If the container is an object, we want to return keys and values
67
+ * alternately; so curDataOffset points to the current key, and
68
+ * curValueOffset points to the current value.
69
+ */
70
+ uint32 curValueOffset ;
71
+
72
+ /* Private state */
73
+ JsonbIterState state ;
74
+
75
+ struct JsonbIterator * parent ;
76
+ };
77
+
48
78
static void fillJsonbValue (JsonbContainer * container , int index ,
49
79
char * base_addr , uint32 offset ,
50
80
JsonbValue * result );
Original file line number Diff line number Diff line change @@ -339,35 +339,7 @@ typedef enum
339
339
JBI_OBJECT_VALUE
340
340
} JsonbIterState ;
341
341
342
- typedef struct JsonbIterator
343
- {
344
- /* Container being iterated */
345
- JsonbContainer * container ;
346
- uint32 nElems ; /* Number of elements in children array (will
347
- * be nPairs for objects) */
348
- bool isScalar ; /* Pseudo-array scalar value? */
349
- JEntry * children ; /* JEntrys for child nodes */
350
- /* Data proper. This points to the beginning of the variable-length data */
351
- char * dataProper ;
352
-
353
- /* Current item in buffer (up to nElems) */
354
- int curIndex ;
355
-
356
- /* Data offset corresponding to current item */
357
- uint32 curDataOffset ;
358
-
359
- /*
360
- * If the container is an object, we want to return keys and values
361
- * alternately; so curDataOffset points to the current key, and
362
- * curValueOffset points to the current value.
363
- */
364
- uint32 curValueOffset ;
365
-
366
- /* Private state */
367
- JsonbIterState state ;
368
-
369
- struct JsonbIterator * parent ;
370
- } JsonbIterator ;
342
+ typedef struct JsonbIterator JsonbIterator ;
371
343
372
344
373
345
/* Support functions */
You can’t perform that action at this time.
0 commit comments