/* Write a Node field */
#define WRITE_NODE_FIELD(fldname) \
(appendStringInfo(str, " :" CppAsString(fldname) " "), \
- _outNode(str, node->fldname))
+ outNode(str, node->fldname))
/* Write a bitmapset field */
#define WRITE_BITMAPSET_FIELD(fldname) \
#define booltostr(x) ((x) ? "true" : "false")
-static void _outNode(StringInfo str, const void *obj);
-
/*
* _outToken
*/
if (IsA(node, List))
{
- _outNode(str, lfirst(lc));
+ outNode(str, lfirst(lc));
if (lnext(lc))
appendStringInfoChar(str, ' ');
}
/*
* Print the value of a Datum given its type.
*/
-static void
-_outDatum(StringInfo str, Datum value, int typlen, bool typbyval)
+void
+outDatum(StringInfo str, Datum value, int typlen, bool typbyval)
{
Size length,
i;
if (node->constisnull)
appendStringInfoString(str, "<>");
else
- _outDatum(str, node->constvalue, node->constlen, node->constbyval);
+ outDatum(str, node->constvalue, node->constlen, node->constbyval);
}
static void
/*
- * _outNode -
+ * outNode -
* converts a Node into ascii string and append it to 'str'
*/
-static void
-_outNode(StringInfo str, const void *obj)
+void
+outNode(StringInfo str, const void *obj)
{
if (obj == NULL)
appendStringInfoString(str, "<>");
/*
* This should be an ERROR, but it's too useful to be able to
- * dump structures that _outNode only understands part of.
+ * dump structures that outNode only understands part of.
*/
elog(WARNING, "could not dump unrecognized node type: %d",
(int) nodeTag(obj));
/* see stringinfo.h for an explanation of this maneuver */
initStringInfo(&str);
- _outNode(&str, obj);
+ outNode(&str, obj);
return str.data;
}
((length) == 0 ? NULL : debackslash(token, length))
-static Datum readDatum(bool typbyval);
-static bool *readBoolCols(int numCols);
-static int *readIntCols(int numCols);
-static Oid *readOidCols(int numCols);
-static AttrNumber *readAttrNumberCols(int numCols);
-
/*
* _readBitmapset
*/
* Datum. The string representation embeds length info, but not byValue,
* so we must be told that.
*/
-static Datum
+Datum
readDatum(bool typbyval)
{
Size length,
/*
* readAttrNumberCols
*/
-static AttrNumber *
+AttrNumber *
readAttrNumberCols(int numCols)
{
int tokenLength,
/*
* readOidCols
*/
-static Oid *
+Oid *
readOidCols(int numCols)
{
int tokenLength,
/*
* readIntCols
*/
-static int *
+int *
readIntCols(int numCols)
{
int tokenLength,
/*
* readBoolCols
*/
-static bool *
+bool *
readBoolCols(int numCols)
{
int tokenLength,
struct Bitmapset; /* not to include bitmapset.h here */
struct StringInfoData; /* not to include stringinfo.h here */
+extern void outNode(struct StringInfoData *str, const void *obj);
extern void outToken(struct StringInfoData *str, const char *s);
extern void outBitmapset(struct StringInfoData *str,
const struct Bitmapset *bms);
+extern void outDatum(struct StringInfoData *str, uintptr_t value,
+ int typlen, bool typbyval);
/*
* nodes/{readfuncs.c,read.c}
*/
extern void *stringToNode(char *str);
extern struct Bitmapset *readBitmapset(void);
+extern uintptr_t readDatum(bool typbyval);
+extern bool *readBoolCols(int numCols);
+extern int *readIntCols(int numCols);
+extern Oid *readOidCols(int numCols);
+extern int16 *readAttrNumberCols(int numCols);
/*
* nodes/copyfuncs.c