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 @@ -48,6 +48,36 @@ struct JsonbParseState
4848 bool skip_nulls ; /* Skip null object fields */
4949};
5050
51+ struct JsonbIterator
52+ {
53+ /* Container being iterated */
54+ JsonbContainer * container ;
55+ uint32 nElems ; /* Number of elements in children array (will
56+ * be nPairs for objects) */
57+ bool isScalar ; /* Pseudo-array scalar value? */
58+ JEntry * children ; /* JEntrys for child nodes */
59+ /* Data proper. This points to the beginning of the variable-length data */
60+ char * dataProper ;
61+
62+ /* Current item in buffer (up to nElems) */
63+ int curIndex ;
64+
65+ /* Data offset corresponding to current item */
66+ uint32 curDataOffset ;
67+
68+ /*
69+ * If the container is an object, we want to return keys and values
70+ * alternately; so curDataOffset points to the current key, and
71+ * curValueOffset points to the current value.
72+ */
73+ uint32 curValueOffset ;
74+
75+ /* Private state */
76+ JsonbIterState state ;
77+
78+ struct JsonbIterator * parent ;
79+ };
80+
5181static void fillJsonbValue (JsonbContainer * container , int index ,
5282 char * base_addr , uint32 offset ,
5383 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/* unlike with json categories, we need to treat json and jsonb differently */
373345typedef enum /* type categories for datum_to_jsonb */
You can’t perform that action at this time.
0 commit comments