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
4545 struct JsonbParseState * next ;
4646};
4747
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+
4878static void fillJsonbValue (JsonbContainer * container , int index ,
4979 char * base_addr , uint32 offset ,
5080 JsonbValue * result );
Original file line number Diff line number Diff line change @@ -339,35 +339,7 @@ typedef enum
339339 JBI_OBJECT_VALUE
340340} JsonbIterState ;
341341
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 ;
371343
372344
373345/* Support functions */
You can’t perform that action at this time.
0 commit comments