Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc1ddd23

Browse files
committed
Expose more out/readfuncs support functions.
Previouslybcac23d exposed a subset of support functions, namely theones Kaigai found useful. In20160304193704.elq773pyg5fyl3mi@alap3.anarazel.de I mentioned thatthere's some functions missing to use the facility in an externalproject.To avoid having to add functions piecemeal, add all the functions whichare used to define READ_* and WRITE_* macros; users of the extensiblenode functionality are likely to need these. Additionally exposeoutDatum(), which doesn't have it's own WRITE_ macro, as it needsinformation from the embedding struct.Discussion: 20160304193704.elq773pyg5fyl3mi@alap3.anarazel.de
1 parent7a54270 commitc1ddd23

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

‎src/backend/nodes/outfuncs.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
/* Write a Node field */
9090
#defineWRITE_NODE_FIELD(fldname) \
9191
(appendStringInfo(str, " :" CppAsString(fldname) " "), \
92-
_outNode(str, node->fldname))
92+
outNode(str, node->fldname))
9393

9494
/* Write a bitmapset field */
9595
#defineWRITE_BITMAPSET_FIELD(fldname) \
@@ -99,8 +99,6 @@
9999

100100
#definebooltostr(x) ((x) ? "true" : "false")
101101

102-
staticvoid_outNode(StringInfostr,constvoid*obj);
103-
104102

105103
/*
106104
* _outToken
@@ -169,7 +167,7 @@ _outList(StringInfo str, const List *node)
169167
*/
170168
if (IsA(node,List))
171169
{
172-
_outNode(str,lfirst(lc));
170+
outNode(str,lfirst(lc));
173171
if (lnext(lc))
174172
appendStringInfoChar(str,' ');
175173
}
@@ -214,8 +212,8 @@ outBitmapset(StringInfo str, const Bitmapset *bms)
214212
/*
215213
* Print the value of a Datum given its type.
216214
*/
217-
staticvoid
218-
_outDatum(StringInfostr,Datumvalue,inttyplen,booltypbyval)
215+
void
216+
outDatum(StringInfostr,Datumvalue,inttyplen,booltypbyval)
219217
{
220218
Sizelength,
221219
i;
@@ -1009,7 +1007,7 @@ _outConst(StringInfo str, const Const *node)
10091007
if (node->constisnull)
10101008
appendStringInfoString(str,"<>");
10111009
else
1012-
_outDatum(str,node->constvalue,node->constlen,node->constbyval);
1010+
outDatum(str,node->constvalue,node->constlen,node->constbyval);
10131011
}
10141012

10151013
staticvoid
@@ -3219,11 +3217,11 @@ _outConstraint(StringInfo str, const Constraint *node)
32193217

32203218

32213219
/*
3222-
*_outNode -
3220+
*outNode -
32233221
* converts a Node into ascii string and append it to 'str'
32243222
*/
3225-
staticvoid
3226-
_outNode(StringInfostr,constvoid*obj)
3223+
void
3224+
outNode(StringInfostr,constvoid*obj)
32273225
{
32283226
if (obj==NULL)
32293227
appendStringInfoString(str,"<>");
@@ -3801,7 +3799,7 @@ _outNode(StringInfo str, const void *obj)
38013799

38023800
/*
38033801
* This should be an ERROR, but it's too useful to be able to
3804-
* dump structures that_outNode only understands part of.
3802+
* dump structures thatoutNode only understands part of.
38053803
*/
38063804
elog(WARNING,"could not dump unrecognized node type: %d",
38073805
(int)nodeTag(obj));
@@ -3822,6 +3820,6 @@ nodeToString(const void *obj)
38223820

38233821
/* see stringinfo.h for an explanation of this maneuver */
38243822
initStringInfo(&str);
3825-
_outNode(&str,obj);
3823+
outNode(&str,obj);
38263824
returnstr.data;
38273825
}

‎src/backend/nodes/readfuncs.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,6 @@
172172
((length) == 0 ? NULL : debackslash(token, length))
173173

174174

175-
staticDatumreadDatum(booltypbyval);
176-
staticbool*readBoolCols(intnumCols);
177-
staticint*readIntCols(intnumCols);
178-
staticOid*readOidCols(intnumCols);
179-
staticAttrNumber*readAttrNumberCols(intnumCols);
180-
181175
/*
182176
* _readBitmapset
183177
*/
@@ -2499,7 +2493,7 @@ parseNodeString(void)
24992493
* Datum. The string representation embeds length info, but not byValue,
25002494
* so we must be told that.
25012495
*/
2502-
staticDatum
2496+
Datum
25032497
readDatum(booltypbyval)
25042498
{
25052499
Sizelength,
@@ -2556,7 +2550,7 @@ readDatum(bool typbyval)
25562550
/*
25572551
* readAttrNumberCols
25582552
*/
2559-
staticAttrNumber*
2553+
AttrNumber*
25602554
readAttrNumberCols(intnumCols)
25612555
{
25622556
inttokenLength,
@@ -2580,7 +2574,7 @@ readAttrNumberCols(int numCols)
25802574
/*
25812575
* readOidCols
25822576
*/
2583-
staticOid*
2577+
Oid*
25842578
readOidCols(intnumCols)
25852579
{
25862580
inttokenLength,
@@ -2604,7 +2598,7 @@ readOidCols(int numCols)
26042598
/*
26052599
* readIntCols
26062600
*/
2607-
staticint*
2601+
int*
26082602
readIntCols(intnumCols)
26092603
{
26102604
inttokenLength,
@@ -2628,7 +2622,7 @@ readIntCols(int numCols)
26282622
/*
26292623
* readBoolCols
26302624
*/
2631-
staticbool*
2625+
bool*
26322626
readBoolCols(intnumCols)
26332627
{
26342628
inttokenLength,

‎src/include/nodes/nodes.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,15 +553,23 @@ extern char *nodeToString(const void *obj);
553553

554554
structBitmapset;/* not to include bitmapset.h here */
555555
structStringInfoData;/* not to include stringinfo.h here */
556+
externvoidoutNode(structStringInfoData*str,constvoid*obj);
556557
externvoidoutToken(structStringInfoData*str,constchar*s);
557558
externvoidoutBitmapset(structStringInfoData*str,
558559
conststructBitmapset*bms);
560+
externvoidoutDatum(structStringInfoData*str,uintptr_tvalue,
561+
inttyplen,booltypbyval);
559562

560563
/*
561564
* nodes/{readfuncs.c,read.c}
562565
*/
563566
externvoid*stringToNode(char*str);
564567
externstructBitmapset*readBitmapset(void);
568+
externuintptr_treadDatum(booltypbyval);
569+
externbool*readBoolCols(intnumCols);
570+
externint*readIntCols(intnumCols);
571+
externOid*readOidCols(intnumCols);
572+
externint16*readAttrNumberCols(intnumCols);
565573

566574
/*
567575
* nodes/copyfuncs.c

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp