Skip to content

Commit 14daf4a

Browse files
author
Nikita Glukhov
committed
Export appendToBuffer(), reserveFromBuffer()
1 parent fbf9ada commit 14daf4a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/backend/utils/adt/jsonb_util.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ static void convertJsonbArray(StringInfo buffer, JEntry *header, const JsonbValu
8989
static void convertJsonbObject(StringInfo buffer, JEntry *header, const JsonbValue *val, int level);
9090
static void convertJsonbScalar(StringInfo buffer, JEntry *header, const JsonbValue *scalarVal);
9191

92-
static int reserveFromBuffer(StringInfo buffer, int len);
93-
static void appendToBuffer(StringInfo buffer, const char *data, int len);
9492
static void copyToBuffer(StringInfo buffer, int offset, const char *data, int len);
9593
static short padBufferToInt(StringInfo buffer);
9694

@@ -1589,7 +1587,7 @@ compareJsonbScalarValue(const JsonbValue *aScalar, const JsonbValue *bScalar)
15891587
* Returns the offset to the reserved area. The caller is expected to fill
15901588
* the reserved area later with copyToBuffer().
15911589
*/
1592-
static int
1590+
int
15931591
reserveFromBuffer(StringInfo buffer, int len)
15941592
{
15951593
int offset;
@@ -1624,7 +1622,7 @@ copyToBuffer(StringInfo buffer, int offset, const char *data, int len)
16241622
/*
16251623
* A shorthand for reserveFromBuffer + copyToBuffer.
16261624
*/
1627-
static void
1625+
void
16281626
appendToBuffer(StringInfo buffer, const char *data, int len)
16291627
{
16301628
int offset;

src/include/utils/jsonb.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,8 @@ extern void JsonbHashScalarValue(const JsonbValue *scalarVal, uint32 *hash);
387387
extern void JsonbHashScalarValueExtended(const JsonbValue *scalarVal,
388388
uint64 *hash, uint64 seed);
389389

390+
extern int reserveFromBuffer(StringInfo buffer, int len);
391+
extern void appendToBuffer(StringInfo buffer, const char *data, int len);
390392
/* jsonb.c support functions */
391393
extern Datum jsonb_from_text(text *js, bool unique_keys);
392394
extern char *JsonbToCString(StringInfo out, JsonbContainer *in,

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