diff options
Diffstat (limited to 'src/include/utils/portal.h')
-rw-r--r-- | src/include/utils/portal.h | 85 |
1 files changed, 44 insertions, 41 deletions
diff --git a/src/include/utils/portal.h b/src/include/utils/portal.h index 49f907c3f0b..07edce974ef 100644 --- a/src/include/utils/portal.h +++ b/src/include/utils/portal.h @@ -1,28 +1,28 @@ /*------------------------------------------------------------------------- * * portal.h-- - * POSTGRES portal definitions. + * POSTGRES portal definitions. * * * Copyright (c) 1994, Regents of the University of California * - * $Id: portal.h,v 1.4 1997/08/19 21:40:48 momjian Exp $ + * $Id: portal.h,v 1.5 1997/09/07 05:02:51 momjian Exp $ * *------------------------------------------------------------------------- */ /* * Note: - * A portal is an abstraction which represents the execution state of + * A portal is an abstraction which represents the execution state of * a running query (or a fixed sequence of queries). The "blank portal" is * a portal with an InvalidName. This blank portal is in existance except * between calls to BlankPortalAssignName and GetPortalByName(NULL). * * Note: - * now that PQ calls can be made from within a backend, a portal - * may also be used to keep track of the tuples resulting - * from the execution of a query. In this case, entryIndex + * now that PQ calls can be made from within a backend, a portal + * may also be used to keep track of the tuples resulting + * from the execution of a query. In this case, entryIndex */ -#ifndef PORTAL_H +#ifndef PORTAL_H #define PORTAL_H #include <executor/execdesc.h> @@ -30,58 +30,61 @@ #include <nodes/memnodes.h> #include <utils/memutils.h> -typedef struct PortalBlockData { - AllocSetData setData; - FixedItemData itemData; -} PortalBlockData; +typedef struct PortalBlockData +{ + AllocSetData setData; + FixedItemData itemData; +} PortalBlockData; -typedef PortalBlockData *PortalBlock; +typedef PortalBlockData *PortalBlock; -typedef struct PortalD PortalD; -typedef PortalD *Portal; +typedef struct PortalD PortalD; +typedef PortalD *Portal; -struct PortalD { - char *name; /* XXX PortalName */ - struct PortalVariableMemory variable; - struct PortalHeapMemory heap; - QueryDesc *queryDesc; - TupleDesc attinfo; - EState *state; - void (*cleanup)(Portal); +struct PortalD +{ + char *name; /* XXX PortalName */ + struct PortalVariableMemory variable; + struct PortalHeapMemory heap; + QueryDesc *queryDesc; + TupleDesc attinfo; + EState *state; + void (*cleanup) (Portal); }; /* * PortalIsValid -- - * True iff portal is valid. + * True iff portal is valid. */ -#define PortalIsValid(p) PointerIsValid(p) +#define PortalIsValid(p) PointerIsValid(p) /* * Special portals (well, their names anyway) */ -#define VACPNAME "<vacuum>" +#define VACPNAME "<vacuum>" -extern bool PortalNameIsSpecial(char *pname); -extern void AtEOXact_portals(void); -extern void EnablePortalManager(bool on); -extern Portal GetPortalByName(char *name); -extern Portal BlankPortalAssignName(char *name); -extern void PortalSetQuery(Portal portal, QueryDesc *queryDesc, - TupleDesc attinfo, EState *state, - void (*cleanup)(Portal portal)); +extern bool PortalNameIsSpecial(char *pname); +extern void AtEOXact_portals(void); +extern void EnablePortalManager(bool on); +extern Portal GetPortalByName(char *name); +extern Portal BlankPortalAssignName(char *name); +extern void +PortalSetQuery(Portal portal, QueryDesc * queryDesc, + TupleDesc attinfo, EState * state, + void (*cleanup) (Portal portal)); extern QueryDesc *PortalGetQueryDesc(Portal portal); -extern EState *PortalGetState(Portal portal); -extern Portal CreatePortal(char *name); -extern void PortalDestroy(Portal *portalP); -extern void StartPortalAllocMode(AllocMode mode, Size limit); -extern void EndPortalAllocMode(void); +extern EState *PortalGetState(Portal portal); +extern Portal CreatePortal(char *name); +extern void PortalDestroy(Portal * portalP); +extern void StartPortalAllocMode(AllocMode mode, Size limit); +extern void EndPortalAllocMode(void); extern PortalVariableMemory PortalGetVariableMemory(Portal portal); extern PortalHeapMemory PortalGetHeapMemory(Portal portal); /* estimate of the maximum number of open portals a user would have, - * used in initially sizing the PortalHashTable in EnablePortalManager() + * used in initially sizing the PortalHashTable in EnablePortalManager() */ -#define PORTALS_PER_USER 10 +#define PORTALS_PER_USER 10 -#endif /* PORTAL_H */ +#endif /* PORTAL_H */ |