mirror of
https://github.com/postgres/postgres.git
synced 2025-10-18 04:29:09 +03:00
There are a number of forward declarations that use struct but not the customary typedef, because that could have led to repeat typedefs, which was not allowed. This is now allowed in C11, so we can update these to provide the typedefs as well, so that the later uses of the types look more consistent. Reviewed-by: Chao Li <li.evan.chao@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/10d32190-f31b-40a5-b177-11db55597355@eisentraut.org
68 lines
2.8 KiB
C
68 lines
2.8 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* tablefunc.h
|
|
* interface for TableFunc executor node
|
|
*
|
|
* Portions Copyright (c) 1996-2025, 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 */
|
|
typedef struct TableFuncScanState TableFuncScanState;
|
|
|
|
/*
|
|
* TableFuncRoutine holds function pointers used for generating content of
|
|
* table-producer functions, such as XMLTABLE.
|
|
*
|
|
* InitOpaque initializes table builder private objects. The output tuple
|
|
* descriptor, input functions for the columns, and typioparams are passed
|
|
* from executor state.
|
|
*
|
|
* SetDocument 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.
|
|
*
|
|
* DestroyOpaque 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 occurred while processing the table expression.
|
|
*/
|
|
typedef struct TableFuncRoutine
|
|
{
|
|
void (*InitOpaque) (TableFuncScanState *state, int natts);
|
|
void (*SetDocument) (TableFuncScanState *state, Datum value);
|
|
void (*SetNamespace) (TableFuncScanState *state, const char *name,
|
|
const char *uri);
|
|
void (*SetRowFilter) (TableFuncScanState *state, const char *path);
|
|
void (*SetColumnFilter) (TableFuncScanState *state,
|
|
const char *path, int colnum);
|
|
bool (*FetchRow) (TableFuncScanState *state);
|
|
Datum (*GetValue) (TableFuncScanState *state, int colnum,
|
|
Oid typid, int32 typmod, bool *isnull);
|
|
void (*DestroyOpaque) (TableFuncScanState *state);
|
|
} TableFuncRoutine;
|
|
|
|
#endif /* _TABLEFUNC_H */
|