head 1.14; access; symbols Version_2_1:1.11 Version_2:1.9 C_Demo_1:1.7 Retrieve_x_1:1.2; locks; strict; comment @ * @; 1.14 date 92.08.18.18.27.16; author mer; state Exp; branches; next 1.13; 1.13 date 91.11.06.01.36.24; author mer; state Exp; branches; next 1.12; 1.12 date 91.04.28.09.15.13; author cimarron; state Exp; branches; next 1.11; 1.11 date 91.02.23.23.38.02; author cimarron; state Exp; branches; next 1.10; 1.10 date 90.08.17.08.54.52; author cimarron; state Exp; branches; next 1.9; 1.9 date 89.09.25.16.38.00; author hirohama; state Version_2; branches; next 1.8; 1.8 date 89.09.05.22.54.30; author hirohama; state Exp; branches; next 1.7; 1.7 date 89.09.05.17.10.30; author mao; state C_Demo_1; branches; next 1.6; 1.6 date 89.09.01.12.08.44; author hirohama; state Exp; branches; next 1.5; 1.5 date 89.08.30.12.39.15; author hirohama; state Exp; branches; next 1.4; 1.4 date 89.08.25.15.47.34; author hirohama; state Exp; branches; next 1.2; 1.2 date 89.08.01.16.19.51; author goh; state Exp; branches; next 1.1; 1.1 date 89.05.07.16.42.04; author hirohama; state Exp; branches; next ; desc @@ 1.14 log @move VACPNAME to portal.h @ text @/* * portal.h -- * POSTGRES portal definitions. * * Note: * 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 */ #ifndef PortalIncluded /* Include this file only once */ #define PortalIncluded 1 /* * Identification: */ #define PORTAL_H "$Header: /private/mer/pg/src/lib/H/tmp/RCS/portal.h,v 1.13 1991/11/06 01:36:24 mer Exp mer $" #include "tmp/c.h" #include "nodes/execnodes.h" /* for EState */ #include "nodes/mnodes.h" #include "nodes/nodes.h" #include "nodes/pg_lisp.h" #include "nodes/plannodes.h" /* for Plan */ typedef struct PortalBlockData { AllocSetData setData; FixedItemData itemData; } PortalBlockData; typedef PortalBlockData *PortalBlock; typedef struct PortalD PortalD; typedef PortalD *Portal; struct PortalD { String name; /* XXX PortalName */ classObj(PortalVariableMemory) variable; classObj(PortalHeapMemory) heap; List queryDesc; EState state; void (*cleanup)(); }; /* * PortalIsValid -- * True iff portal is valid. */ #define PortalIsValid(p) PointerIsValid(p) /* * Special portals (well, their names anyway) */ #define VACPNAME "" /* * EnablePortalManager -- * Enables/disables the portal management module. */ extern void EnablePortalManager ARGS(( bool on )); /* * GetPortalByName -- * Returns a portal given a portal name; returns blank portal given * NULL; returns invalid portal if portal not found. * * Exceptions: * BadState if called when disabled. */ extern Portal GetPortalByName ARGS(( String name /* XXX PortalName */ )); /* * BlankPortalAssignName -- * Returns former blank portal as portal with given name. * * Side effect: * All references to the former blank portal become incorrect. * * Exceptions: * BadState if called when disabled. * BadState if called without an intervening call to GetPortalByName(NULL). * BadArg if portal name is invalid. * "WARN" if portal name is in use. */ extern Portal BlankPortalAssignName ARGS(( String name /* XXX PortalName */ )); /* * PortalSetQuery -- * Attaches a "query" to portal. * * Exceptions: * BadState if called when disabled. * BadArg if portal is invalid. * BadArg if queryDesc is "invalid." * BadArg if state is "invalid." */ extern void PortalSetQuery ARGS(( Portal portal, List queryDesc, EState state, void (*cleanup) ARGS((Portal portal)) )); /* * PortalGetQueryDesc -- * Returns query attached to portal. * * Exceptions: * BadState if called when disabled. * BadArg if portal is invalid. */ extern List /* QueryDesc */ PortalGetQueryDesc ARGS(( Portal portal )); /* * PortalGetState -- * Returns state attached to portal. * * Exceptions: * BadState if called when disabled. * BadArg if portal is invalid. */ extern EState PortalGetState ARGS(( Portal portal )); /* * CreatePortal -- * Returns a new portal given a name. * * Note: * This is expected to be of very limited usability. See instead, * BlankPortalAssignName. * * Exceptions: * BadState if called when disabled. * BadArg if portal name is invalid. * "WARN" if portal name is in use. */ extern Portal CreatePortal ARGS(( String name /* XXX PortalName */ )); /* * PortalDestroy -- * Destroys portal. * * Exceptions: * BadState if called when disabled. * BadArg if portal is invalid. */ extern void PortalDestroy ARGS(( Portal portal )); /* * PortalResetHeapMemory -- * Resets portal's heap memory context. * * Exceptions: * BadState if called when disabled. * BadState if called when not in PortalHeapMemory context. * BadArg if mode is invalid. */ extern void PortalResetHeapMemory ARGS(( Portal portal )); /* * StartPortalAllocMode -- * Starts a new block of portal heap allocation using mode and limit; * the current block is disabled until EndPortalAllocMode is called. * * Note: * Note blocks may be stacked and restored arbitarily. * The semantics of mode and limit are described in aset.h. * * Exceptions: * BadState if called when disabled. * BadState if called when not in PortalHeapMemory context. * BadArg if mode is invalid. */ extern void StartPortalAllocMode ARGS(( AllocMode mode, Size limit )); /* * EndPortalAllocMode -- * Ends current block of portal heap allocation; previous block is * reenabled. * * Note: * Note blocks may be stacked and restored arbitarily. * * Exceptions: * BadState if called when disabled. * BadState if called when not in PortalHeapMemory context. */ extern void EndPortalAllocMode ARGS(( void )); /* * PortalGetVariableMemory -- * Returns variable memory context for a given portal. * * Exceptions: * BadState if called when disabled. * BadArg if portal is invalid. */ extern PortalVariableMemory PortalGetVariableMemory ARGS(( Portal portal )); /* * PortalGetHeapMemory -- * Returns heap memory context for a given portal. * * Exceptions: * BadState if called when disabled. * BadArg if portal is invalid. */ extern PortalHeapMemory PortalGetHeapMemory ARGS(( Portal portal )); /* * PortalVariableMemoryGetPortal -- * Returns portal containing given variable memory context. * * Exceptions: * BadState if called when disabled. * BadArg if context is invalid. */ extern Portal PortalVariableMemoryGetPortal ARGS(( PortalVariableMemory context )); /* * PortalHeapMemoryGetPortal -- * Returns portal containing given heap memory context. * * Exceptions: * BadState if called when disabled. * BadArg if context is invalid. */ extern Portal PortalHeapMemoryGetPortal ARGS(( PortalHeapMemory context )); /* * PortalVariableMemoryGetHeapMemory -- * Returns heap memory context associated with given variable memory. * * Exceptions: * BadState if called when disabled. * BadArg if context is invalid. */ extern PortalHeapMemory PortalVariableMemoryGetHeapMemory ARGS(( PortalVariableMemory context )); /* * PortalHeapMemoryGetVariableMemory -- * Returns variable memory context associated with given heap memory. * * Exceptions: * BadState if called when disabled. * BadArg if context is invalid. */ extern PortalVariableMemory PortalHeapMemoryGetVariableMemory ARGS(( PortalHeapMemory context )); #endif /* !defined(PortalIncluded) */ @ 1.13 log @fix syntax error with prototype @ text @d23 1 a23 1 #define PORTAL_H "$Header: /users/mer/postgres/src/lib/H/tmp/RCS/portal.h,v 1.12 1991/04/28 09:15:13 cimarron Exp mer $" d57 5 @ 1.12 log @Converted IsValid code into macros and added an improved NodeIsType scheme @ text @d23 1 a23 1 #define PORTAL_H "$Header: RCS/portal.h,v 1.11 91/02/23 23:38:02 cimarron Exp Locker: cimarron $" d49 1 a49 1 void (*cleanup) ARGS((Portal portal)); @ 1.11 log @PQexec() now works correctly in the backend @ text @d23 1 a23 1 #define PORTAL_H "$Header: RCS/portal.h,v 1.10 90/08/17 08:54:52 cimarron Exp Locker: cimarron $" d53 6 a65 10 )); /* * PortalIsValid -- * True iff portal is valid. */ extern bool PortalIsValid ARGS(( Portal portal @ 1.10 log @added pathnames to #include statements @ text @d10 5 d23 1 a23 1 #define PORTAL_H "$Header: RCS/portal.h,v 1.9 89/09/25 16:38:00 hirohama Version_2 Locker: cimarron $" a54 6 * * Note: * ... * * Exceptions: * ... @ 1.9 log @PortalGetQueryDesc <- PortalGetParse, PortalGetPlan @ text @d18 1 a18 1 #define PORTAL_H "$Header: RCS/portal.h,v 1.8 89/09/05 22:54:30 hirohama Exp Locker: hirohama $" d20 1 a20 3 #ifndef C_H #include "c.h" #endif d22 5 a26 5 #include "execnodes.h" /* for EState */ #include "mnodes.h" #include "nodes.h" #include "pg_lisp.h" #include "plannodes.h" /* for Plan */ @ 1.8 log @same as -r1.6 @ text @a9 3 * * Identification: * $Header: RCS/portal.h,v 1.6 89/09/01 12:08:44 hirohama Exp $ d15 5 d27 1 d44 1 a44 2 LispValue parse; Plan plan; d115 1 a115 2 * BadArg if parse is "invalid." * BadArg if plan is "invalid." d122 1 a122 2 List parse, Plan plan, d128 2 a129 2 * PortalGetParse -- * Returns parse attached to portal. d136 3 a138 17 LispValue /* Parse */ PortalGetParse ARGS(( Portal portal )); /* * PortalGetPlan -- * Returns plan attached to portal. * * Exceptions: * BadState if called when disabled. * BadArg if portal is invalid. */ extern Plan PortalGetPlan ARGS(( Portal portal @ 1.7 log @Working version of C-only demo @ text @d12 1 a12 1 * $Header: RCS/portal.h,v 1.5 89/08/30 12:39:15 hirohama Exp $ d34 4 a37 1 typedef struct PortalData { d44 2 a45 1 } PortalData; a46 2 typedef PortalData *Portal; d120 5 a124 4 Portal portal, LispValue parse, Plan plan, EState state @ 1.6 log @added cleanup callback to Portal PortalSetQuery now takes cleanup argument @ text @d12 1 a12 1 * $Header: RCS/portal.h,v 1.5 89/08/30 12:39:15 hirohama Exp Locker: hirohama $ d34 1 a34 4 typedef struct PortalD PortalD; typedef PortalD *Portal; struct PortalD { d41 1 a41 2 void (*cleanup) ARGS((Portal portal)); }; d43 2 d118 4 a121 5 Portal portal, List parse, Plan plan, EState state, void (*cleanup) ARGS((Portal portal)) @ 1.5 log @added PortalSetQuery, PortalGet{Parse,Plan,State} @ text @d12 1 a12 1 * $Header: RCS/portal.h,v 1.4 89/08/25 15:47:34 hirohama Exp Locker: hirohama $ d34 4 a37 1 typedef struct PortalData { d44 2 a45 1 } PortalData; a46 2 typedef PortalData *Portal; d120 5 a124 4 Portal portal, LispValue parse, Plan plan, EState state @ 1.4 log @extended the portal abstraction to support FETCH, CLOSE, etc. utilities @ text @d12 1 a12 1 * $Header: RCS/portal.h,v 1.3 89/08/25 15:05:25 hirohama Exp Locker: hirohama $ d22 1 d25 1 d38 3 a40 1 /* ... */ d102 62 @ 1.2 log @retrieve (x=1) checkin @ text @d5 6 d12 1 a12 1 * $Header: portal.h,v 1.1 89/05/07 16:42:04 hirohama Exp $ d15 2 a16 2 #ifndef PortalIncluded #define PortalIncluded 1 /* Include this file only once */ d18 1 d20 1 d69 2 a70 1 * Returns a portal given a portal name. a73 1 * BadArg if portal name is invalid. d82 19 d104 4 d111 1 d121 1 a121 1 * Returns a new portal given a name. @ 1.1 log @Initial revision @ text @d6 1 a6 1 * $Header: portal.h,v 1.3 89/05/07 12:08:51 hirohama Locked $ d15 1 a15 1 #include "tnodes.h" @