postgresql/src/include/executor/tablefunc.h
Tom Lane e3860ffa4d Initial pgindent run with pg_bsd_indent version 2.0.
The new indent version includes numerous fixes thanks to Piotr Stefaniak.
The main changes visible in this commit are:

* Nicer formatting of function-pointer declarations.
* No longer unexpectedly removes spaces in expressions using casts,
  sizeof, or offsetof.
* No longer wants to add a space in "struct structname *varname", as
  well as some similar cases for const- or volatile-qualified pointers.
* Declarations using PG_USED_FOR_ASSERTS_ONLY are formatted more nicely.
* Fixes bug where comments following declarations were sometimes placed
  with no space separating them from the code.
* Fixes some odd decisions for comments following case labels.
* Fixes some cases where comments following code were indented to less
  than the expected column 33.

On the less good side, it now tends to put more whitespace around typedef
names that are not listed in typedefs.list.  This might encourage us to
put more effort into typedef name collection; it's not really a bug in
indent itself.

There are more changes coming after this round, having to do with comment
indentation and alignment of lines appearing within parentheses.  I wanted
to limit the size of the diffs to something that could be reviewed without
one's eyes completely glazing over, so it seemed better to split up the
changes as much as practical.

Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
2017-06-21 14:39:04 -04:00

67 lines
2.8 KiB
C

/*-------------------------------------------------------------------------
*
* tablefunc.h
* interface for TableFunc executor node
*
* Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/executor/tablefunc.h
*
*-------------------------------------------------------------------------
*/
#ifndef _TABLEFUNC_H
#define _TABLEFUNC_H
/* Forward-declare this to avoid including execnodes.h here */
struct TableFuncScanState;
/*
* TableFuncRoutine holds function pointers used for generating content of
* table-producer functions, such as XMLTABLE.
*
* InitBuilder initialize table builder private objects. The output tuple
* descriptor, input functions for the columns, and typioparams are passed
* from executor state.
*
* SetDoc is called to define the input document. The table builder may
* apply additional transformations not exposed outside the table builder
* context.
*
* SetNamespace is called to pass namespace declarations from the table
* expression. This function may be NULL if namespaces are not supported by
* the table builder. Namespaces must be given before setting the row and
* column filters. If the name is given as NULL, the entry shall be for the
* default namespace.
*
* SetRowFilter is called do define the row-generating filter, which shall be
* used to extract each row from the input document.
*
* SetColumnFilter is called once for each column, to define the column-
* generating filter for the given column.
*
* FetchRow shall be called repeatedly until it returns that no more rows are
* found in the document. On each invocation it shall set state in the table
* builder context such that each subsequent GetValue call returns the values
* for the indicated column for the row being processed.
*
* DestroyBuilder shall release all resources associated with a table builder
* context. It may be called either because all rows have been consumed, or
* because an error ocurred while processing the table expression.
*/
typedef struct TableFuncRoutine
{
void (*InitOpaque) (struct TableFuncScanState *state, int natts);
void (*SetDocument) (struct TableFuncScanState *state, Datum value);
void (*SetNamespace) (struct TableFuncScanState *state, char *name,
char *uri);
void (*SetRowFilter) (struct TableFuncScanState *state, char *path);
void (*SetColumnFilter) (struct TableFuncScanState *state,
char *path, int colnum);
bool (*FetchRow) (struct TableFuncScanState *state);
Datum (*GetValue) (struct TableFuncScanState *state, int colnum,
Oid typid, int32 typmod, bool *isnull);
void (*DestroyOpaque) (struct TableFuncScanState *state);
} TableFuncRoutine;
#endif /* _TABLEFUNC_H */