Skip to content

Commit 856dc9a

Browse files
author
Nikita Glukhov
committed
Hide JsonbIterator struct definition
1 parent 080b741 commit 856dc9a

File tree

2 files changed

+31
-29
lines changed

2 files changed

+31
-29
lines changed

src/backend/utils/adt/jsonb_util.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
5181
static void fillJsonbValue(JsonbContainer *container, int index,
5282
char *base_addr, uint32 offset,
5383
JsonbValue *result);

src/include/utils/jsonb.h

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff 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 */
373345
typedef enum /* type categories for datum_to_jsonb */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy