TimeADT *
-time_difference(TimeADT * time1, TimeADT * time2)
+time_difference(TimeADT *time1, TimeADT *time2)
{
TimeADT *result = (TimeADT *) palloc(sizeof(TimeADT));
}
int4
-hours(TimeADT * time)
+hours(TimeADT *time)
{
return (*time / (60 * 60));
}
int4
-minutes(TimeADT * time)
+minutes(TimeADT *time)
{
return (((int) (*time / 60)) % 60);
}
int4
-seconds(TimeADT * time)
+seconds(TimeADT *time)
{
return (((int) *time) % 60);
}
int4
-day(DateADT * date)
+day(DateADT *date)
{
struct tm tm;
}
int4
-month(DateADT * date)
+month(DateADT *date)
{
struct tm tm;
}
int4
-year(DateADT * date)
+year(DateADT *date)
{
struct tm tm;
}
int4
-asminutes(TimeADT * time)
+asminutes(TimeADT *time)
{
int seconds = (int) *time;
}
int4
-asseconds(TimeADT * time)
+asseconds(TimeADT *time)
{
int seconds = (int) *time;
int32 int84(int64 * val);
#if FALSE
-int64 *int28(int16 val);
+int64 *int28 (int16 val);
int16 int82(int64 * val);
#endif
#if FALSE
int64 *
-int28(int16 val)
+int28 (int16 val)
{
int64 *result;
fflush(stderr);
/* call one clean up function if defined */
- if ((sig_func = signal(SIGTERM, SIG_DFL)) != SIG_DFL &&
- sig_func != SIG_IGN)
+ if ((sig_func = signal(SIGTERM, SIG_DFL)) !=SIG_DFL &&
+ sig_func !=SIG_IGN)
(*sig_func) (0);
- else if ((sig_func = signal(SIGHUP, SIG_DFL)) != SIG_DFL &&
- sig_func != SIG_IGN)
+ else if ((sig_func = signal(SIGHUP, SIG_DFL)) !=SIG_DFL &&
+ sig_func !=SIG_IGN)
(*sig_func) (0);
- else if ((sig_func = signal(SIGINT, SIG_DFL)) != SIG_DFL &&
- sig_func != SIG_IGN)
+ else if ((sig_func = signal(SIGINT, SIG_DFL)) !=SIG_DFL &&
+ sig_func !=SIG_IGN)
(*sig_func) (0);
- else if ((sig_func = signal(SIGQUIT, SIG_DFL)) != SIG_DFL &&
- sig_func != SIG_IGN)
+ else if ((sig_func = signal(SIGQUIT, SIG_DFL)) !=SIG_DFL &&
+ sig_func !=SIG_IGN)
(*sig_func) (0);
exit(1);
}
char *soundex(char *instr, char *outstr);
text *
-text_soundex(text * t)
+text_soundex(text *t)
{
/* ABCDEFGHIJKLMNOPQRSTUVWXYZ */
char *table = "01230120022455012623010202";
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.23 1997/09/08 02:19:47 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.24 1997/09/08 21:40:18 momjian Exp $
*
* NOTES
* The old interface functions have been converted to macros
Datum value[],
char nulls[],
char *infomask,
- bits8 * bit)
+ bits8 *bit)
{
bits8 *bitP = 0;
int bitmask = 0;
fastgetattr(HeapTuple tup,
int attnum,
TupleDesc tupleDesc,
- bool * isnull)
+ bool *isnull)
{
char *tp; /* ptr to att in tuple */
bits8 *bp = NULL; /* ptr to att in tuple */
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.17 1997/09/08 02:19:54 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.18 1997/09/08 21:40:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
static Size IndexInfoFindDataOffset(unsigned short t_info);
static char *
fastgetiattr(IndexTuple tup, int attnum,
- TupleDesc att, bool * isnull);
+ TupleDesc att, bool *isnull);
/* ----------------------------------------------------------------
* index_ tuple interface routines
fastgetiattr(IndexTuple tup,
int attnum,
TupleDesc tupleDesc,
- bool * isnull)
+ bool *isnull)
{
register char *tp; /* ptr to att in tuple */
register char *bp = NULL; /* ptr to att in tuple */
off = SHORTALIGN(off) +sizeof(short);
break;
case sizeof(int32):
- off = INTALIGN(off) + sizeof(int32);
+ off = INTALIGN(off) +sizeof(int32);
break;
case -1:
usecache = false;
index_getattr(IndexTuple tuple,
AttrNumber attNum,
TupleDesc tupDesc,
- bool * isNullOutP)
+ bool *isNullOutP)
{
Assert(attNum > 0);
* we assume we have space that is already palloc'ed.
*/
void
-CopyIndexTuple(IndexTuple source, IndexTuple * target)
+CopyIndexTuple(IndexTuple source, IndexTuple *target)
{
Size size;
IndexTuple ret;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.22 1997/09/08 20:53:40 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.23 1997/09/08 21:40:27 momjian Exp $
*
* NOTES
* some of the executor utility code such as "ExecTypeFromTL" should be
* ----------------------------------------------------------------
*/
TupleDesc
-BuildDescForRelation(List * schema, char *relname)
+BuildDescForRelation(List *schema, char *relname)
{
int natts;
AttrNumber attnum;
/* non-export function prototypes */
static InsertIndexResult
gistdoinsert(Relation r, IndexTuple itup,
- GISTSTATE * GISTstate);
+ GISTSTATE *GISTstate);
static InsertIndexResult
-gistentryinsert(Relation r, GISTSTACK * stk,
+gistentryinsert(Relation r, GISTSTACK *stk,
IndexTuple tup,
- GISTSTATE * giststate);
+ GISTSTATE *giststate);
static void
-gistentryinserttwo(Relation r, GISTSTACK * stk, IndexTuple ltup,
- IndexTuple rtup, GISTSTATE * giststate);
+gistentryinserttwo(Relation r, GISTSTACK *stk, IndexTuple ltup,
+ IndexTuple rtup, GISTSTATE *giststate);
static void
-gistAdjustKeys(Relation r, GISTSTACK * stk, BlockNumber blk,
- char *datum, int att_size, GISTSTATE * giststate);
+gistAdjustKeys(Relation r, GISTSTACK *stk, BlockNumber blk,
+ char *datum, int att_size, GISTSTATE *giststate);
static void
-gistintinsert(Relation r, GISTSTACK * stk, IndexTuple ltup,
- IndexTuple rtup, GISTSTATE * giststate);
+gistintinsert(Relation r, GISTSTACK *stk, IndexTuple ltup,
+ IndexTuple rtup, GISTSTATE *giststate);
static InsertIndexResult
gistSplit(Relation r, Buffer buffer,
- GISTSTACK * stack, IndexTuple itup,
- GISTSTATE * giststate);
+ GISTSTACK *stack, IndexTuple itup,
+ GISTSTATE *giststate);
static void
-gistnewroot(GISTSTATE * giststate, Relation r, IndexTuple lt,
+gistnewroot(GISTSTATE *giststate, Relation r, IndexTuple lt,
IndexTuple rt);
static void GISTInitBuffer(Buffer b, uint32 f);
static BlockNumber
gistChooseSubtree(Relation r, IndexTuple itup, int level,
- GISTSTATE * giststate,
- GISTSTACK ** retstack, Buffer *leafbuf);
+ GISTSTATE *giststate,
+ GISTSTACK **retstack, Buffer *leafbuf);
static OffsetNumber
gistchoose(Relation r, Page p, IndexTuple it,
- GISTSTATE * giststate);
+ GISTSTATE *giststate);
static int gistnospace(Page p, IndexTuple it);
void gistdelete(Relation r, ItemPointer tid);
static IndexTuple gist_tuple_replacekey(Relation r, GISTENTRY entry, IndexTuple t);
static void
-gistcentryinit(GISTSTATE * giststate, GISTENTRY * e, char *pr,
+gistcentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr,
Relation r, Page pg, OffsetNumber o, int b, bool l);
-static char *int_range_out(INTRANGE * r);
+static char *int_range_out(INTRANGE *r);
/*
** routine to build an index. Basically calls insert over and over
AttrNumber *attnum,
IndexStrategy istrat,
uint16 pint,
- Datum * params,
- FuncIndexInfo * finfo,
- PredInfo * predInfo)
+ Datum *params,
+ FuncIndexInfo *finfo,
+ PredInfo *predInfo)
{
HeapScanDesc scan;
Buffer buffer;
* It doesn't do any work; just locks the relation and passes the buck.
*/
InsertIndexResult
-gistinsert(Relation r, Datum * datum, char *nulls, ItemPointer ht_ctid, Relation heapRel)
+gistinsert(Relation r, Datum *datum, char *nulls, ItemPointer ht_ctid, Relation heapRel)
{
InsertIndexResult res;
IndexTuple itup;
** on the page, for example, or do something special for leaf nodes.)
*/
static OffsetNumber
-gistPageAddItem(GISTSTATE * giststate,
+gistPageAddItem(GISTSTATE *giststate,
Relation r,
Page page,
Item item,
Size size,
OffsetNumber offsetNumber,
ItemIdFlags flags,
- GISTENTRY * dentry,
- IndexTuple * newtup)
+ GISTENTRY *dentry,
+ IndexTuple *newtup)
{
GISTENTRY tmpcentry;
IndexTuple itup = (IndexTuple) item;
&& tmpcentry.pred != (((char *) itup) + sizeof(IndexTupleData)))
pfree(tmpcentry.pred);
- return (PageAddItem(page, (Item) * newtup, IndexTupleSize(*newtup),
+ return (PageAddItem(page, (Item) *newtup, IndexTupleSize(*newtup),
offsetNumber, flags));
}
static InsertIndexResult
gistdoinsert(Relation r,
IndexTuple itup, /* itup contains compressed entry */
- GISTSTATE * giststate)
+ GISTSTATE *giststate)
{
GISTENTRY tmpdentry;
InsertIndexResult res;
gistChooseSubtree(Relation r, IndexTuple itup, /* itup has compressed
* entry */
int level,
- GISTSTATE * giststate,
- GISTSTACK ** retstack /* out */ ,
+ GISTSTATE *giststate,
+ GISTSTACK **retstack /* out */ ,
Buffer *leafbuf /* out */ )
{
Buffer buffer;
static void
gistAdjustKeys(Relation r,
- GISTSTACK * stk,
+ GISTSTACK *stk,
BlockNumber blk,
char *datum, /* datum is uncompressed */
int att_size,
- GISTSTATE * giststate)
+ GISTSTATE *giststate)
{
char *oldud;
Page p;
/* delete old tuple */
ItemPointerSet(&oldtid, stk->gs_blk, stk->gs_child);
- gistdelete(r, (ItemPointer) & oldtid);
+ gistdelete(r, (ItemPointer) &oldtid);
/* generate and insert new tuple */
tupDesc = r->rd_att;
isnull = (char *) palloc(r->rd_rel->relnatts);
memset(isnull, ' ', r->rd_rel->relnatts);
newtup = (IndexTuple) index_formtuple(tupDesc,
- (Datum *) & centry.pred, isnull);
+ (Datum *) ¢ry.pred, isnull);
pfree(isnull);
/* set pointer in new tuple to point to current child */
ItemPointerSet(&oldtid, blk, 1);
static InsertIndexResult
gistSplit(Relation r,
Buffer buffer,
- GISTSTACK * stack,
+ GISTSTACK *stack,
IndexTuple itup, /* contains compressed entry */
- GISTSTATE * giststate)
+ GISTSTATE *giststate)
{
Page p;
Buffer leftbuf,
tupDesc = r->rd_att;
ltup = (IndexTuple) index_formtuple(tupDesc,
- (Datum *) & (v.spl_ldatum), isnull);
+ (Datum *) &(v.spl_ldatum), isnull);
rtup = (IndexTuple) index_formtuple(tupDesc,
- (Datum *) & (v.spl_rdatum), isnull);
+ (Datum *) &(v.spl_rdatum), isnull);
pfree(isnull);
/* set pointers to new child pages in the internal index tuples */
*/
static void
gistintinsert(Relation r,
- GISTSTACK * stk,
+ GISTSTACK *stk,
IndexTuple ltup, /* new version of entry for old page */
IndexTuple rtup, /* entry for new page */
- GISTSTATE * giststate)
+ GISTSTATE *giststate)
{
ItemPointerData ltid;
/* remove old left pointer, insert the 2 new entries */
ItemPointerSet(<id, stk->gs_blk, stk->gs_child);
- gistdelete(r, (ItemPointer) & ltid);
+ gistdelete(r, (ItemPointer) <id);
gistentryinserttwo(r, stk, ltup, rtup, giststate);
}
** Insert two entries onto one page, handling a split for either one!
*/
static void
-gistentryinserttwo(Relation r, GISTSTACK * stk, IndexTuple ltup,
- IndexTuple rtup, GISTSTATE * giststate)
+gistentryinserttwo(Relation r, GISTSTACK *stk, IndexTuple ltup,
+ IndexTuple rtup, GISTSTATE *giststate)
{
Buffer b;
Page p;
** Insert an entry onto a page
*/
static InsertIndexResult
-gistentryinsert(Relation r, GISTSTACK * stk, IndexTuple tup,
- GISTSTATE * giststate)
+gistentryinsert(Relation r, GISTSTACK *stk, IndexTuple tup,
+ GISTSTATE *giststate)
{
Buffer b;
Page p;
static void
-gistnewroot(GISTSTATE * giststate, Relation r, IndexTuple lt, IndexTuple rt)
+gistnewroot(GISTSTATE *giststate, Relation r, IndexTuple lt, IndexTuple rt)
{
Buffer b;
Page p;
*/
static OffsetNumber
gistchoose(Relation r, Page p, IndexTuple it, /* it has compressed entry */
- GISTSTATE * giststate)
+ GISTSTATE *giststate)
{
OffsetNumber maxoff;
OffsetNumber i;
}
void
-gistfreestack(GISTSTACK * s)
+gistfreestack(GISTSTACK *s)
{
GISTSTACK *p;
}
void
-initGISTstate(GISTSTATE * giststate, Relation index)
+initGISTstate(GISTSTATE *giststate, Relation index)
{
RegProcedure consistent_proc,
union_proc,
for (blank = 0; blank < r->rd_rel->relnatts; blank++)
isnull[blank] = ' ';
newtup = (IndexTuple) index_formtuple(tupDesc,
- (Datum *) & (entry.pred),
+ (Datum *) &(entry.pred),
isnull);
newtup->t_tid = t->t_tid;
pfree(isnull);
** initialize a GiST entry with a decompressed version of pred
*/
void
-gistdentryinit(GISTSTATE * giststate, GISTENTRY * e, char *pr, Relation r,
+gistdentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr, Relation r,
Page pg, OffsetNumber o, int b, bool l)
{
GISTENTRY *dep;
** initialize a GiST entry with a compressed version of pred
*/
static void
-gistcentryinit(GISTSTATE * giststate, GISTENTRY * e, char *pr, Relation r,
+gistcentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr, Relation r,
Page pg, OffsetNumber o, int b, bool l)
{
GISTENTRY *cep;
#ifdef NOT_USED
static char *
-text_range_out(TXTRANGE * r)
+text_range_out(TXTRANGE *r)
{
char *result;
char *lower,
#endif
static char *
-int_range_out(INTRANGE * r)
+int_range_out(INTRANGE *r)
{
char *result;
static ItemPointer gistheapptr(Relation r, ItemPointer itemp);
static bool
gistindex_keytest(IndexTuple tuple, TupleDesc tupdesc,
- int scanKeySize, ScanKey key, GISTSTATE * giststate,
+ int scanKeySize, ScanKey key, GISTSTATE *giststate,
Relation r, Page p, OffsetNumber offset);
TupleDesc tupdesc,
int scanKeySize,
ScanKey key,
- GISTSTATE * giststate,
+ GISTSTATE *giststate,
Relation r,
Page p,
OffsetNumber offset)
gistadjone(IndexScanDesc s, int op, BlockNumber blkno,
OffsetNumber offnum);
static void
-adjuststack(GISTSTACK * stk, BlockNumber blkno,
+adjuststack(GISTSTACK *stk, BlockNumber blkno,
OffsetNumber offnum);
static void
adjustiptr(IndexScanDesc s, ItemPointer iptr,
{
IndexScanDesc gsl_scan;
struct GISTScanListData *gsl_next;
-} GISTScanListData;
+} GISTScanListData;
typedef GISTScanListData *GISTScanList;
*/
/*ARGSUSED*/
static void
-adjuststack(GISTSTACK * stk,
+adjuststack(GISTSTACK *stk,
BlockNumber blkno,
OffsetNumber offnum)
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.15 1997/09/08 20:53:53 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.16 1997/09/08 21:40:45 momjian Exp $
*
* NOTES
* This file contains only the public interface routines.
AttrNumber *attnum,
IndexStrategy istrat,
uint16 pcount,
- Datum * params,
- FuncIndexInfo * finfo,
- PredInfo * predInfo)
+ Datum *params,
+ FuncIndexInfo *finfo,
+ PredInfo *predInfo)
{
HeapScanDesc hscan;
Buffer buffer;
* to the caller.
*/
InsertIndexResult
-hashinsert(Relation rel, Datum * datum, char *nulls, ItemPointer ht_ctid, Relation heapRel)
+hashinsert(Relation rel, Datum *datum, char *nulls, ItemPointer ht_ctid, Relation heapRel)
{
HashItem hitem;
IndexTuple itup;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.5 1997/09/08 02:20:13 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.6 1997/09/08 21:40:47 momjian Exp $
*
* NOTES
* These functions are stored in pg_amproc. For each operator class
uint32
hashint2(int16 key)
{
- return ((uint32) ~ key);
+ return ((uint32) ~key);
}
uint32
uint32
hashoid(Oid key)
{
- return ((uint32) ~ key);
+ return ((uint32) ~key);
}
}
uint32
-hashname(NameData * n)
+hashname(NameData *n)
{
uint32 h;
int len;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.10 1997/09/08 02:20:20 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.11 1997/09/08 21:40:48 momjian Exp $
*
* NOTES
* Because we can be doing an index scan on a relation while we
{
IndexScanDesc hashsl_scan;
struct HashScanListData *hashsl_next;
-} HashScanListData;
+} HashScanListData;
typedef HashScanListData *HashScanList;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/hash/hashsearch.c,v 1.13 1997/09/08 20:54:05 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/hash/hashsearch.c,v 1.14 1997/09/08 21:40:52 momjian Exp $
*
*-------------------------------------------------------------------------
*/
static void
_hash_readnext(Relation rel,
- Buffer *bufp, Page * pagep, HashPageOpaque * opaquep)
+ Buffer *bufp, Page *pagep, HashPageOpaque *opaquep)
{
BlockNumber blkno;
static void
_hash_readprev(Relation rel,
- Buffer *bufp, Page * pagep, HashPageOpaque * opaquep)
+ Buffer *bufp, Page *pagep, HashPageOpaque *opaquep)
{
BlockNumber blkno;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.18 1997/09/08 20:54:08 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.19 1997/09/08 21:40:57 momjian Exp $
*
*
* INTERFACE ROUTINES
*/
SetRefreshWhenInvalidate(ImmediateInvalidation);
RelationInvalidateHeapTuple(relation, tup);
- SetRefreshWhenInvalidate((bool) ! ImmediateInvalidation);
+ SetRefreshWhenInvalidate((bool) !ImmediateInvalidation);
}
return (tup->t_oid);
*/
SetRefreshWhenInvalidate(ImmediateInvalidation);
RelationInvalidateHeapTuple(relation, tp);
- SetRefreshWhenInvalidate((bool) ! ImmediateInvalidation);
+ SetRefreshWhenInvalidate((bool) !ImmediateInvalidation);
WriteBuffer(b);
if (IsSystemRelationName(RelationGetRelationName(relation)->data))
*/
SetRefreshWhenInvalidate(ImmediateInvalidation);
RelationInvalidateHeapTuple(relation, tp);
- SetRefreshWhenInvalidate((bool) ! ImmediateInvalidation);
+ SetRefreshWhenInvalidate((bool) !ImmediateInvalidation);
WriteBuffer(buffer);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.15 1997/09/08 02:20:37 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.16 1997/09/08 21:41:06 momjian Exp $
*
* INTERFACE ROUTINES
* index_open - open an index relation by relationId
*/
InsertIndexResult
index_insert(Relation relation,
- Datum * datum,
+ Datum *datum,
char *nulls,
ItemPointer heap_t_ctid,
Relation heapRel)
TupleDesc hTupDesc,
int attOff,
AttrNumber attrNums[],
- FuncIndexInfo * fInfo,
- bool * attNull,
+ FuncIndexInfo *fInfo,
+ bool *attNull,
Buffer buffer)
{
Datum returnVal;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.11 1997/09/08 02:20:41 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.12 1997/09/08 21:41:07 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*/
void
IndexSupportInitialize(IndexStrategy indexStrategy,
- RegProcedure * indexSupport,
+ RegProcedure *indexSupport,
Oid indexObjectId,
Oid accessMethodObjectId,
StrategyNumber maxStrategyNumber,
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.12 1997/09/08 02:20:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.13 1997/09/08 21:41:11 momjian Exp $
*
* NOTES
* These functions are stored in pg_amproc. For each operator class
}
int32
-btnamecmp(NameData * a, NameData * b)
+btnamecmp(NameData *a, NameData *b)
{
return (strncmp(a->data, b->data, NAMEDATALEN));
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.19 1997/09/08 02:20:46 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.20 1997/09/08 21:41:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
maxoff = PageGetMaxOffsetNumber(page);
llimit = PageGetPageSize(page) - sizeof(PageHeaderData) -
DOUBLEALIGN(sizeof(BTPageOpaqueData))
- + sizeof(ItemIdData);
+ +sizeof(ItemIdData);
llimit /= 2;
firstright = _bt_findsplitloc(rel, page, start, maxoff, llimit);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.22 1997/09/08 20:54:21 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtree.c,v 1.23 1997/09/08 21:41:24 momjian Exp $
*
* NOTES
* This file contains only the public interface routines.
AttrNumber *attnum,
IndexStrategy istrat,
uint16 pcount,
- Datum * params,
- FuncIndexInfo * finfo,
- PredInfo * predInfo)
+ Datum *params,
+ FuncIndexInfo *finfo,
+ PredInfo *predInfo)
{
HeapScanDesc hscan;
Buffer buffer;
* return an InsertIndexResult to the caller.
*/
InsertIndexResult
-btinsert(Relation rel, Datum * datum, char *nulls, ItemPointer ht_ctid, Relation heapRel)
+btinsert(Relation rel, Datum *datum, char *nulls, ItemPointer ht_ctid, Relation heapRel)
{
BTItem btitem;
IndexTuple itup;
*
*
* IDENTIFICATION
- * $Id: nbtsort.c,v 1.22 1997/09/08 20:54:28 momjian Exp $
+ * $Id: nbtsort.c,v 1.23 1997/09/08 21:41:28 momjian Exp $
*
* NOTES
*
* allocate a new, clean btree page, not linked to any siblings.
*/
static void
-_bt_blnewpage(Relation index, Buffer *buf, Page * page, int flags)
+_bt_blnewpage(Relation index, Buffer *buf, Page *page, int flags)
{
BTPageOpaque opaque;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtutils.c,v 1.13 1997/09/08 02:21:01 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtutils.c,v 1.14 1997/09/08 21:41:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#endif
bool
-_bt_checkkeys(IndexScanDesc scan, IndexTuple tuple, Size * keysok)
+_bt_checkkeys(IndexScanDesc scan, IndexTuple tuple, Size *keysok)
{
BTScanOpaque so = (BTScanOpaque) scan->opaque;
Size keysz = so->numberOfKeys;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.10 1997/09/08 20:54:32 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.11 1997/09/08 21:41:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
}
POLYGON *
-rt_poly_union(POLYGON * a, POLYGON * b)
+rt_poly_union(POLYGON *a, POLYGON *b)
{
POLYGON *p;
}
void
-rt_poly_size(POLYGON * a, float *size)
+rt_poly_size(POLYGON *a, float *size)
{
double xdim,
ydim;
}
POLYGON *
-rt_poly_inter(POLYGON * a, POLYGON * b)
+rt_poly_inter(POLYGON *a, POLYGON *b)
{
POLYGON *p;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.16 1997/09/08 20:54:33 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtree.c,v 1.17 1997/09/08 21:41:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
OffsetNumber *spl_right;
int spl_nright;
char *spl_rdatum;
-} SPLITVEC;
+} SPLITVEC;
typedef struct RTSTATE
{
func_ptr unionFn; /* union function */
func_ptr sizeFn; /* size function */
func_ptr interFn; /* intersection function */
-} RTSTATE;
+} RTSTATE;
/* non-export function prototypes */
static InsertIndexResult
rtdoinsert(Relation r, IndexTuple itup,
- RTSTATE * rtstate);
+ RTSTATE *rtstate);
static void
-rttighten(Relation r, RTSTACK * stk, char *datum, int att_size,
- RTSTATE * rtstate);
+rttighten(Relation r, RTSTACK *stk, char *datum, int att_size,
+ RTSTATE *rtstate);
static InsertIndexResult
-dosplit(Relation r, Buffer buffer, RTSTACK * stack,
- IndexTuple itup, RTSTATE * rtstate);
+dosplit(Relation r, Buffer buffer, RTSTACK *stack,
+ IndexTuple itup, RTSTATE *rtstate);
static void
-rtintinsert(Relation r, RTSTACK * stk, IndexTuple ltup,
- IndexTuple rtup, RTSTATE * rtstate);
+rtintinsert(Relation r, RTSTACK *stk, IndexTuple ltup,
+ IndexTuple rtup, RTSTATE *rtstate);
static void rtnewroot(Relation r, IndexTuple lt, IndexTuple rt);
static void
-picksplit(Relation r, Page page, SPLITVEC * v, IndexTuple itup,
- RTSTATE * rtstate);
+picksplit(Relation r, Page page, SPLITVEC *v, IndexTuple itup,
+ RTSTATE *rtstate);
static void RTInitBuffer(Buffer b, uint32 f);
static OffsetNumber
choose(Relation r, Page p, IndexTuple it,
- RTSTATE * rtstate);
+ RTSTATE *rtstate);
static int nospace(Page p, IndexTuple it);
-static void initRtstate(RTSTATE * rtstate, Relation index);
+static void initRtstate(RTSTATE *rtstate, Relation index);
void
AttrNumber *attnum,
IndexStrategy istrat,
uint16 pcount,
- Datum * params,
- FuncIndexInfo * finfo,
- PredInfo * predInfo)
+ Datum *params,
+ FuncIndexInfo *finfo,
+ PredInfo *predInfo)
{
HeapScanDesc scan;
Buffer buffer;
* It doesn't do any work; just locks the relation and passes the buck.
*/
InsertIndexResult
-rtinsert(Relation r, Datum * datum, char *nulls, ItemPointer ht_ctid, Relation heapRel)
+rtinsert(Relation r, Datum *datum, char *nulls, ItemPointer ht_ctid, Relation heapRel)
{
InsertIndexResult res;
IndexTuple itup;
}
static InsertIndexResult
-rtdoinsert(Relation r, IndexTuple itup, RTSTATE * rtstate)
+rtdoinsert(Relation r, IndexTuple itup, RTSTATE *rtstate)
{
Page page;
Buffer buffer;
static void
rttighten(Relation r,
- RTSTACK * stk,
+ RTSTACK *stk,
char *datum,
int att_size,
- RTSTATE * rtstate)
+ RTSTATE *rtstate)
{
char *oldud;
char *tdatum;
static InsertIndexResult
dosplit(Relation r,
Buffer buffer,
- RTSTACK * stack,
+ RTSTACK *stack,
IndexTuple itup,
- RTSTATE * rtstate)
+ RTSTATE *rtstate)
{
Page p;
Buffer leftbuf,
tupDesc = r->rd_att;
ltup = (IndexTuple) index_formtuple(tupDesc,
- (Datum *) & (v.spl_ldatum), isnull);
+ (Datum *) &(v.spl_ldatum), isnull);
rtup = (IndexTuple) index_formtuple(tupDesc,
- (Datum *) & (v.spl_rdatum), isnull);
+ (Datum *) &(v.spl_rdatum), isnull);
pfree(isnull);
/* set pointers to new child pages in the internal index tuples */
static void
rtintinsert(Relation r,
- RTSTACK * stk,
+ RTSTACK *stk,
IndexTuple ltup,
IndexTuple rtup,
- RTSTATE * rtstate)
+ RTSTATE *rtstate)
{
IndexTuple old;
Buffer b;
static void
picksplit(Relation r,
Page page,
- SPLITVEC * v,
+ SPLITVEC *v,
IndexTuple itup,
- RTSTATE * rtstate)
+ RTSTATE *rtstate)
{
OffsetNumber maxoff;
OffsetNumber i,
}
static OffsetNumber
-choose(Relation r, Page p, IndexTuple it, RTSTATE * rtstate)
+choose(Relation r, Page p, IndexTuple it, RTSTATE *rtstate)
{
OffsetNumber maxoff;
OffsetNumber i;
}
void
-freestack(RTSTACK * s)
+freestack(RTSTACK *s)
{
RTSTACK *p;
}
static void
-initRtstate(RTSTATE * rtstate, Relation index)
+initRtstate(RTSTATE *rtstate, Relation index)
{
RegProcedure union_proc,
size_proc,
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.12 1997/09/08 02:21:08 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.13 1997/09/08 21:41:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
rtadjone(IndexScanDesc s, int op, BlockNumber blkno,
OffsetNumber offnum);
static void
-adjuststack(RTSTACK * stk, BlockNumber blkno,
+adjuststack(RTSTACK *stk, BlockNumber blkno,
OffsetNumber offnum);
static void
adjustiptr(IndexScanDesc s, ItemPointer iptr,
{
IndexScanDesc rtsl_scan;
struct RTScanListData *rtsl_next;
-} RTScanListData;
+} RTScanListData;
typedef RTScanListData *RTScanList;
*/
/*ARGSUSED*/
static void
-adjuststack(RTSTACK * stk,
+adjuststack(RTSTACK *stk,
BlockNumber blkno,
OffsetNumber offnum)
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.12 1997/09/08 20:54:36 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.13 1997/09/08 21:41:42 momjian Exp $
*
* NOTES
* This file contains the high level access-method interface to the
* --------------------------------
*/
-static bool /* true/false: does transaction id have
+static bool /* true/false: does transaction id have
* specified status? */
TransactionLogTest(TransactionId transactionId, /* transaction id to test */
XidStatus status) /* transaction status */
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/transsup.c,v 1.12 1997/09/08 20:54:37 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/transsup.c,v 1.13 1997/09/08 21:41:46 momjian Exp $
*
* NOTES
* This file contains support functions for the high
static XidStatus
TransBlockGetLastTransactionIdStatus(Block tblock,
TransactionId baseXid,
- TransactionId * returnXidP)
+ TransactionId *returnXidP)
{
Index index;
Index maxIndex;
TransBlockNumberGetXidStatus(Relation relation,
BlockNumber blockNumber,
TransactionId xid,
- bool * failP)
+ bool *failP)
{
Buffer buffer; /* buffer associated with block */
Block block; /* block containing xstatus */
BlockNumber blockNumber,
TransactionId xid,
XidStatus xstatus,
- bool * failP)
+ bool *failP)
{
Buffer buffer; /* buffer associated with block */
Block block; /* block containing xstatus */
TransBlockNumberGetCommitTime(Relation relation,
BlockNumber blockNumber,
TransactionId xid,
- bool * failP)
+ bool *failP)
{
Buffer buffer; /* buffer associated with block */
Block block; /* block containing commit time */
BlockNumber blockNumber,
TransactionId xid,
AbsoluteTime xtime,
- bool * failP)
+ bool *failP)
{
Buffer buffer; /* buffer associated with block */
Block block; /* block containing commit time */
TransGetLastRecordedTransaction(Relation relation,
TransactionId xid, /* return: transaction
* id */
- bool * failP)
+ bool *failP)
{
BlockNumber blockNumber; /* block number */
Buffer buffer; /* buffer associated with block */
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/transam/varsup.c,v 1.11 1997/09/08 02:21:21 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/varsup.c,v 1.12 1997/09/08 21:41:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include <access/heapam.h>
#include <catalog/catname.h>
-static void GetNewObjectIdBlock(Oid * oid_return, int oid_block_size);
-static void VariableRelationGetNextOid(Oid * oid_return);
-static void VariableRelationGetNextXid(TransactionId * xidP);
+static void GetNewObjectIdBlock(Oid *oid_return, int oid_block_size);
+static void VariableRelationGetNextOid(Oid *oid_return);
+static void VariableRelationGetNextXid(TransactionId *xidP);
static void VariableRelationPutLastXid(TransactionId xid);
-static void VariableRelationPutNextOid(Oid * oidP);
-static void VariableRelationGetLastXid(TransactionId * xidP);
+static void VariableRelationPutNextOid(Oid *oidP);
+static void VariableRelationGetLastXid(TransactionId *xidP);
/* ---------------------
* spin lock for oid generation
* --------------------------------
*/
static void
-VariableRelationGetNextXid(TransactionId * xidP)
+VariableRelationGetNextXid(TransactionId *xidP)
{
Buffer buf;
VariableRelationContents var;
* --------------------------------
*/
static void
-VariableRelationGetLastXid(TransactionId * xidP)
+VariableRelationGetLastXid(TransactionId *xidP)
{
Buffer buf;
VariableRelationContents var;
* --------------------------------
*/
static void
-VariableRelationGetNextOid(Oid * oid_return)
+VariableRelationGetNextOid(Oid *oid_return)
{
Buffer buf;
VariableRelationContents var;
* --------------------------------
*/
static void
-VariableRelationPutNextOid(Oid * oidP)
+VariableRelationPutNextOid(Oid *oidP)
{
Buffer buf;
VariableRelationContents var;
static TransactionId next_prefetched_xid;
void
-GetNewTransactionId(TransactionId * xid)
+GetNewTransactionId(TransactionId *xid)
{
TransactionId nextid;
* ----------------
*/
static void
-GetNewObjectIdBlock(Oid * oid_return, /* place to return the new object
+GetNewObjectIdBlock(Oid *oid_return, /* place to return the new object
* id */
int oid_block_size) /* number of oids desired */
{
static Oid next_prefetched_oid;
void
-GetNewObjectId(Oid * oid_return)/* place to return the new object id */
+GetNewObjectId(Oid *oid_return) /* place to return the new object id */
{
/* ----------------
* if we run out of prefetched oids, then we get some
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.15 1997/09/08 02:21:22 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.16 1997/09/08 21:41:52 momjian Exp $
*
* NOTES
* Transaction aborts can now occur two ways:
* V1 transaction system. -cim 3/18/90
* ----------------
*/
-TransactionId DisabledTransactionId = (TransactionId) - 1;
+TransactionId DisabledTransactionId = (TransactionId) -1;
-CommandId DisabledCommandId = (CommandId) - 1;
+CommandId DisabledCommandId = (CommandId) -1;
AbsoluteTime DisabledStartTime = (AbsoluteTime) BIG_ABSTIME; /* 1073741823; */
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/xid.c,v 1.9 1997/09/08 02:21:24 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/xid.c,v 1.10 1997/09/08 21:41:56 momjian Exp $
*
* OLD COMMENTS
* XXX WARNING
* ----------------------------------------------------------------
*/
void
-StoreInvalidTransactionId(TransactionId * destination)
+StoreInvalidTransactionId(TransactionId *destination)
{
*destination = NullTransactionId;
}
*/
void
TransactionIdStore(TransactionId transactionId,
- TransactionId * destination)
+ TransactionId *destination)
{
*destination = transactionId;
}
*/
#ifdef NOT_USED
void
-TransactionIdIncrement(TransactionId * transactionId)
+TransactionIdIncrement(TransactionId *transactionId)
{
(*transactionId)++;
* ----------------------------------------------------------------
*/
void
-TransactionIdAdd(TransactionId * xid, int value)
+TransactionIdAdd(TransactionId *xid, int value)
{
*xid += value;
return;
* Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.24 1997/09/08 20:54:40 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.25 1997/09/08 21:42:01 momjian Exp $
*
*-------------------------------------------------------------------------
*/
static AttributeTupleForm AllocateAttribute(void);
static bool BootstrapAlreadySeen(Oid id);
static int CompHash(char *str, int len);
-static hashnode *FindStr(char *str, int length, hashnode * mderef);
+static hashnode *FindStr(char *str, int length, hashnode *mderef);
static int gettype(char *type);
static void cleanup(void);
FuncIndexInfo *il_finfo;
PredInfo *il_predInfo;
struct _IndexList *il_next;
-} IndexList;
+} IndexList;
static IndexList *ILHead = (IndexList *) NULL;
* ----------------
*/
static hashnode *
-FindStr(char *str, int length, hashnode * mderef)
+FindStr(char *str, int length, hashnode *mderef)
{
hashnode *node;
int natts,
AttrNumber *attnos,
uint16 nparams,
- Datum * params,
- FuncIndexInfo * finfo,
- PredInfo * predInfo)
+ Datum *params,
+ FuncIndexInfo *finfo,
+ PredInfo *predInfo)
{
Datum *v;
IndexList *newind;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.9 1997/09/08 02:21:33 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.10 1997/09/08 21:42:12 momjian Exp $
*
*-------------------------------------------------------------------------
*/
}
else
{
- (*attributeP)->attnum = (int16)++ i;
+ (*attributeP)->attnum = (int16) ++i;
/*
* Check if the attr is a set before messing with the length
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.27 1997/09/08 20:54:54 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.28 1997/09/08 21:42:16 momjian Exp $
*
* INTERFACE ROUTINES
* heap_creatr() - Create an uncataloged heap relation
int num; /* number of temporary relations */
int size; /* size of space allocated for the rels
* array */
-} TempRelList;
+} TempRelList;
#define TEMP_REL_LIST_SIZE 32
tempRels = NULL;
}
-extern List *flatten_tlist(List * tlist);
+extern List *flatten_tlist(List *tlist);
extern List *
-pg_plan(char *query_string, Oid * typev, int nargs,
- QueryTreeList ** queryListP, CommandDest dest);
+pg_plan(char *query_string, Oid *typev, int nargs,
+ QueryTreeList **queryListP, CommandDest dest);
static void
StoreAttrDefault(Relation rel, AttrDefault *attrdef)
}
static void
-StoreRelCheck(Relation rel, ConstrCheck * check)
+StoreRelCheck(Relation rel, ConstrCheck *check)
{
char str[MAX_PARSE_BUFFER];
QueryTreeList *queryTree_list;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.21 1997/09/08 02:21:40 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.22 1997/09/08 21:42:18 momjian Exp $
*
*
* INTERFACE ROUTINES
RelationNameGetObjectId(char *relationName, Relation pg_class,
bool setHasIndexAttribute);
static Oid GetHeapRelationOid(char *heapRelationName, char *indexRelationName);
-static TupleDesc BuildFuncTupleDesc(FuncIndexInfo * funcInfo);
+static TupleDesc BuildFuncTupleDesc(FuncIndexInfo *funcInfo);
static TupleDesc
ConstructTupleDescriptor(Oid heapoid, Relation heapRelation,
- List * attributeList,
+ List *attributeList,
int numatts, AttrNumber attNums[]);
static void ConstructIndexReldesc(Relation indexRelation, Oid amoid);
AppendAttributeTuples(Relation indexRelation, int numatts);
static void
UpdateIndexRelation(Oid indexoid, Oid heapoid,
- FuncIndexInfo * funcInfo, int natts,
- AttrNumber attNums[], Oid classOids[], Node * predicate,
- List * attributeList, bool islossy, bool unique);
+ FuncIndexInfo *funcInfo, int natts,
+ AttrNumber attNums[], Oid classOids[], Node *predicate,
+ List *attributeList, bool islossy, bool unique);
static void
DefaultBuild(Relation heapRelation, Relation indexRelation,
int numberOfAttributes, AttrNumber attributeNumber[],
IndexStrategy indexStrategy, uint16 parameterCount,
- Datum parameter[], FuncIndexInfoPtr funcInfo, PredInfo * predInfo);
+ Datum parameter[], FuncIndexInfoPtr funcInfo, PredInfo *predInfo);
/* ----------------------------------------------------------------
* sysatts is a structure containing attribute tuple forms
}
static TupleDesc
-BuildFuncTupleDesc(FuncIndexInfo * funcInfo)
+BuildFuncTupleDesc(FuncIndexInfo *funcInfo)
{
HeapTuple tuple;
TupleDesc funcTupDesc;
static TupleDesc
ConstructTupleDescriptor(Oid heapoid,
Relation heapRelation,
- List * attributeList,
+ List *attributeList,
int numatts,
AttrNumber attNums[])
{
static void
UpdateIndexRelation(Oid indexoid,
Oid heapoid,
- FuncIndexInfo * funcInfo,
+ FuncIndexInfo *funcInfo,
int natts,
AttrNumber attNums[],
Oid classOids[],
- Node * predicate,
- List * attributeList,
+ Node *predicate,
+ List *attributeList,
bool islossy,
bool unique)
{
* ----------------------------------------------------------------
*/
void
-UpdateIndexPredicate(Oid indexoid, Node * oldPred, Node * predicate)
+UpdateIndexPredicate(Oid indexoid, Node *oldPred, Node *predicate)
{
Node *newPred;
char *predString;
void
index_create(char *heapRelationName,
char *indexRelationName,
- FuncIndexInfo * funcInfo,
- List * attributeList,
+ FuncIndexInfo *funcInfo,
+ List *attributeList,
Oid accessMethodObjectId,
int numatts,
AttrNumber attNums[],
Oid classObjectId[],
uint16 parameterCount,
- Datum * parameter,
- Node * predicate,
+ Datum *parameter,
+ Node *predicate,
bool islossy,
bool unique)
{
HeapTuple heapTuple,
TupleDesc heapDescriptor,
Buffer buffer,
- Datum * datum,
+ Datum *datum,
char *nullv,
FuncIndexInfoPtr fInfo)
{
char nulls[Natts_pg_class];
char replace[Natts_pg_class];
- fmgr_info(ObjectIdEqualRegProcedure, (func_ptr *) & key[0].sk_func,
+ fmgr_info(ObjectIdEqualRegProcedure, (func_ptr *) &key[0].sk_func,
&key[0].sk_nargs);
/* ----------------
* -------------------------
*/
void
-FillDummyExprContext(ExprContext * econtext,
- TupleTableSlot * slot,
+FillDummyExprContext(ExprContext *econtext,
+ TupleTableSlot *slot,
TupleDesc tupdesc,
Buffer buffer)
{
uint16 parameterCount, /* not used */
Datum parameter[], /* not used */
FuncIndexInfoPtr funcInfo,
- PredInfo * predInfo)
+ PredInfo *predInfo)
{
HeapScanDesc scan;
HeapTuple heapTuple;
int numberOfAttributes,
AttrNumber attributeNumber[],
uint16 parameterCount,
- Datum * parameter,
- FuncIndexInfo * funcInfo,
- PredInfo * predInfo)
+ Datum *parameter,
+ FuncIndexInfo *funcInfo,
+ PredInfo *predInfo)
{
RegProcedure procedure;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.14 1997/09/08 20:55:07 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.15 1997/09/08 21:42:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* This is the inverse routine to CatalogOpenIndices()
*/
void
-CatalogCloseIndices(int nIndices, Relation * idescs)
+CatalogCloseIndices(int nIndices, Relation *idescs)
{
int i;
* each catalog index.
*/
void
-CatalogIndexInsert(Relation * idescs,
+CatalogIndexInsert(Relation *idescs,
int nIndices,
Relation heapRelation,
HeapTuple heapTuple)
ProcedureNameIndexScan(Relation heapRelation,
char *procName,
int nargs,
- Oid * argTypes)
+ Oid *argTypes)
{
Relation idesc;
ScanKeyData skey;
HeapTuple
-ProcedureSrcIndexScan(Relation heapRelation, text * procSrc)
+ProcedureSrcIndexScan(Relation heapRelation, text *procSrc)
{
Relation idesc;
IndexScanDesc sd;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.7 1997/09/08 02:21:46 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.8 1997/09/08 21:42:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
}
char *
-AggNameGetInitVal(char *aggName, Oid basetype, int xfuncno, bool * isNull)
+AggNameGetInitVal(char *aggName, Oid basetype, int xfuncno, bool *isNull)
{
HeapTuple tup;
Relation aggRel;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.7 1997/09/08 02:21:50 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.8 1997/09/08 21:42:23 momjian Exp $
*
*-------------------------------------------------------------------------
*/
int32 perbyte_cpu,
int32 percall_cpu,
int32 outin_ratio,
- List * argList,
+ List *argList,
CommandDest dest)
{
register i;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.9 1997/09/08 02:21:51 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.10 1997/09/08 21:42:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
static Oid
TypeGetWithOpenRelation(Relation pg_type_desc,
char *typeName,
- bool * defined)
+ bool *defined)
{
HeapScanDesc scan;
HeapTuple tup;
*/
Oid
TypeGet(char *typeName, /* name of type to be fetched */
- bool * defined) /* has the type been defined? */
+ bool *defined) /* has the type been defined? */
{
Relation pg_type_desc;
Oid typeoid;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.15 1997/09/08 02:22:01 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.16 1997/09/08 21:42:29 momjian Exp $
*
* NOTES
* The PortalExecutorHeapMemory crap needs to be eliminated
PerformAddAttribute(char *relationName,
char *userName,
bool inherits,
- ColumnDef * colDef)
+ ColumnDef *colDef)
{
Relation relrdesc,
attrdesc;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.32 1997/09/08 20:55:19 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.33 1997/09/08 21:42:30 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* non-export function prototypes */
-static void CopyTo(Relation rel, bool binary, bool oids, FILE * fp, char *delim);
-static void CopyFrom(Relation rel, bool binary, bool oids, FILE * fp, char *delim);
+static void CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim);
+static void CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim);
static Oid GetOutputFunction(Oid type);
static Oid GetTypeElement(Oid type);
static Oid GetInputFunction(Oid type);
static void
GetIndexRelations(Oid main_relation_oid,
int *n_indices,
- Relation ** index_rels);
+ Relation **index_rels);
#ifdef COPY_PATCH
-static void CopyReadNewline(FILE * fp, int *newline);
-static char *CopyReadAttribute(FILE * fp, bool * isnull, char *delim, int *newline);
+static void CopyReadNewline(FILE *fp, int *newline);
+static char *CopyReadAttribute(FILE *fp, bool *isnull, char *delim, int *newline);
#else
-static char *CopyReadAttribute(FILE * fp, bool * isnull, char *delim);
+static char *CopyReadAttribute(FILE *fp, bool *isnull, char *delim);
#endif
-static void CopyAttributeOut(FILE * fp, char *string, char *delim);
+static void CopyAttributeOut(FILE *fp, char *string, char *delim);
static int CountTuples(Relation relation);
extern FILE *Pfout,
static void
-CopyTo(Relation rel, bool binary, bool oids, FILE * fp, char *delim)
+CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
{
HeapTuple tuple;
HeapScanDesc scandesc;
}
static void
-CopyFrom(Relation rel, bool binary, bool oids, FILE * fp, char *delim)
+CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
{
HeapTuple tuple;
AttrNumber attr_count;
switch (attr[i]->attlen)
{
case sizeof(char):
- values[i] = (Datum) * (unsigned char *) ptr;
+ values[i] = (Datum) *(unsigned char *) ptr;
ptr += sizeof(char);
break;
case sizeof(short):
ptr = (char *) SHORTALIGN(ptr);
- values[i] = (Datum) * (unsigned short *) ptr;
+ values[i] = (Datum) *(unsigned short *) ptr;
ptr += sizeof(short);
break;
case sizeof(int32):
ptr = (char *) INTALIGN(ptr);
- values[i] = (Datum) * (uint32 *) ptr;
+ values[i] = (Datum) *(uint32 *) ptr;
ptr += sizeof(int32);
break;
default:
{
Oid index_rel_oid;
struct rel_list *next;
-} RelationList;
+} RelationList;
static void
GetIndexRelations(Oid main_relation_oid,
int *n_indices,
- Relation ** index_rels)
+ Relation **index_rels)
{
RelationList *head,
*scan;
*/
void
-CopyReadNewline(FILE * fp, int *newline)
+CopyReadNewline(FILE *fp, int *newline)
{
if (!*newline)
{
static char *
#ifdef COPY_PATCH
-CopyReadAttribute(FILE * fp, bool * isnull, char *delim, int *newline)
+CopyReadAttribute(FILE *fp, bool *isnull, char *delim, int *newline)
#else
-CopyReadAttribute(FILE * fp, bool * isnull, char *delim)
+CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
#endif
{
static char attribute[EXT_ATTLEN];
}
static void
-CopyAttributeOut(FILE * fp, char *string, char *delim)
+CopyAttributeOut(FILE *fp, char *string, char *delim)
{
char c;
int is_array = false;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.16 1997/09/08 02:22:06 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.17 1997/09/08 21:42:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
static int
checkAttrExists(char *attributeName,
- char *attributeType, List * schema);
-static List *MergeAttributes(List * schema, List * supers, List ** supconstr);
-static void StoreCatalogInheritance(Oid relationId, List * supers);
+ char *attributeType, List *schema);
+static List *MergeAttributes(List *schema, List *supers, List **supconstr);
+static void StoreCatalogInheritance(Oid relationId, List *supers);
/* ----------------------------------------------------------------
* DefineRelation --
* ----------------------------------------------------------------
*/
void
-DefineRelation(CreateStmt * stmt)
+DefineRelation(CreateStmt *stmt)
{
char *relname = palloc(NAMEDATALEN);
List *schema = stmt->tableElts;
* stud_emp {7:percent}
*/
static List *
-MergeAttributes(List * schema, List * supers, List ** supconstr)
+MergeAttributes(List *schema, List *supers, List **supconstr)
{
List *entry;
List *inhSchema = NIL;
* Updates the system catalogs with proper inheritance information.
*/
static void
-StoreCatalogInheritance(Oid relationId, List * supers)
+StoreCatalogInheritance(Oid relationId, List *supers)
{
Relation relation;
TupleDesc desc;
* returns 1 if attribute already exists in schema, 0 otherwise.
*/
static int
-checkAttrExists(char *attributeName, char *attributeType, List * schema)
+checkAttrExists(char *attributeName, char *attributeType, List *schema)
{
List *s;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.15 1997/09/08 20:55:25 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.16 1997/09/08 21:42:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define IsFuncIndex(ATTR_LIST) (((IndexElem*)lfirst(ATTR_LIST))->args!=NULL)
/* non-export function prototypes */
-static void CheckPredicate(List * predList, List * rangeTable, Oid baseRelOid);
+static void CheckPredicate(List *predList, List *rangeTable, Oid baseRelOid);
static void
-CheckPredExpr(Node * predicate, List * rangeTable,
+CheckPredExpr(Node *predicate, List *rangeTable,
Oid baseRelOid);
static void
- CheckPredClause(Expr * predicate, List * rangeTable, Oid baseRelOid);
+ CheckPredClause(Expr *predicate, List *rangeTable, Oid baseRelOid);
static void
-FuncIndexArgs(IndexElem * funcIndex, AttrNumber *attNumP,
- Oid * argTypes, Oid * opOidP, Oid relId);
+FuncIndexArgs(IndexElem *funcIndex, AttrNumber *attNumP,
+ Oid *argTypes, Oid *opOidP, Oid relId);
static void
-NormIndexAttrs(List * attList, AttrNumber *attNumP,
- Oid * opOidP, Oid relId);
+NormIndexAttrs(List *attList, AttrNumber *attNumP,
+ Oid *opOidP, Oid relId);
static char *GetDefaultOpClass(Oid atttypid);
/*
DefineIndex(char *heapRelationName,
char *indexRelationName,
char *accessMethodName,
- List * attributeList,
- List * parameterList,
+ List *attributeList,
+ List *parameterList,
bool unique,
- Expr * predicate,
- List * rangetable)
+ Expr *predicate,
+ List *rangetable)
{
Oid *classObjectId;
Oid accessMethodId;
* XXX
*/
void
-ExtendIndex(char *indexRelationName, Expr * predicate, List * rangetable)
+ExtendIndex(char *indexRelationName, Expr *predicate, List *rangetable)
{
Oid *classObjectId;
Oid accessMethodId;
*/
static void
-CheckPredicate(List * predList, List * rangeTable, Oid baseRelOid)
+CheckPredicate(List *predList, List *rangeTable, Oid baseRelOid)
{
List *item;
}
static void
-CheckPredExpr(Node * predicate, List * rangeTable, Oid baseRelOid)
+CheckPredExpr(Node *predicate, List *rangeTable, Oid baseRelOid)
{
List *clauses = NIL,
*clause;
}
static void
-CheckPredClause(Expr * predicate, List * rangeTable, Oid baseRelOid)
+CheckPredClause(Expr *predicate, List *rangeTable, Oid baseRelOid)
{
Var *pred_var;
Const *pred_const;
static void
-FuncIndexArgs(IndexElem * funcIndex,
+FuncIndexArgs(IndexElem *funcIndex,
AttrNumber *attNumP,
- Oid * argTypes,
- Oid * opOidP,
+ Oid *argTypes,
+ Oid *opOidP,
Oid relId)
{
List *rest;
}
static void
-NormIndexAttrs(List * attList, /* list of IndexElem's */
+NormIndexAttrs(List *attList, /* list of IndexElem's */
AttrNumber *attNumP,
- Oid * opOidP,
+ Oid *opOidP,
Oid relId)
{
List *rest;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.15 1997/09/08 02:22:09 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.16 1997/09/08 21:42:38 momjian Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
#include <tcop/dest.h>
#include <catalog/pg_user.h>
-static char *defGetString(DefElem * def);
-static int defGetTypeLength(DefElem * def);
+static char *defGetString(DefElem *def);
+static int defGetTypeLength(DefElem *def);
#define DEFAULT_TYPDELIM ','
static void
-compute_return_type(const Node * returnType,
- char **prorettype_p, bool * returnsSet_p)
+compute_return_type(const Node *returnType,
+ char **prorettype_p, bool *returnsSet_p)
{
/*---------------------------------------------------------------------------
Examine the "returns" clause returnType of the CREATE FUNCTION statement
static void
-compute_full_attributes(const List * parameters, int32 * byte_pct_p,
- int32 * perbyte_cpu_p, int32 * percall_cpu_p,
- int32 * outin_ratio_p, bool * canCache_p)
+compute_full_attributes(const List *parameters, int32 *byte_pct_p,
+ int32 *perbyte_cpu_p, int32 *percall_cpu_p,
+ int32 *outin_ratio_p, bool *canCache_p)
{
/*--------------------------------------------------------------------------
Interpret the parameters *parameters and return their contents as
*
*/
void
-CreateFunction(ProcedureStmt * stmt, CommandDest dest)
+CreateFunction(ProcedureStmt *stmt, CommandDest dest)
{
char *probin_str;
*/
void
DefineOperator(char *oprName,
- List * parameters)
+ List *parameters)
{
uint16 precedence = 0; /* operator precedence */
bool canHash = false;/* operator hashes */
* ------------------
*/
void
-DefineAggregate(char *aggName, List * parameters)
+DefineAggregate(char *aggName, List *parameters)
{
char *stepfunc1Name = NULL;
*
*/
void
-DefineType(char *typeName, List * parameters)
+DefineType(char *typeName, List *parameters)
{
int16 internalLength = 0; /* int2 */
int16 externalLength = 0; /* int2 */
}
static char *
-defGetString(DefElem * def)
+defGetString(DefElem *def)
{
if (nodeTag(def->arg) != T_String)
elog(WARN, "Define: \"%s\" = what?", def->defname);
}
static int
-defGetTypeLength(DefElem * def)
+defGetTypeLength(DefElem *def)
{
if (nodeTag(def->arg) == T_Integer)
return (intVal(def->arg));
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.12 1997/09/08 02:22:10 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.13 1997/09/08 21:42:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
bool printNodes; /* do nodeToString() instead */
/* other states */
List *rtable; /* range table */
-} ExplainState;
+} ExplainState;
-static char *Explain_PlanToString(Plan * plan, ExplainState * es);
+static char *Explain_PlanToString(Plan *plan, ExplainState *es);
/*
* ExplainQuery -
*
*/
void
-ExplainQuery(Query * query, bool verbose, CommandDest dest)
+ExplainQuery(Query *query, bool verbose, CommandDest dest)
{
char *s = NULL,
*s2;
* converts a Node into ascii string and append it to 'str'
*/
static void
-explain_outNode(StringInfo str, Plan * plan, int indent, ExplainState * es)
+explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
{
char *pname;
char buf[1000];
}
static char *
-Explain_PlanToString(Plan * plan, ExplainState * es)
+Explain_PlanToString(Plan *plan, ExplainState *es)
{
StringInfo str;
char *s;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.8 1997/09/08 02:22:12 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.9 1997/09/08 21:42:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef TIOGA
void
-beginRecipe(RecipeStmt * stmt)
+beginRecipe(RecipeStmt *stmt)
{
elog(NOTICE, "You must compile with TIOGA defined in order to use recipes\n");
}
TeePlanInfo *val;
} TeeInfo;
-QueryTreeList *appendQlist(QueryTreeList * q1, QueryTreeList * q2);
-void OffsetVarAttno(Node * node, int varno, int offset);
+QueryTreeList *appendQlist(QueryTreeList *q1, QueryTreeList *q2);
+void OffsetVarAttno(Node *node, int varno, int offset);
static void
appendTeeQuery(TeeInfo * teeInfo,
- QueryTreeList * q,
+ QueryTreeList *q,
char *teeNodeName);
static Plan *
-replaceTeeScans(Plan * plan,
- Query * parsetree,
+replaceTeeScans(Plan *plan,
+ Query *parsetree,
TeeInfo * teeInfo);
static void
-replaceSeqScan(Plan * plan,
- Plan * parent,
+replaceSeqScan(Plan *plan,
+ Plan *parent,
int rt_ind,
- Plan * tplan);
+ Plan *tplan);
static void
tg_rewriteQuery(TgRecipe * r, TgNode * n,
- QueryTreeList * q,
- QueryTreeList * inputQlist);
+ QueryTreeList *q,
+ QueryTreeList *inputQlist);
static Node *
-tg_replaceNumberedParam(Node * expression,
+tg_replaceNumberedParam(Node *expression,
int pnum,
int rt_ind,
char *teeRelName);
static Node *
-tg_rewriteParamsInExpr(Node * expression,
- QueryTreeList * inputQlist);
+tg_rewriteParamsInExpr(Node *expression,
+ QueryTreeList *inputQlist);
static QueryTreeList *
tg_parseSubQuery(TgRecipe * r,
TgNode * n,
tg_parseTeeNode(TgRecipe * r,
TgNode * n,
int i,
- QueryTreeList * qList,
+ QueryTreeList *qList,
TeeInfo * teeInfo);
*/
void
-beginRecipe(RecipeStmt * stmt)
+beginRecipe(RecipeStmt *stmt)
{
TgRecipe *r;
int i;
static void
tg_rewriteQuery(TgRecipe * r,
TgNode * n,
- QueryTreeList * q,
- QueryTreeList * inputQlist)
+ QueryTreeList *q,
+ QueryTreeList *inputQlist)
{
Query *orig;
Query *inputQ;
*/
static Node *
-tg_replaceNumberedParam(Node * expression,
+tg_replaceNumberedParam(Node *expression,
int pnum, /* the number of the parameter */
int rt_ind, /* the range table index */
char *teeRelName) /* the relname of the tee
*/
static Node *
-tg_rewriteParamsInExpr(Node * expression, QueryTreeList * inputQlist)
+tg_rewriteParamsInExpr(Node *expression, QueryTreeList *inputQlist)
{
List *tl;
TargetEntry *param_tle,
tg_parseTeeNode(TgRecipe * r,
TgNode * n, /* the tee node */
int i, /* which input this node is to its parent */
- QueryTreeList * qList,
+ QueryTreeList *qList,
TeeInfo * teeInfo)
{
*/
void
-OffsetVarAttno(Node * node, int varno, int offset)
+OffsetVarAttno(Node *node, int varno, int offset)
{
if (node == NULL)
return;
*/
QueryTreeList *
-appendQlist(QueryTreeList * q1, QueryTreeList * q2)
+appendQlist(QueryTreeList *q1, QueryTreeList *q2)
{
QueryTreeList *newq;
int i,
* modify the query field of the teeInfo list of the particular tee node
*/
static void
-appendTeeQuery(TeeInfo * teeInfo, QueryTreeList * q, char *teeNodeName)
+appendTeeQuery(TeeInfo * teeInfo, QueryTreeList *q, char *teeNodeName)
{
int i;
* qual or targetlist because the child plan has been replaced with a tee node
*/
static void
-replaceSeqScan(Plan * plan, Plan * parent,
- int rt_ind, Plan * tplan)
+replaceSeqScan(Plan *plan, Plan *parent,
+ int rt_ind, Plan *tplan)
{
Scan *snode;
Tee *teePlan;
* a connection to the actual tee plan node
*/
static Plan *
-replaceTeeScans(Plan * plan, Query * parsetree, TeeInfo * teeInfo)
+replaceTeeScans(Plan *plan, Query *parsetree, TeeInfo * teeInfo)
{
int i;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.13 1997/09/08 20:55:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.14 1997/09/08 21:42:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
void
RemoveFunction(char *functionName, /* function name to be removed */
int nargs,
- List * argNameList /* list of TypeNames */ )
+ List *argNameList /* list of TypeNames */ )
{
Relation relation;
HeapScanDesc scan;
int4 cache_value;
char is_cycled;
char is_called;
-} FormData_pg_sequence;
+} FormData_pg_sequence;
typedef FormData_pg_sequence *SequenceTupleForm;
typedef struct sequence_magic
{
uint32 magic;
-} sequence_magic;
+} sequence_magic;
typedef struct SeqTableData
{
int4 last;
int4 increment;
struct SeqTableData *next;
-} SeqTableData;
+} SeqTableData;
typedef SeqTableData *SeqTable;
static SeqTable init_sequence(char *caller, char *name);
static SequenceTupleForm read_info(char *caller, SeqTable elm, Buffer *buf);
-static void init_params(CreateSeqStmt * seq, SequenceTupleForm new);
-static int get_param(DefElem * def);
+static void init_params(CreateSeqStmt *seq, SequenceTupleForm new);
+static int get_param(DefElem *def);
/*
* DefineSequence --
* Creates a new sequence relation
*/
void
-DefineSequence(CreateSeqStmt * seq)
+DefineSequence(CreateSeqStmt *seq)
{
FormData_pg_sequence new;
CreateStmt *stmt = makeNode(CreateStmt);
static void
-init_params(CreateSeqStmt * seq, SequenceTupleForm new)
+init_params(CreateSeqStmt *seq, SequenceTupleForm new)
{
DefElem *last_value = NULL;
DefElem *increment_by = NULL;
static int
-get_param(DefElem * def)
+get_param(DefElem *def)
{
if (def->arg == (Node *) NULL)
elog(WARN, "DefineSequence: \"%s\" value unspecified", def->defname);
void RelationBuildTriggers(Relation relation);
void FreeTriggerDesc(Relation relation);
-static void DescribeTrigger(TriggerDesc * trigdesc, Trigger * trigger);
+static void DescribeTrigger(TriggerDesc *trigdesc, Trigger *trigger);
-extern void fmgr_info(Oid procedureId, func_ptr * function, int *nargs);
+extern void fmgr_info(Oid procedureId, func_ptr *function, int *nargs);
extern GlobalMemory CacheCxt;
void
-CreateTrigger(CreateTrigStmt * stmt)
+CreateTrigger(CreateTrigStmt *stmt)
{
int16 tgtype;
int16 tgattr[8] = {0};
}
void
-DropTrigger(DropTrigStmt * stmt)
+DropTrigger(DropTrigStmt *stmt)
{
Relation rel;
Relation tgrel;
}
static void
-DescribeTrigger(TriggerDesc * trigdesc, Trigger * trigger)
+DescribeTrigger(TriggerDesc *trigdesc, Trigger *trigger)
{
uint16 *n;
Trigger ***t,
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.45 1997/09/08 20:55:34 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.46 1997/09/08 21:42:48 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* non-export function prototypes */
static void vc_init(void);
static void vc_shutdown(void);
-static void vc_vacuum(NameData * VacRelP, bool analyze, List * va_cols);
-static VRelList vc_getrels(NameData * VacRelP);
-static void vc_vacone(Oid relid, bool analyze, List * va_cols);
-static void vc_scanheap(VRelStats * vacrelstats, Relation onerel, VPageList Vvpl, VPageList Fvpl);
-static void vc_rpfheap(VRelStats * vacrelstats, Relation onerel, VPageList Vvpl, VPageList Fvpl, int nindices, Relation * Irel);
-static void vc_vacheap(VRelStats * vacrelstats, Relation onerel, VPageList vpl);
+static void vc_vacuum(NameData *VacRelP, bool analyze, List *va_cols);
+static VRelList vc_getrels(NameData *VacRelP);
+static void vc_vacone(Oid relid, bool analyze, List *va_cols);
+static void vc_scanheap(VRelStats *vacrelstats, Relation onerel, VPageList Vvpl, VPageList Fvpl);
+static void vc_rpfheap(VRelStats *vacrelstats, Relation onerel, VPageList Vvpl, VPageList Fvpl, int nindices, Relation *Irel);
+static void vc_vacheap(VRelStats *vacrelstats, Relation onerel, VPageList vpl);
static void vc_vacpage(Page page, VPageDescr vpd, Relation archrel);
static void vc_vaconeind(VPageList vpl, Relation indrel, int nhtups);
static void vc_scanoneind(Relation indrel, int nhtups);
-static void vc_attrstats(Relation onerel, VRelStats * vacrelstats, HeapTuple htup);
-static void vc_bucketcpy(AttributeTupleForm attr, Datum value, Datum * bucket, int16 * bucket_len);
-static void vc_updstats(Oid relid, int npages, int ntups, bool hasindex, VRelStats * vacrelstats);
+static void vc_attrstats(Relation onerel, VRelStats *vacrelstats, HeapTuple htup);
+static void vc_bucketcpy(AttributeTupleForm attr, Datum value, Datum *bucket, int16 *bucket_len);
+static void vc_updstats(Oid relid, int npages, int ntups, bool hasindex, VRelStats *vacrelstats);
static void vc_delhilowstats(Oid relid, int attcnt, int *attnums);
static void vc_setpagelock(Relation rel, BlockNumber blkno);
static VPageDescr vc_tidreapped(ItemPointer itemptr, VPageList vpl);
static void vc_reappage(VPageList vpl, VPageDescr vpc);
static void vc_vpinsert(VPageList vpl, VPageDescr vpnew);
static void vc_free(VRelList vrl);
-static void vc_getindices(Oid relid, int *nindices, Relation ** Irel);
-static void vc_clsindices(int nindices, Relation * Irel);
+static void vc_getindices(Oid relid, int *nindices, Relation **Irel);
+static void vc_clsindices(int nindices, Relation *Irel);
static Relation vc_getarchrel(Relation heaprel);
static void vc_archive(Relation archrel, HeapTuple htup);
static bool vc_isarchrel(char *rname);
-static void vc_mkindesc(Relation onerel, int nindices, Relation * Irel, IndDesc ** Idesc);
+static void vc_mkindesc(Relation onerel, int nindices, Relation *Irel, IndDesc **Idesc);
static char *vc_find_eq(char *bot, int nelem, int size, char *elm, int (*compar) (char *, char *));
static int vc_cmp_blk(char *left, char *right);
static int vc_cmp_offno(char *left, char *right);
static bool vc_enough_space(VPageDescr vpd, Size len);
void
-vacuum(char *vacrel, bool verbose, bool analyze, List * va_spec)
+vacuum(char *vacrel, bool verbose, bool analyze, List *va_spec)
{
char *pname;
MemoryContext old;
* locks at one time.
*/
static void
-vc_vacuum(NameData * VacRelP, bool analyze, List * va_cols)
+vc_vacuum(NameData *VacRelP, bool analyze, List *va_cols)
{
VRelList vrl,
cur;
}
static VRelList
-vc_getrels(NameData * VacRelP)
+vc_getrels(NameData *VacRelP)
{
Relation pgclass;
TupleDesc pgcdesc;
* us to lock the entire database during one pass of the vacuum cleaner.
*/
static void
-vc_vacone(Oid relid, bool analyze, List * va_cols)
+vc_vacone(Oid relid, bool analyze, List *va_cols)
{
Relation pgclass;
TupleDesc pgcdesc;
* on the number of live tuples in a heap.
*/
static void
-vc_scanheap(VRelStats * vacrelstats, Relation onerel,
+vc_scanheap(VRelStats *vacrelstats, Relation onerel,
VPageList Vvpl, VPageList Fvpl)
{
int nblocks,
* if some end-blocks are gone away.
*/
static void
-vc_rpfheap(VRelStats * vacrelstats, Relation onerel,
- VPageList Vvpl, VPageList Fvpl, int nindices, Relation * Irel)
+vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
+ VPageList Vvpl, VPageList Fvpl, int nindices, Relation *Irel)
{
TransactionId myXID;
CommandId myCID;
* if there are "empty" end-blocks.
*/
static void
-vc_vacheap(VRelStats * vacrelstats, Relation onerel, VPageList Vvpl)
+vc_vacheap(VRelStats *vacrelstats, Relation onerel, VPageList Vvpl)
{
Buffer buf;
Page page;
*
*/
static void
-vc_attrstats(Relation onerel, VRelStats * vacrelstats, HeapTuple htup)
+vc_attrstats(Relation onerel, VRelStats *vacrelstats, HeapTuple htup)
{
int i,
attr_cnt = vacrelstats->va_natts;
*
*/
static void
-vc_bucketcpy(AttributeTupleForm attr, Datum value, Datum * bucket, int16 * bucket_len)
+vc_bucketcpy(AttributeTupleForm attr, Datum value, Datum *bucket, int16 *bucket_len)
{
if (attr->attbyval && attr->attlen != -1)
*bucket = value;
* historical queries very expensive.
*/
static void
-vc_updstats(Oid relid, int npages, int ntups, bool hasindex, VRelStats * vacrelstats)
+vc_updstats(Oid relid, int npages, int ntups, bool hasindex, VRelStats *vacrelstats)
{
Relation rd,
ad,
static void
-vc_getindices(Oid relid, int *nindices, Relation ** Irel)
+vc_getindices(Oid relid, int *nindices, Relation **Irel)
{
Relation pgindex;
Relation irel;
static void
-vc_clsindices(int nindices, Relation * Irel)
+vc_clsindices(int nindices, Relation *Irel)
{
if (Irel == (Relation *) NULL)
static void
-vc_mkindesc(Relation onerel, int nindices, Relation * Irel, IndDesc ** Idesc)
+vc_mkindesc(Relation onerel, int nindices, Relation *Irel, IndDesc **Idesc)
{
IndDesc *idcur;
HeapTuple pgIndexTup;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.10 1997/09/08 02:22:20 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.11 1997/09/08 21:42:50 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*---------------------------------------------------------------------
*/
static void
-DefineVirtualRelation(char *relname, List * tlist)
+DefineVirtualRelation(char *relname, List *tlist)
{
CreateStmt createStmt;
List *attrList,
}
static RuleStmt *
-FormViewRetrieveRule(char *viewName, Query * viewParse)
+FormViewRetrieveRule(char *viewName, Query *viewParse)
{
RuleStmt *rule;
char *rname;
}
static void
-DefineViewRules(char *viewName, Query * viewParse)
+DefineViewRules(char *viewName, Query *viewParse)
{
RuleStmt *retrieve_rule = NULL;
*---------------------------------------------------------------
*/
static void
-UpdateRangeTableOfViewParse(char *viewName, Query * viewParse)
+UpdateRangeTableOfViewParse(char *viewName, Query *viewParse)
{
List *old_rt;
List *new_rt;
*-------------------------------------------------------------------
*/
void
-DefineView(char *viewName, Query * viewParse)
+DefineView(char *viewName, Query *viewParse)
{
List *viewTlist;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.7 1997/09/08 02:22:23 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.8 1997/09/08 21:42:52 momjian Exp $
*
*-------------------------------------------------------------------------
*/
bool isindex,
ScanDirection dir,
TimeQual timeRange,
- Relation * returnRelation, /* return */
- Pointer * returnScanDesc) /* return */
+ Relation *returnRelation, /* return */
+ Pointer *returnScanDesc) /* return */
{
Relation relation;
Pointer scanDesc;
* ----------------------------------------------------------------
*/
void
-ExecCloseR(Plan * node)
+ExecCloseR(Plan *node)
{
CommonScanState *state;
Relation relation;
* ----------------------------------------------------------------
*/
void
-ExecReScan(Plan * node, ExprContext * exprCtxt, Plan * parent)
+ExecReScan(Plan *node, ExprContext *exprCtxt, Plan *parent)
{
switch (nodeTag(node))
{
* ----------------------------------------------------------------
*/
HeapScanDesc
-ExecReScanR(Relation relDesc, /* LLL relDesc unused */
+ExecReScanR(Relation relDesc, /* LLL relDesc unused */
HeapScanDesc scanDesc,
ScanDirection direction,
int nkeys, /* LLL nkeys unused */
* ----------------------------------------------------------------
*/
void
-ExecMarkPos(Plan * node)
+ExecMarkPos(Plan *node)
{
switch (nodeTag(node))
{
* ----------------------------------------------------------------
*/
void
-ExecRestrPos(Plan * node)
+ExecRestrPos(Plan *node)
{
switch (nodeTag(node))
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/Attic/execFlatten.c,v 1.4 1997/09/08 02:22:25 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/Attic/execFlatten.c,v 1.5 1997/09/08 21:42:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifdef SETS_FIXED
static bool
-FjoinBumpOuterNodes(TargetEntry * tlist, ExprContext * econtext,
+FjoinBumpOuterNodes(TargetEntry *tlist, ExprContext *econtext,
DatumPtr results, char *nulls);
#endif
Datum
-ExecEvalIter(Iter * iterNode,
- ExprContext * econtext,
- bool * resultIsNull,
- bool * iterIsDone)
+ExecEvalIter(Iter *iterNode,
+ ExprContext *econtext,
+ bool *resultIsNull,
+ bool *iterIsDone)
{
Node *expression;
}
void
-ExecEvalFjoin(TargetEntry * tlist,
- ExprContext * econtext,
- bool * isNullVect,
- bool * fj_isDone)
+ExecEvalFjoin(TargetEntry *tlist,
+ ExprContext *econtext,
+ bool *isNullVect,
+ bool *fj_isDone)
{
#ifdef SETS_FIXED
#ifdef SETS_FIXED
static bool
-FjoinBumpOuterNodes(TargetEntry * tlist,
- ExprContext * econtext,
+FjoinBumpOuterNodes(TargetEntry *tlist,
+ ExprContext *econtext,
DatumPtr results,
char *nulls)
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.7 1997/09/08 02:22:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.8 1997/09/08 21:42:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*-------------------------------------------------------------------------
*/
JunkFilter *
-ExecInitJunkFilter(List * targetList)
+ExecInitJunkFilter(List *targetList)
{
JunkFilter *junkfilter;
List *cleanTargetList;
*-------------------------------------------------------------------------
*/
bool
-ExecGetJunkAttribute(JunkFilter * junkfilter,
- TupleTableSlot * slot,
+ExecGetJunkAttribute(JunkFilter *junkfilter,
+ TupleTableSlot *slot,
char *attrName,
- Datum * value,
- bool * isNull)
+ Datum *value,
+ bool *isNull)
{
List *targetList;
List *t;
*-------------------------------------------------------------------------
*/
HeapTuple
-ExecRemoveJunk(JunkFilter * junkfilter, TupleTableSlot * slot)
+ExecRemoveJunk(JunkFilter *junkfilter, TupleTableSlot *slot)
{
HeapTuple tuple;
HeapTuple cleanTuple;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.24 1997/09/08 02:22:28 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.25 1997/09/08 21:42:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* decls for local routines only used within this module */
static void
-ExecCheckPerms(CmdType operation, int resultRelation, List * rangeTable,
- Query * parseTree);
+ExecCheckPerms(CmdType operation, int resultRelation, List *rangeTable,
+ Query *parseTree);
static TupleDesc
-InitPlan(CmdType operation, Query * parseTree,
- Plan * plan, EState * estate);
-static void EndPlan(Plan * plan, EState * estate);
+InitPlan(CmdType operation, Query *parseTree,
+ Plan *plan, EState *estate);
+static void EndPlan(Plan *plan, EState *estate);
static TupleTableSlot *
-ExecutePlan(EState * estate, Plan * plan,
- Query * parseTree, CmdType operation,
+ExecutePlan(EState *estate, Plan *plan,
+ Query *parseTree, CmdType operation,
int numberTuples, ScanDirection direction,
void (*printfunc) ());
-static void ExecRetrieve(TupleTableSlot * slot, void (*printfunc) (),
- EState * estate);
+static void ExecRetrieve(TupleTableSlot *slot, void (*printfunc) (),
+ EState *estate);
static void
-ExecAppend(TupleTableSlot * slot, ItemPointer tupleid,
- EState * estate);
+ExecAppend(TupleTableSlot *slot, ItemPointer tupleid,
+ EState *estate);
static void
-ExecDelete(TupleTableSlot * slot, ItemPointer tupleid,
- EState * estate);
+ExecDelete(TupleTableSlot *slot, ItemPointer tupleid,
+ EState *estate);
static void
-ExecReplace(TupleTableSlot * slot, ItemPointer tupleid,
- EState * estate, Query * parseTree);
+ExecReplace(TupleTableSlot *slot, ItemPointer tupleid,
+ EState *estate, Query *parseTree);
/* end of local decls */
* ----------------------------------------------------------------
*/
TupleDesc
-ExecutorStart(QueryDesc * queryDesc, EState * estate)
+ExecutorStart(QueryDesc *queryDesc, EState *estate)
{
TupleDesc result;
* ----------------------------------------------------------------
*/
TupleTableSlot *
-ExecutorRun(QueryDesc * queryDesc, EState * estate, int feature, int count)
+ExecutorRun(QueryDesc *queryDesc, EState *estate, int feature, int count)
{
CmdType operation;
Query *parseTree;
* ----------------------------------------------------------------
*/
void
-ExecutorEnd(QueryDesc * queryDesc, EState * estate)
+ExecutorEnd(QueryDesc *queryDesc, EState *estate)
{
/* sanity checks */
Assert(queryDesc != NULL);
static void
ExecCheckPerms(CmdType operation,
int resultRelation,
- List * rangeTable,
- Query * parseTree)
+ List *rangeTable,
+ Query *parseTree)
{
int i = 1;
Oid relid;
* ----------------------------------------------------------------
*/
static TupleDesc
-InitPlan(CmdType operation, Query * parseTree, Plan * plan, EState * estate)
+InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate)
{
List *rangeTable;
int resultRelation;
* ----------------------------------------------------------------
*/
static void
-EndPlan(Plan * plan, EState * estate)
+EndPlan(Plan *plan, EState *estate)
{
RelationInfo *resultRelationInfo;
Relation intoRelationDesc;
user can see it*/
static TupleTableSlot *
-ExecutePlan(EState * estate,
- Plan * plan,
- Query * parseTree,
+ExecutePlan(EState *estate,
+ Plan *plan,
+ Query *parseTree,
CmdType operation,
int numberTuples,
ScanDirection direction,
* ----------------------------------------------------------------
*/
static void
-ExecRetrieve(TupleTableSlot * slot,
+ExecRetrieve(TupleTableSlot *slot,
void (*printfunc) (),
- EState * estate)
+ EState *estate)
{
HeapTuple tuple;
TupleDesc attrtype;
*/
static void
-ExecAppend(TupleTableSlot * slot,
+ExecAppend(TupleTableSlot *slot,
ItemPointer tupleid,
- EState * estate)
+ EState *estate)
{
HeapTuple tuple;
RelationInfo *resultRelationInfo;
* ----------------------------------------------------------------
*/
static void
-ExecDelete(TupleTableSlot * slot,
+ExecDelete(TupleTableSlot *slot,
ItemPointer tupleid,
- EState * estate)
+ EState *estate)
{
RelationInfo *resultRelationInfo;
Relation resultRelationDesc;
* ----------------------------------------------------------------
*/
static void
-ExecReplace(TupleTableSlot * slot,
+ExecReplace(TupleTableSlot *slot,
ItemPointer tupleid,
- EState * estate,
- Query * parseTree)
+ EState *estate,
+ Query *parseTree)
{
HeapTuple tuple;
RelationInfo *resultRelationInfo;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execProcnode.c,v 1.4 1997/09/08 02:22:30 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execProcnode.c,v 1.5 1997/09/08 21:42:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* ------------------------------------------------------------------------
*/
bool
-ExecInitNode(Plan * node, EState * estate, Plan * parent)
+ExecInitNode(Plan *node, EState *estate, Plan *parent)
{
bool result;
* ----------------------------------------------------------------
*/
TupleTableSlot *
-ExecProcNode(Plan * node, Plan * parent)
+ExecProcNode(Plan *node, Plan *parent)
{
TupleTableSlot *result;
}
int
-ExecCountSlotsNode(Plan * node)
+ExecCountSlotsNode(Plan *node)
{
if (node == (Plan *) NULL)
return 0;
* ----------------------------------------------------------------
*/
void
-ExecEndNode(Plan * node, Plan * parent)
+ExecEndNode(Plan *node, Plan *parent)
{
/* ----------------
* do nothing when we get to the end
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.15 1997/09/08 20:55:37 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.16 1997/09/08 21:43:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/
int execConstLen;
/* static functions decls */
-static Datum ExecEvalAggreg(Aggreg *agg, ExprContext * econtext, bool * isNull);
+static Datum ExecEvalAggreg(Aggreg *agg, ExprContext *econtext, bool *isNull);
static Datum
-ExecEvalArrayRef(ArrayRef *arrayRef, ExprContext * econtext,
- bool * isNull, bool * isDone);
-static Datum ExecEvalAnd(Expr * andExpr, ExprContext * econtext, bool * isNull);
+ExecEvalArrayRef(ArrayRef *arrayRef, ExprContext *econtext,
+ bool *isNull, bool *isDone);
+static Datum ExecEvalAnd(Expr *andExpr, ExprContext *econtext, bool *isNull);
static Datum
-ExecEvalFunc(Expr * funcClause, ExprContext * econtext,
- bool * isNull, bool * isDone);
+ExecEvalFunc(Expr *funcClause, ExprContext *econtext,
+ bool *isNull, bool *isDone);
static void
-ExecEvalFuncArgs(FunctionCachePtr fcache, ExprContext * econtext,
- List * argList, Datum argV[], bool * argIsDone);
-static Datum ExecEvalNot(Expr * notclause, ExprContext * econtext, bool * isNull);
+ExecEvalFuncArgs(FunctionCachePtr fcache, ExprContext *econtext,
+ List *argList, Datum argV[], bool *argIsDone);
+static Datum ExecEvalNot(Expr *notclause, ExprContext *econtext, bool *isNull);
static Datum
-ExecEvalOper(Expr * opClause, ExprContext * econtext,
- bool * isNull);
-static Datum ExecEvalOr(Expr * orExpr, ExprContext * econtext, bool * isNull);
-static Datum ExecEvalVar(Var * variable, ExprContext * econtext, bool * isNull);
+ExecEvalOper(Expr *opClause, ExprContext *econtext,
+ bool *isNull);
+static Datum ExecEvalOr(Expr *orExpr, ExprContext *econtext, bool *isNull);
+static Datum ExecEvalVar(Var *variable, ExprContext *econtext, bool *isNull);
static Datum
-ExecMakeFunctionResult(Node * node, List * arguments,
- ExprContext * econtext, bool * isNull, bool * isDone);
-static bool ExecQualClause(Node * clause, ExprContext * econtext);
+ExecMakeFunctionResult(Node *node, List *arguments,
+ ExprContext *econtext, bool *isNull, bool *isDone);
+static bool ExecQualClause(Node *clause, ExprContext *econtext);
/* --------------------------------
* ExecEvalArrayRef
*/
static Datum
ExecEvalArrayRef(ArrayRef *arrayRef,
- ExprContext * econtext,
- bool * isNull,
- bool * isDone)
+ ExprContext *econtext,
+ bool *isNull,
+ bool *isDone)
{
bool dummy;
int i = 0,
* ----------------------------------------------------------------
*/
static Datum
-ExecEvalAggreg(Aggreg *agg, ExprContext * econtext, bool * isNull)
+ExecEvalAggreg(Aggreg *agg, ExprContext *econtext, bool *isNull)
{
*isNull = econtext->ecxt_nulls[agg->aggno];
*
* ---------------------------------------------------------------- */
static Datum
-ExecEvalVar(Var * variable, ExprContext * econtext, bool * isNull)
+ExecEvalVar(Var *variable, ExprContext *econtext, bool *isNull)
{
Datum result;
TupleTableSlot *slot;
* ----------------------------------------------------------------
*/
Datum
-ExecEvalParam(Param * expression, ExprContext * econtext, bool * isNull)
+ExecEvalParam(Param *expression, ExprContext *econtext, bool *isNull)
{
char *thisParameterName;
*/
#ifdef NOT_USED
static char *
-GetAttributeByNum(TupleTableSlot * slot,
+GetAttributeByNum(TupleTableSlot *slot,
AttrNumber attrno,
- bool * isNull)
+ bool *isNull)
{
Datum retval;
/* XXX char16 name for catalogs */
#ifdef NOT_USED
char *
-att_by_num(TupleTableSlot * slot,
+att_by_num(TupleTableSlot *slot,
AttrNumber attrno,
- bool * isNull)
+ bool *isNull)
{
return (GetAttributeByNum(slot, attrno, isNull));
}
#endif
char *
-GetAttributeByName(TupleTableSlot * slot, char *attname, bool * isNull)
+GetAttributeByName(TupleTableSlot *slot, char *attname, bool *isNull)
{
AttrNumber attrno;
TupleDesc tupdesc;
/* XXX char16 name for catalogs */
#ifdef NOT_USED
char *
-att_by_name(TupleTableSlot * slot, char *attname, bool * isNull)
+att_by_name(TupleTableSlot *slot, char *attname, bool *isNull)
{
return (GetAttributeByName(slot, attname, isNull));
}
static void
ExecEvalFuncArgs(FunctionCachePtr fcache,
- ExprContext * econtext,
- List * argList,
+ ExprContext *econtext,
+ List *argList,
Datum argV[],
- bool * argIsDone)
+ bool *argIsDone)
{
int i;
bool argIsNull,
* ----------------
*/
static Datum
-ExecMakeFunctionResult(Node * node,
- List * arguments,
- ExprContext * econtext,
- bool * isNull,
- bool * isDone)
+ExecMakeFunctionResult(Node *node,
+ List *arguments,
+ ExprContext *econtext,
+ bool *isNull,
+ bool *isDone)
{
Datum argv[MAXFMGRARGS];
FunctionCachePtr fcache;
* ----------------------------------------------------------------
*/
static Datum
-ExecEvalOper(Expr * opClause, ExprContext * econtext, bool * isNull)
+ExecEvalOper(Expr *opClause, ExprContext *econtext, bool *isNull)
{
Oper *op;
List *argList;
*/
static Datum
-ExecEvalFunc(Expr * funcClause,
- ExprContext * econtext,
- bool * isNull,
- bool * isDone)
+ExecEvalFunc(Expr *funcClause,
+ ExprContext *econtext,
+ bool *isNull,
+ bool *isDone)
{
Func *func;
List *argList;
* ----------------------------------------------------------------
*/
static Datum
-ExecEvalNot(Expr * notclause, ExprContext * econtext, bool * isNull)
+ExecEvalNot(Expr *notclause, ExprContext *econtext, bool *isNull)
{
Datum expr_value;
Node *clause;
* ----------------------------------------------------------------
*/
static Datum
-ExecEvalOr(Expr * orExpr, ExprContext * econtext, bool * isNull)
+ExecEvalOr(Expr *orExpr, ExprContext *econtext, bool *isNull)
{
List *clauses;
List *clause;
* ----------------------------------------------------------------
*/
static Datum
-ExecEvalAnd(Expr * andExpr, ExprContext * econtext, bool * isNull)
+ExecEvalAnd(Expr *andExpr, ExprContext *econtext, bool *isNull)
{
List *clauses;
List *clause;
* ----------------------------------------------------------------
*/
Datum
-ExecEvalExpr(Node * expression,
- ExprContext * econtext,
- bool * isNull,
- bool * isDone)
+ExecEvalExpr(Node *expression,
+ ExprContext *econtext,
+ bool *isNull,
+ bool *isDone)
{
Datum retDatum = 0;
* ----------------------------------------------------------------
*/
static bool
-ExecQualClause(Node * clause, ExprContext * econtext)
+ExecQualClause(Node *clause, ExprContext *econtext)
{
Datum expr_value;
bool isNull;
* ----------------------------------------------------------------
*/
bool
-ExecQual(List * qual, ExprContext * econtext)
+ExecQual(List *qual, ExprContext *econtext)
{
List *clause;
bool result;
}
int
-ExecTargetListLength(List * targetlist)
+ExecTargetListLength(List *targetlist)
{
int len;
List *tl;
* ----------------------------------------------------------------
*/
static HeapTuple
-ExecTargetList(List * targetlist,
+ExecTargetList(List *targetlist,
int nodomains,
TupleDesc targettype,
- Datum * values,
- ExprContext * econtext,
- bool * isDone)
+ Datum *values,
+ ExprContext *econtext,
+ bool *isDone)
{
char nulls_array[64];
bool fjNullArray[64];
* ----------------------------------------------------------------
*/
TupleTableSlot *
-ExecProject(ProjectionInfo * projInfo, bool * isDone)
+ExecProject(ProjectionInfo *projInfo, bool *isDone)
{
TupleTableSlot *slot;
List *targetlist;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execScan.c,v 1.5 1997/09/08 02:22:34 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execScan.c,v 1.6 1997/09/08 21:43:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* ----------------------------------------------------------------
*/
TupleTableSlot *
-ExecScan(Scan * node,
- TupleTableSlot * (*accessMtd) ()) /* function returning a
+ExecScan(Scan *node,
+ TupleTableSlot *(*accessMtd) ()) /* function returning a
* tuple */
{
CommonScanState *scanstate;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.8 1997/09/08 02:22:35 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.9 1997/09/08 21:43:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "parser/catalog_utils.h"
#include "catalog/pg_type.h"
-static TupleTableSlot *NodeGetResultTupleSlot(Plan * node);
+static TupleTableSlot *NodeGetResultTupleSlot(Plan *node);
/* ----------------------------------------------------------------
* --------------------------------
*/
TupleTable /* return: address of table */
-ExecCreateTupleTable(int initialSize) /* initial number of slots
- * in table */
+ExecCreateTupleTable(int initialSize) /* initial number of slots in
+ * table */
{
TupleTable newtable; /* newly allocated table */
TupleTableSlot *array; /* newly allocated slot array */
*/
TupleTableSlot * /* return: slot passed */
ExecStoreTuple(HeapTuple tuple, /* tuple to store */
- TupleTableSlot * slot, /* slot in which to store tuple */
+ TupleTableSlot *slot, /* slot in which to store tuple */
Buffer buffer, /* buffer associated with tuple */
bool shouldFree) /* true if we call pfree() when we gc. */
{
* --------------------------------
*/
TupleTableSlot * /* return: slot passed */
-ExecClearTuple(TupleTableSlot * slot) /* slot in which to store tuple */
+ExecClearTuple(TupleTableSlot *slot) /* slot in which to store tuple */
{
HeapTuple oldtuple; /* prior contents of slot */
*/
#ifdef NOT_USED
bool /* return: slot policy */
-ExecSlotPolicy(TupleTableSlot * slot) /* slot to inspect */
+ExecSlotPolicy(TupleTableSlot *slot) /* slot to inspect */
{
return slot->ttc_shouldFree;
}
* --------------------------------
*/
bool /* return: old slot policy */
-ExecSetSlotPolicy(TupleTableSlot * slot, /* slot to change */
+ExecSetSlotPolicy(TupleTableSlot *slot, /* slot to change */
bool shouldFree) /* true if we call pfree() when we
* gc. */
{
* --------------------------------
*/
TupleDesc /* return: old slot tuple descriptor */
-ExecSetSlotDescriptor(TupleTableSlot * slot, /* slot to change */
+ExecSetSlotDescriptor(TupleTableSlot *slot, /* slot to change */
TupleDesc tupdesc) /* tuple descriptor */
{
TupleDesc old_tupdesc = slot->ttc_tupleDescriptor;
* --------------------------------
*/
void
-ExecSetSlotDescriptorIsNew(TupleTableSlot * slot, /* slot to change */
+ExecSetSlotDescriptorIsNew(TupleTableSlot *slot, /* slot to change */
bool isNew) /* "isNew" setting */
{
slot->ttc_descIsNew = isNew;
*/
#ifdef NOT_USED
TupleDesc /* return: old slot tuple descriptor */
-ExecSetNewSlotDescriptor(TupleTableSlot * slot, /* slot to change */
+ExecSetNewSlotDescriptor(TupleTableSlot *slot, /* slot to change */
TupleDesc tupdesc) /* tuple descriptor */
{
TupleDesc old_tupdesc = slot->ttc_tupleDescriptor;
*/
#ifdef NOT_USED
Buffer /* return: old slot buffer */
-ExecSetSlotBuffer(TupleTableSlot * slot, /* slot to change */
+ExecSetSlotBuffer(TupleTableSlot *slot, /* slot to change */
Buffer b) /* tuple descriptor */
{
Buffer oldb = slot->ttc_buffer;
* --------------------------------
*/
void
-ExecIncrSlotBufferRefcnt(TupleTableSlot * slot) /* slot to bump refcnt */
+ExecIncrSlotBufferRefcnt(TupleTableSlot *slot) /* slot to bump refcnt */
{
/* Buffer b = SlotBuffer((TupleTableSlot*) slot); */
Buffer b = slot->ttc_buffer;
* ----------------
*/
bool /* return: true if tuple in slot is NULL */
-TupIsNull(TupleTableSlot * slot) /* slot to check */
+TupIsNull(TupleTableSlot *slot) /* slot to check */
{
HeapTuple tuple; /* contents of slot (returned) */
*/
#ifdef NOT_USED
bool /* return: descriptor "is new" */
-ExecSlotDescriptorIsNew(TupleTableSlot * slot) /* slot to inspect */
+ExecSlotDescriptorIsNew(TupleTableSlot *slot) /* slot to inspect */
{
/* bool isNew = SlotTupleDescriptorIsNew((TupleTableSlot*) slot);
return isNew; */
* ----------------
*/
void
-ExecInitResultTupleSlot(EState * estate, CommonState * commonstate)
+ExecInitResultTupleSlot(EState *estate, CommonState *commonstate)
{
INIT_SLOT_DEFS;
INIT_SLOT_ALLOC;
* ----------------
*/
void
-ExecInitScanTupleSlot(EState * estate, CommonScanState * commonscanstate)
+ExecInitScanTupleSlot(EState *estate, CommonScanState *commonscanstate)
{
INIT_SLOT_DEFS;
INIT_SLOT_ALLOC;
* ----------------
*/
void
-ExecInitMarkedTupleSlot(EState * estate, MergeJoinState * mergestate)
+ExecInitMarkedTupleSlot(EState *estate, MergeJoinState *mergestate)
{
INIT_SLOT_DEFS;
INIT_SLOT_ALLOC;
* ----------------
*/
void
-ExecInitOuterTupleSlot(EState * estate, HashJoinState * hashstate)
+ExecInitOuterTupleSlot(EState *estate, HashJoinState *hashstate)
{
INIT_SLOT_DEFS;
INIT_SLOT_ALLOC;
*/
#ifdef NOT_USED
void
-ExecInitHashTupleSlot(EState * estate, HashJoinState * hashstate)
+ExecInitHashTupleSlot(EState *estate, HashJoinState *hashstate)
{
INIT_SLOT_DEFS;
INIT_SLOT_ALLOC;
#endif
static TupleTableSlot *
-NodeGetResultTupleSlot(Plan * node)
+NodeGetResultTupleSlot(Plan *node)
{
TupleTableSlot *slot;
*/
TupleDesc
-ExecGetTupType(Plan * node)
+ExecGetTupType(Plan *node)
{
TupleTableSlot *slot;
TupleDesc tupType;
* ----------------------------------------------------------------
*/
TupleDesc
-ExecTypeFromTL(List * targetList)
+ExecTypeFromTL(List *targetList)
{
List *tlcdr;
TupleDesc typeInfo;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.17 1997/09/08 20:55:39 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.18 1997/09/08 21:43:05 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*/
#ifdef NOT_USED
void
-DisplayTupleCount(FILE * statfp)
+DisplayTupleCount(FILE *statfp)
{
if (NTupleProcessed > 0)
fprintf(statfp, "!\t%d tuple%s processed, ", NTupleProcessed,
* ----------------
*/
void
-ExecAssignNodeBaseInfo(EState * estate, CommonState * cstate, Plan * parent)
+ExecAssignNodeBaseInfo(EState *estate, CommonState *cstate, Plan *parent)
{
int baseId;
* ----------------
*/
void
-ExecAssignExprContext(EState * estate, CommonState * commonstate)
+ExecAssignExprContext(EState *estate, CommonState *commonstate)
{
ExprContext *econtext;
ParamListInfo paraminfo;
* ----------------
*/
void
-ExecAssignResultType(CommonState * commonstate,
+ExecAssignResultType(CommonState *commonstate,
TupleDesc tupDesc)
{
TupleTableSlot *slot;
* ----------------
*/
void
-ExecAssignResultTypeFromOuterPlan(Plan * node, CommonState * commonstate)
+ExecAssignResultTypeFromOuterPlan(Plan *node, CommonState *commonstate)
{
Plan *outerPlan;
TupleDesc tupDesc;
* ----------------
*/
void
-ExecAssignResultTypeFromTL(Plan * node, CommonState * commonstate)
+ExecAssignResultTypeFromTL(Plan *node, CommonState *commonstate)
{
List *targetList;
int i;
* ----------------
*/
TupleDesc
-ExecGetResultType(CommonState * commonstate)
+ExecGetResultType(CommonState *commonstate)
{
TupleTableSlot *slot = commonstate->cs_ResultTupleSlot;
*/
#ifdef NOT_USED
void
-ExecFreeResultType(CommonState * commonstate)
+ExecFreeResultType(CommonState *commonstate)
{
TupleTableSlot *slot;
TupleDesc tupType;
* ----------------
*/
void
-ExecAssignProjectionInfo(Plan * node, CommonState * commonstate)
+ExecAssignProjectionInfo(Plan *node, CommonState *commonstate)
{
ProjectionInfo *projInfo;
List *targetList;
* ----------------
*/
void
-ExecFreeProjectionInfo(CommonState * commonstate)
+ExecFreeProjectionInfo(CommonState *commonstate)
{
ProjectionInfo *projInfo;
* ----------------
*/
TupleDesc
-ExecGetScanType(CommonScanState * csstate)
+ExecGetScanType(CommonScanState *csstate)
{
TupleTableSlot *slot = csstate->css_ScanTupleSlot;
*/
#ifdef NOT_USED
void
-ExecFreeScanType(CommonScanState * csstate)
+ExecFreeScanType(CommonScanState *csstate)
{
TupleTableSlot *slot;
TupleDesc tupType;
* ----------------
*/
void
-ExecAssignScanType(CommonScanState * csstate,
+ExecAssignScanType(CommonScanState *csstate,
TupleDesc tupDesc)
{
TupleTableSlot *slot;
* ----------------
*/
void
-ExecAssignScanTypeFromOuterPlan(Plan * node, CommonScanState * csstate)
+ExecAssignScanTypeFromOuterPlan(Plan *node, CommonScanState *csstate)
{
Plan *outerPlan;
TupleDesc tupDesc;
* ----------------------------------------------------------------
*/
TupleDesc
-QueryDescGetTypeInfo(QueryDesc * queryDesc)
+QueryDescGetTypeInfo(QueryDesc *queryDesc)
{
Plan *plan;
TupleDesc tupleType;
*/
void
ExecOpenIndices(Oid resultRelationOid,
- RelationInfo * resultRelationInfo)
+ RelationInfo *resultRelationInfo)
{
Relation indexRd;
HeapScanDesc indexSd;
* ----------------------------------------------------------------
*/
void
-ExecCloseIndices(RelationInfo * resultRelationInfo)
+ExecCloseIndices(RelationInfo *resultRelationInfo)
{
int i;
int numIndices;
ExecFormIndexTuple(HeapTuple heapTuple,
Relation heapRelation,
Relation indexRelation,
- IndexInfo * indexInfo)
+ IndexInfo *indexInfo)
{
IndexTuple indexTuple;
TupleDesc heapDescriptor;
* ----------------------------------------------------------------
*/
void
-ExecInsertIndexTuples(TupleTableSlot * slot,
+ExecInsertIndexTuples(TupleTableSlot *slot,
ItemPointer tupleid,
- EState * estate,
+ EState *estate,
bool is_update)
{
HeapTuple heapTuple;
* ----------------------------------------------------------------
*/
void
-setVarAttrLenForCreateTable(TupleDesc tupType, List * targetList,
- List * rangeTable)
+setVarAttrLenForCreateTable(TupleDesc tupType, List *targetList,
+ List *rangeTable)
{
List *tl;
TargetEntry *tle;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.9 1997/09/08 02:22:37 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/functions.c,v 1.10 1997/09/08 21:43:08 momjian Exp $
*
*-------------------------------------------------------------------------
*/
typedef enum
{
F_EXEC_START, F_EXEC_RUN, F_EXEC_DONE
-} ExecStatus;
+} ExecStatus;
typedef struct local_es
{
EState *estate;
struct local_es *next;
ExecStatus status;
-} execution_state;
+} execution_state;
#define LAST_POSTQUEL_COMMAND(es) ((es)->next == (execution_state *)NULL)
/* non-export function prototypes */
-static TupleDesc postquel_start(execution_state * es);
+static TupleDesc postquel_start(execution_state *es);
static execution_state *
init_execution_state(FunctionCachePtr fcache,
char *args[]);
-static TupleTableSlot *postquel_getnext(execution_state * es);
-static void postquel_end(execution_state * es);
+static TupleTableSlot *postquel_getnext(execution_state *es);
+static void postquel_end(execution_state *es);
static void
-postquel_sub_params(execution_state * es, int nargs,
- char *args[], bool * nullV);
+postquel_sub_params(execution_state *es, int nargs,
+ char *args[], bool *nullV);
static Datum
-postquel_execute(execution_state * es, FunctionCachePtr fcache,
- List * fTlist, char **args, bool * isNull);
+postquel_execute(execution_state *es, FunctionCachePtr fcache,
+ List *fTlist, char **args, bool *isNull);
Datum
ProjectAttribute(TupleDesc TD,
- TargetEntry * tlist,
+ TargetEntry *tlist,
HeapTuple tup,
- bool * isnullP)
+ bool *isnullP)
{
Datum val,
valueP;
}
static TupleDesc
-postquel_start(execution_state * es)
+postquel_start(execution_state *es)
{
#ifdef FUNC_UTIL_PATCH
}
static TupleTableSlot *
-postquel_getnext(execution_state * es)
+postquel_getnext(execution_state *es)
{
int feature;
}
static void
-postquel_end(execution_state * es)
+postquel_end(execution_state *es)
{
#ifdef FUNC_UTIL_PATCH
}
static void
-postquel_sub_params(execution_state * es,
+postquel_sub_params(execution_state *es,
int nargs,
char *args[],
- bool * nullV)
+ bool *nullV)
{
ParamListInfo paramLI;
EState *estate;
static TupleTableSlot *
copy_function_result(FunctionCachePtr fcache,
- TupleTableSlot * resultSlot)
+ TupleTableSlot *resultSlot)
{
TupleTableSlot *funcSlot;
TupleDesc resultTd;
}
static Datum
-postquel_execute(execution_state * es,
+postquel_execute(execution_state *es,
FunctionCachePtr fcache,
- List * fTlist,
+ List *fTlist,
char **args,
- bool * isNull)
+ bool *isNull)
{
TupleTableSlot *slot;
Datum value;
}
Datum
-postquel_function(Func * funcNode, char **args, bool * isNull, bool * isDone)
+postquel_function(Func *funcNode, char **args, bool *isNull, bool *isDone)
{
execution_state *es;
Datum result = 0;
int finalfn_nargs;
} AggFuncInfo;
-static Datum aggGetAttr(TupleTableSlot * tuple, Aggreg *agg, bool * isNull);
+static Datum aggGetAttr(TupleTableSlot *tuple, Aggreg *agg, bool *isNull);
/* ---------------------------------------
value2[i] =
(Datum) fmgr_c(aggfns->xfn2, aggfns->xfn2_oid,
aggfns->xfn2_nargs,
- (FmgrValues *) & xfn2_val, &isNull2);
+ (FmgrValues *) &xfn2_val, &isNull2);
Assert(!isNull2);
}
}
* -----------------
*/
bool
-ExecInitAgg(Agg *node, EState * estate, Plan * parent)
+ExecInitAgg(Agg *node, EState *estate, Plan *parent)
{
AggState *aggstate;
Plan *outerPlan;
* over from the tuple
*/
static Datum
-aggGetAttr(TupleTableSlot * slot,
+aggGetAttr(TupleTableSlot *slot,
Aggreg *agg,
- bool * isNull)
+ bool *isNull)
{
Datum result;
AttrNumber attnum;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.8 1997/09/08 20:55:41 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.9 1997/09/08 21:43:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* ----------------------------------------------------------------
*/
bool
-ExecInitAppend(Append *node, EState * estate, Plan * parent)
+ExecInitAppend(Append *node, EState *estate, Plan *parent)
{
AppendState *unionstate;
int nplans;
* columns. (ie. tuples from the same group are consecutive)
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.8 1997/09/08 20:55:43 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.9 1997/09/08 21:43:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "executor/executor.h"
#include "executor/nodeGroup.h"
-static TupleTableSlot *ExecGroupEveryTuple(Group * node);
-static TupleTableSlot *ExecGroupOneTuple(Group * node);
+static TupleTableSlot *ExecGroupEveryTuple(Group *node);
+static TupleTableSlot *ExecGroupOneTuple(Group *node);
static bool
-sameGroup(TupleTableSlot * oldslot, TupleTableSlot * newslot,
+sameGroup(TupleTableSlot *oldslot, TupleTableSlot *newslot,
int numCols, AttrNumber *grpColIdx, TupleDesc tupdesc);
/* ---------------------------------------
* ------------------------------------------
*/
TupleTableSlot *
-ExecGroup(Group * node)
+ExecGroup(Group *node)
{
if (node->tuplePerGroup)
return ExecGroupEveryTuple(node);
* return every tuple with a NULL between each group
*/
static TupleTableSlot *
-ExecGroupEveryTuple(Group * node)
+ExecGroupEveryTuple(Group *node)
{
GroupState *grpstate;
EState *estate;
* tuples.
*/
static TupleTableSlot *
-ExecGroupOneTuple(Group * node)
+ExecGroupOneTuple(Group *node)
{
GroupState *grpstate;
EState *estate;
* -----------------
*/
bool
-ExecInitGroup(Group * node, EState * estate, Plan * parent)
+ExecInitGroup(Group *node, EState *estate, Plan *parent)
{
GroupState *grpstate;
Plan *outerPlan;
}
int
-ExecCountSlotsGroup(Group * node)
+ExecCountSlotsGroup(Group *node)
{
return ExecCountSlotsNode(outerPlan(node)) + GROUP_NSLOTS;
}
* -----------------------
*/
void
-ExecEndGroup(Group * node)
+ExecEndGroup(Group *node)
{
GroupState *grpstate;
Plan *outerPlan;
* code swiped from nodeUnique.c
*/
static bool
-sameGroup(TupleTableSlot * oldslot,
- TupleTableSlot * newslot,
+sameGroup(TupleTableSlot *oldslot,
+ TupleTableSlot *newslot,
int numCols,
AttrNumber *grpColIdx,
TupleDesc tupdesc)
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeHash.c,v 1.12 1997/09/08 02:22:42 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeHash.c,v 1.13 1997/09/08 21:43:11 momjian Exp $
*
*-------------------------------------------------------------------------
*/
static void mk_hj_temp(char *tempname);
static int hashFunc(char *key, int len);
-static int ExecHashPartition(Hash * node);
+static int ExecHashPartition(Hash *node);
static RelativeAddr hashTableAlloc(int size, HashJoinTable hashtable);
static void
ExecHashOverflowInsert(HashJoinTable hashtable,
* ----------------------------------------------------------------
*/
TupleTableSlot *
-ExecHash(Hash * node)
+ExecHash(Hash *node)
{
EState *estate;
HashState *hashstate;
* ----------------------------------------------------------------
*/
bool
-ExecInitHash(Hash * node, EState * estate, Plan * parent)
+ExecInitHash(Hash *node, EState *estate, Plan *parent)
{
HashState *hashstate;
Plan *outerPlan;
}
int
-ExecCountSlotsHash(Hash * node)
+ExecCountSlotsHash(Hash *node)
{
return ExecCountSlotsNode(outerPlan(node)) +
ExecCountSlotsNode(innerPlan(node)) +
* ----------------------------------------------------------------
*/
void
-ExecEndHash(Hash * node)
+ExecEndHash(Hash *node)
{
HashState *hashstate;
Plan *outerPlan;
#define FUDGE_FAC 1.5
HashJoinTable
-ExecHashTableCreate(Hash * node)
+ExecHashTableCreate(Hash *node)
{
Plan *outerNode;
int nbatch;
*/
void
ExecHashTableInsert(HashJoinTable hashtable,
- ExprContext * econtext,
- Var * hashkey,
- File * batches)
+ ExprContext *econtext,
+ Var *hashkey,
+ File *batches)
{
TupleTableSlot *slot;
HeapTuple heapTuple;
*/
int
ExecHashGetBucket(HashJoinTable hashtable,
- ExprContext * econtext,
- Var * hashkey)
+ ExprContext *econtext,
+ Var *hashkey)
{
int bucketno;
Datum keyval;
* ----------------------------------------------------------------
*/
HeapTuple
-ExecScanHashBucket(HashJoinState * hjstate,
+ExecScanHashBucket(HashJoinState *hjstate,
HashBucket bucket,
HeapTuple curtuple,
- List * hjclauses,
- ExprContext * econtext)
+ List *hjclauses,
+ ExprContext *econtext)
{
HeapTuple heapTuple;
bool qualResult;
* ----------------------------------------------------------------
*/
static int
-ExecHashPartition(Hash * node)
+ExecHashPartition(Hash *node)
{
Plan *outerNode;
int b;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.7 1997/09/08 02:22:43 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.8 1997/09/08 21:43:12 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "utils/palloc.h"
static TupleTableSlot *
- ExecHashJoinOuterGetTuple(Plan * node, Plan * parent, HashJoinState * hjstate);
+ ExecHashJoinOuterGetTuple(Plan *node, Plan *parent, HashJoinState *hjstate);
static TupleTableSlot *
-ExecHashJoinGetSavedTuple(HashJoinState * hjstate, char *buffer,
- File file, TupleTableSlot * tupleSlot, int *block, char **position);
+ExecHashJoinGetSavedTuple(HashJoinState *hjstate, char *buffer,
+ File file, TupleTableSlot *tupleSlot, int *block, char **position);
static int
ExecHashJoinGetBatch(int bucketno, HashJoinTable hashtable,
int nbatch);
-static int ExecHashJoinNewBatch(HashJoinState * hjstate);
+static int ExecHashJoinNewBatch(HashJoinState *hjstate);
* ----------------------------------------------------------------
*/
TupleTableSlot * /* return: a tuple or NULL */
-ExecHashJoin(HashJoin * node)
+ExecHashJoin(HashJoin *node)
{
HashJoinState *hjstate;
EState *estate;
* ----------------------------------------------------------------
*/
bool /* return: initialization status */
-ExecInitHashJoin(HashJoin * node, EState * estate, Plan * parent)
+ExecInitHashJoin(HashJoin *node, EState *estate, Plan *parent)
{
HashJoinState *hjstate;
Plan *outerNode;
}
int
-ExecCountSlotsHashJoin(HashJoin * node)
+ExecCountSlotsHashJoin(HashJoin *node)
{
return ExecCountSlotsNode(outerPlan(node)) +
ExecCountSlotsNode(innerPlan(node)) +
* ----------------------------------------------------------------
*/
void
-ExecEndHashJoin(HashJoin * node)
+ExecEndHashJoin(HashJoin *node)
{
HashJoinState *hjstate;
*/
static TupleTableSlot *
-ExecHashJoinOuterGetTuple(Plan * node, Plan * parent, HashJoinState * hjstate)
+ExecHashJoinOuterGetTuple(Plan *node, Plan *parent, HashJoinState *hjstate)
{
TupleTableSlot *slot;
HashJoinTable hashtable;
*/
static TupleTableSlot *
-ExecHashJoinGetSavedTuple(HashJoinState * hjstate,
+ExecHashJoinGetSavedTuple(HashJoinState *hjstate,
char *buffer,
File file,
- TupleTableSlot * tupleSlot,
+ TupleTableSlot *tupleSlot,
int *block, /* return parameter */
char **position) /* return parameter */
{
* ----------------------------------------------------------------
*/
static int
-ExecHashJoinNewBatch(HashJoinState * hjstate)
+ExecHashJoinNewBatch(HashJoinState *hjstate)
{
File *innerBatches;
File *outerBatches;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.9 1997/09/08 02:22:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.10 1997/09/08 21:43:13 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define LEFT_OP 1
#define RIGHT_OP 2
-static TupleTableSlot *IndexNext(IndexScan * node);
+static TupleTableSlot *IndexNext(IndexScan *node);
/* ----------------------------------------------------------------
* IndexNext
* ----------------------------------------------------------------
*/
static TupleTableSlot *
-IndexNext(IndexScan * node)
+IndexNext(IndexScan *node)
{
EState *estate;
CommonScanState *scanstate;
* ----------------------------------------------------------------
*/
TupleTableSlot *
-ExecIndexScan(IndexScan * node)
+ExecIndexScan(IndexScan *node)
{
TupleTableSlot *returnTuple;
* ----------------------------------------------------------------
*/
void
-ExecIndexReScan(IndexScan * node, ExprContext * exprCtxt, Plan * parent)
+ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent)
{
EState *estate;
IndexScanState *indexstate;
* ----------------------------------------------------------------
*/
void
-ExecEndIndexScan(IndexScan * node)
+ExecEndIndexScan(IndexScan *node)
{
CommonScanState *scanstate;
IndexScanState *indexstate;
* ----------------------------------------------------------------
*/
void
-ExecIndexMarkPos(IndexScan * node)
+ExecIndexMarkPos(IndexScan *node)
{
IndexScanState *indexstate;
IndexScanDescPtr indexScanDescs;
* ----------------------------------------------------------------
*/
void
-ExecIndexRestrPos(IndexScan * node)
+ExecIndexRestrPos(IndexScan *node)
{
IndexScanState *indexstate;
IndexScanDescPtr indexScanDescs;
* ----------------------------------------------------------------
*/
bool
-ExecInitIndexScan(IndexScan * node, EState * estate, Plan * parent)
+ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
{
IndexScanState *indexstate;
CommonScanState *scanstate;
*/
leftop = (Node *) get_leftop(clause);
- if (IsA(leftop, Var) && var_is_rel((Var *) leftop))
+ if (IsA(leftop, Var) &&var_is_rel((Var *) leftop))
{
/* ----------------
* if the leftop is a "rel-var", then it means
*/
rightop = (Node *) get_rightop(clause);
- if (IsA(rightop, Var) && var_is_rel((Var *) rightop))
+ if (IsA(rightop, Var) &&var_is_rel((Var *) rightop))
{
/* ----------------
* here we make sure only one op identifies the
direction, /* scan direction */
timeQual, /* time qual */
¤tRelation, /* return: rel desc */
- (Pointer *) & currentScanDesc); /* return: scan desc */
+ (Pointer *) ¤tScanDesc); /* return: scan desc */
scanstate->css_currentRelation = currentRelation;
scanstate->css_currentScanDesc = currentScanDesc;
direction, /* scan direction */
timeQual, /* time qual */
&(relationDescs[i]), /* return: rel desc */
- (Pointer *) & (scanDescs[i]));
+ (Pointer *) &(scanDescs[i]));
/* return: scan desc */
}
}
}
int
-ExecCountSlotsIndexScan(IndexScan * node)
+ExecCountSlotsIndexScan(IndexScan *node)
{
return ExecCountSlotsNode(outerPlan((Plan *) node)) +
ExecCountSlotsNode(innerPlan((Plan *) node)) +
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.8 1997/09/08 02:22:45 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeMaterial.c,v 1.9 1997/09/08 21:43:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* ----------------------------------------------------------------
*/
TupleTableSlot * /* result tuple from subplan */
-ExecMaterial(Material * node)
+ExecMaterial(Material *node)
{
EState *estate;
MaterialState *matstate;
* ----------------------------------------------------------------
*/
bool /* initialization status */
-ExecInitMaterial(Material * node, EState * estate, Plan * parent)
+ExecInitMaterial(Material *node, EState *estate, Plan *parent)
{
MaterialState *matstate;
Plan *outerPlan;
}
int
-ExecCountSlotsMaterial(Material * node)
+ExecCountSlotsMaterial(Material *node)
{
return ExecCountSlotsNode(outerPlan((Plan *) node)) +
ExecCountSlotsNode(innerPlan((Plan *) node)) +
* ----------------------------------------------------------------
*/
void
-ExecEndMaterial(Material * node)
+ExecEndMaterial(Material *node)
{
MaterialState *matstate;
Relation tempRelation;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.11 1997/09/08 20:55:45 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeMergejoin.c,v 1.12 1997/09/08 21:43:15 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "utils/lsyscache.h"
#include "utils/psort.h"
-static bool MergeCompare(List * eqQual, List * compareQual, ExprContext * econtext);
+static bool MergeCompare(List *eqQual, List *compareQual, ExprContext *econtext);
/* ----------------------------------------------------------------
* MarkInnerTuple and RestoreInnerTuple macros
* ----------------------------------------------------------------
*/
static List *
-MJFormOSortopI(List * qualList, Oid sortOp)
+MJFormOSortopI(List *qualList, Oid sortOp)
{
List *qualCopy;
List *qualcdr;
* ----------------------------------------------------------------
*/
static List *
-MJFormISortopO(List * qualList, Oid sortOp)
+MJFormISortopO(List *qualList, Oid sortOp)
{
List *ISortopO;
List *qualcdr;
* ----------------------------------------------------------------
*/
static bool
-MergeCompare(List * eqQual, List * compareQual, ExprContext * econtext)
+MergeCompare(List *eqQual, List *compareQual, ExprContext *econtext)
{
List *clause;
List *eqclause;
*/
#ifdef EXEC_MERGEJOINDEBUG
void
-ExecMergeTupleDumpInner(ExprContext * econtext)
+ExecMergeTupleDumpInner(ExprContext *econtext)
{
TupleTableSlot *innerSlot;
}
void
-ExecMergeTupleDumpOuter(ExprContext * econtext)
+ExecMergeTupleDumpOuter(ExprContext *econtext)
{
TupleTableSlot *outerSlot;
}
void
-ExecMergeTupleDumpMarked(ExprContext * econtext,
- MergeJoinState * mergestate)
+ExecMergeTupleDumpMarked(ExprContext *econtext,
+ MergeJoinState *mergestate)
{
TupleTableSlot *markedSlot;
}
void
-ExecMergeTupleDump(ExprContext * econtext, MergeJoinState * mergestate)
+ExecMergeTupleDump(ExprContext *econtext, MergeJoinState *mergestate)
{
printf("******** ExecMergeTupleDump ********\n");
#endif
static void
-CleanUpSort(Plan * plan)
+CleanUpSort(Plan *plan)
{
if (plan == NULL)
* ----------------------------------------------------------------
*/
TupleTableSlot *
-ExecMergeJoin(MergeJoin * node)
+ExecMergeJoin(MergeJoin *node)
{
EState *estate;
MergeJoinState *mergestate;
*
* new outer tuple > marked tuple
*
- ******************************
+ *****************************
+ *
*
*
*
* we have to advance the outer scan until we find the outer
* 8.
*
- ******************************
+ *****************************
+ *
*
*
*
* we have to advance the inner scan until we find the inner
* 12.
*
- ******************************
+ *****************************
+ *
*
*
*
* ----------------------------------------------------------------
*/
bool
-ExecInitMergeJoin(MergeJoin * node, EState * estate, Plan * parent)
+ExecInitMergeJoin(MergeJoin *node, EState *estate, Plan *parent)
{
MergeJoinState *mergestate;
List *joinclauses;
}
int
-ExecCountSlotsMergeJoin(MergeJoin * node)
+ExecCountSlotsMergeJoin(MergeJoin *node)
{
return ExecCountSlotsNode(outerPlan((Plan *) node)) +
ExecCountSlotsNode(innerPlan((Plan *) node)) +
* ----------------------------------------------------------------
*/
void
-ExecEndMergeJoin(MergeJoin * node)
+ExecEndMergeJoin(MergeJoin *node)
{
MergeJoinState *mergestate;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeNestloop.c,v 1.6 1997/09/08 20:55:46 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeNestloop.c,v 1.7 1997/09/08 21:43:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* ----------------------------------------------------------------
*/
TupleTableSlot *
-ExecNestLoop(NestLoop * node, Plan * parent)
+ExecNestLoop(NestLoop *node, Plan *parent)
{
NestLoopState *nlstate;
Plan *innerPlan;
*/
econtext = nlstate->jstate.cs_ExprContext;
- /* ---------------- * get the current outer tuple
+ /* ---------------- * get the current outer tuple
* ----------------
*/
outerTupleSlot = nlstate->jstate.cs_OuterTupleSlot;
* ----------------------------------------------------------------
*/
bool
-ExecInitNestLoop(NestLoop * node, EState * estate, Plan * parent)
+ExecInitNestLoop(NestLoop *node, EState *estate, Plan *parent)
{
NestLoopState *nlstate;
}
int
-ExecCountSlotsNestLoop(NestLoop * node)
+ExecCountSlotsNestLoop(NestLoop *node)
{
return ExecCountSlotsNode(outerPlan(node)) +
ExecCountSlotsNode(innerPlan(node)) +
* ----------------------------------------------------------------
*/
void
-ExecEndNestLoop(NestLoop * node)
+ExecEndNestLoop(NestLoop *node)
{
NestLoopState *nlstate;
* SeqScan (emp.all)
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeResult.c,v 1.4 1997/09/08 02:22:49 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeResult.c,v 1.5 1997/09/08 21:43:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* ----------------------------------------------------------------
*/
TupleTableSlot *
-ExecResult(Result * node)
+ExecResult(Result *node)
{
ResultState *resstate;
TupleTableSlot *outerTupleSlot;
* ----------------------------------------------------------------
*/
bool
-ExecInitResult(Result * node, EState * estate, Plan * parent)
+ExecInitResult(Result *node, EState *estate, Plan *parent)
{
ResultState *resstate;
}
int
-ExecCountSlotsResult(Result * node)
+ExecCountSlotsResult(Result *node)
{
return ExecCountSlotsNode(outerPlan(node)) + RESULT_NSLOTS;
}
* ----------------------------------------------------------------
*/
void
-ExecEndResult(Result * node)
+ExecEndResult(Result *node)
{
ResultState *resstate;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeSeqscan.c,v 1.6 1997/09/08 02:22:50 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeSeqscan.c,v 1.7 1997/09/08 21:43:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "parser/parsetree.h"
static Oid
-InitScanRelation(SeqScan * node, EState * estate,
- CommonScanState * scanstate, Plan * outerPlan);
+InitScanRelation(SeqScan *node, EState *estate,
+ CommonScanState *scanstate, Plan *outerPlan);
-static TupleTableSlot *SeqNext(SeqScan * node);
+static TupleTableSlot *SeqNext(SeqScan *node);
/* ----------------------------------------------------------------
* Scan Support
* ----------------------------------------------------------------
*/
static TupleTableSlot *
-SeqNext(SeqScan * node)
+SeqNext(SeqScan *node)
{
HeapTuple tuple;
HeapScanDesc scandesc;
*/
TupleTableSlot *
-ExecSeqScan(SeqScan * node)
+ExecSeqScan(SeqScan *node)
{
TupleTableSlot *slot;
Plan *outerPlan;
* ----------------------------------------------------------------
*/
static Oid
-InitScanRelation(SeqScan * node, EState * estate,
- CommonScanState * scanstate, Plan * outerPlan)
+InitScanRelation(SeqScan *node, EState *estate,
+ CommonScanState *scanstate, Plan *outerPlan)
{
Index relid;
List *rangeTable;
direction,/* scan direction */
timeQual, /* time qual */
¤tRelation, /* return: rel desc */
- (Pointer *) & currentScanDesc); /* return: scan desc */
+ (Pointer *) ¤tScanDesc); /* return: scan desc */
scanstate->css_currentRelation = currentRelation;
scanstate->css_currentScanDesc = currentScanDesc;
* ----------------------------------------------------------------
*/
bool
-ExecInitSeqScan(SeqScan * node, EState * estate, Plan * parent)
+ExecInitSeqScan(SeqScan *node, EState *estate, Plan *parent)
{
CommonScanState *scanstate;
Plan *outerPlan;
}
int
-ExecCountSlotsSeqScan(SeqScan * node)
+ExecCountSlotsSeqScan(SeqScan *node)
{
return ExecCountSlotsNode(outerPlan(node)) +
ExecCountSlotsNode(innerPlan(node)) +
* ----------------------------------------------------------------
*/
void
-ExecEndSeqScan(SeqScan * node)
+ExecEndSeqScan(SeqScan *node)
{
CommonScanState *scanstate;
Plan *outerPlan;
* ----------------------------------------------------------------
*/
void
-ExecSeqReScan(SeqScan * node, ExprContext * exprCtxt, Plan * parent)
+ExecSeqReScan(SeqScan *node, ExprContext *exprCtxt, Plan *parent)
{
CommonScanState *scanstate;
EState *estate;
* ----------------------------------------------------------------
*/
void
-ExecSeqMarkPos(SeqScan * node)
+ExecSeqMarkPos(SeqScan *node)
{
CommonScanState *scanstate;
Plan *outerPlan;
* ----------------------------------------------------------------
*/
void
-ExecSeqRestrPos(SeqScan * node)
+ExecSeqRestrPos(SeqScan *node)
{
CommonScanState *scanstate;
Plan *outerPlan;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeSort.c,v 1.8 1997/09/08 02:22:50 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeSort.c,v 1.9 1997/09/08 21:43:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* ----------------------------------------------------------------
*/
static ScanKey
-FormSortKeys(Sort * sortnode)
+FormSortKeys(Sort *sortnode)
{
ScanKey sortkeys;
List *targetList;
* ----------------------------------------------------------------
*/
TupleTableSlot *
-ExecSort(Sort * node)
+ExecSort(Sort *node)
{
EState *estate;
SortState *sortstate;
* ----------------------------------------------------------------
*/
bool
-ExecInitSort(Sort * node, EState * estate, Plan * parent)
+ExecInitSort(Sort *node, EState *estate, Plan *parent)
{
SortState *sortstate;
Plan *outerPlan;
}
int
-ExecCountSlotsSort(Sort * node)
+ExecCountSlotsSort(Sort *node)
{
return ExecCountSlotsNode(outerPlan((Plan *) node)) +
ExecCountSlotsNode(innerPlan((Plan *) node)) +
* ----------------------------------------------------------------
*/
void
-ExecEndSort(Sort * node)
+ExecEndSort(Sort *node)
{
SortState *sortstate;
Plan *outerPlan;
* ----------------------------------------------------------------
*/
void
-ExecSortMarkPos(Sort * node)
+ExecSortMarkPos(Sort *node)
{
SortState *sortstate;
* ----------------------------------------------------------------
*/
void
-ExecSortRestrPos(Sort * node)
+ExecSortRestrPos(Sort *node)
{
SortState *sortstate;
* ExecEndTee
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.8 1997/09/08 02:22:51 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.9 1997/09/08 21:43:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* ------------------------------------------------------------------
*/
bool
-ExecInitTee(Tee * node, EState * currentEstate, Plan * parent)
+ExecInitTee(Tee *node, EState *currentEstate, Plan *parent)
{
TeeState *teeState;
Plan *outerPlan;
}
int
-ExecCountSlotsTee(Tee * node)
+ExecCountSlotsTee(Tee *node)
{
/* Tee nodes can't have innerPlans */
return ExecCountSlotsNode(outerPlan(node)) + TEE_NSLOTS;
* ----------------------------------------------------------------
*/
static void
-initTeeScanDescs(Tee * node)
+initTeeScanDescs(Tee *node)
{
TeeState *teeState;
Relation bufferRel;
*/
TupleTableSlot *
-ExecTee(Tee * node, Plan * parent)
+ExecTee(Tee *node, Plan *parent)
{
EState *estate;
TeeState *teeState;
* ----------------------------------------------------------------
*/
void
-ExecTeeReScan(Tee * node, ExprContext * exprCtxt, Plan * parent)
+ExecTeeReScan(Tee *node, ExprContext *exprCtxt, Plan *parent)
{
EState *estate;
*/
void
-ExecEndTee(Tee * node, Plan * parent)
+ExecEndTee(Tee *node, Plan *parent)
{
EState *estate;
TeeState *teeState;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.9 1997/09/08 02:22:52 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.10 1997/09/08 21:43:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* same ADT value. -cim
* ----------------------------------------------------------------
*/
-static bool /* true if tuples are identical, false
+static bool /* true if tuples are identical, false
* otherwise */
-ExecIdenticalTuples(TupleTableSlot * t1, TupleTableSlot * t2)
+ExecIdenticalTuples(TupleTableSlot *t1, TupleTableSlot *t2)
{
HeapTuple h1;
HeapTuple h2;
* ----------------------------------------------------------------
*/
TupleTableSlot * /* return: a tuple or NULL */
-ExecUnique(Unique * node)
+ExecUnique(Unique *node)
{
UniqueState *uniquestate;
TupleTableSlot *resultTupleSlot;
* ----------------------------------------------------------------
*/
bool /* return: initialization status */
-ExecInitUnique(Unique * node, EState * estate, Plan * parent)
+ExecInitUnique(Unique *node, EState *estate, Plan *parent)
{
UniqueState *uniquestate;
Plan *outerPlan;
}
int
-ExecCountSlotsUnique(Unique * node)
+ExecCountSlotsUnique(Unique *node)
{
return ExecCountSlotsNode(outerPlan(node)) +
ExecCountSlotsNode(innerPlan(node)) +
* ----------------------------------------------------------------
*/
void
-ExecEndUnique(Unique * node)
+ExecEndUnique(Unique *node)
{
UniqueState *uniquestate;
Portal portal; /* portal per procedure */
MemoryContext savedcxt;
CommandId savedId;
-} _SPI_connection;
+} _SPI_connection;
static Portal _SPI_portal = (Portal) NULL;
static _SPI_connection *_SPI_stack = NULL;
List *ptlist;
int nargs;
Oid *argtypes;
-} _SPI_plan;
+} _SPI_plan;
-static int _SPI_execute(char *src, int tcount, _SPI_plan * plan);
-static int _SPI_pquery(QueryDesc * queryDesc, EState * state, int tcount);
+static int _SPI_execute(char *src, int tcount, _SPI_plan *plan);
+static int _SPI_pquery(QueryDesc *queryDesc, EState *state, int tcount);
#if 0
-static void _SPI_fetch(FetchStmt * stmt);
+static void _SPI_fetch(FetchStmt *stmt);
#endif
static int
-_SPI_execute_plan(_SPI_plan * plan,
+_SPI_execute_plan(_SPI_plan *plan,
char **Values, char *Nulls, int tcount);
-static _SPI_plan *_SPI_copy_plan(_SPI_plan * plan, bool local);
+static _SPI_plan *_SPI_copy_plan(_SPI_plan *plan, bool local);
static int _SPI_begin_call(bool execmem);
static int _SPI_end_call(bool procmem);
}
void *
-SPI_prepare(char *src, int nargs, Oid * argtypes)
+SPI_prepare(char *src, int nargs, Oid *argtypes)
{
_SPI_plan *plan;
}
char *
-SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool * isnull)
+SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool *isnull)
{
char *val;
*/
static int
-_SPI_execute(char *src, int tcount, _SPI_plan * plan)
+_SPI_execute(char *src, int tcount, _SPI_plan *plan)
{
QueryTreeList *queryTree_list;
List *planTree_list;
}
static int
-_SPI_execute_plan(_SPI_plan * plan, char **Values, char *Nulls, int tcount)
+_SPI_execute_plan(_SPI_plan *plan, char **Values, char *Nulls, int tcount)
{
QueryTreeList *queryTree_list = plan->qtlist;
List *planTree_list = plan->ptlist;
}
static int
-_SPI_pquery(QueryDesc * queryDesc, EState * state, int tcount)
+_SPI_pquery(QueryDesc *queryDesc, EState *state, int tcount)
{
Query *parseTree;
Plan *plan;
#if 0
static void
-_SPI_fetch(FetchStmt * stmt)
+_SPI_fetch(FetchStmt *stmt)
{
char *name = stmt->portalname;
int feature = (stmt->direction == FORWARD) ? EXEC_FOR : EXEC_BACK;
}
static _SPI_plan *
-_SPI_copy_plan(_SPI_plan * plan, bool local)
+_SPI_copy_plan(_SPI_plan *plan, bool local)
{
_SPI_plan *newplan;
MemoryContext oldcxt;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/lib/dllist.c,v 1.7 1997/09/08 02:22:56 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/lib/dllist.c,v 1.8 1997/09/08 21:43:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* free up a list and all the nodes in it */
void
-DLFreeList(Dllist * l)
+DLFreeList(Dllist *l)
{
Dlelem *curr;
}
void
-DLFreeElem(Dlelem * e)
+DLFreeElem(Dlelem *e)
{
free(e);
}
Dlelem *
-DLGetHead(Dllist * l)
+DLGetHead(Dllist *l)
{
return (l ? l->dll_head : 0);
}
/* get the value stored in the first element */
#ifdef NOT_USED
void *
-DLGetHeadVal(Dllist * l)
+DLGetHeadVal(Dllist *l)
{
Dlelem *e = DLGetHead(l);
#endif
Dlelem *
-DLGetTail(Dllist * l)
+DLGetTail(Dllist *l)
{
return (l ? l->dll_tail : 0);
}
/* get the value stored in the first element */
#ifdef NOT_USED
void *
-DLGetTailVal(Dllist * l)
+DLGetTailVal(Dllist *l)
{
Dlelem *e = DLGetTail(l);
#endif
Dlelem *
-DLGetPred(Dlelem * e) /* get predecessor */
+DLGetPred(Dlelem *e) /* get predecessor */
{
return (e ? e->dle_prev : 0);
}
Dlelem *
-DLGetSucc(Dlelem * e) /* get successor */
+DLGetSucc(Dlelem *e) /* get successor */
{
return (e ? e->dle_next : 0);
}
void
-DLRemove(Dlelem * e)
+DLRemove(Dlelem *e)
{
Dllist *l;
}
void
-DLAddHead(Dllist * l, Dlelem * e)
+DLAddHead(Dllist *l, Dlelem *e)
{
e->dle_list = l;
}
void
-DLAddTail(Dllist * l, Dlelem * e)
+DLAddTail(Dllist *l, Dlelem *e)
{
e->dle_list = l;
}
Dlelem *
-DLRemHead(Dllist * l)
+DLRemHead(Dllist *l)
{
/* remove and return the head */
Dlelem *result;
}
Dlelem *
-DLRemTail(Dllist * l)
+DLRemTail(Dllist *l)
{
/* remove and return the tail */
Dlelem *result;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/lib/Attic/hasht.c,v 1.6 1997/09/08 02:22:59 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/lib/Attic/hasht.c,v 1.7 1997/09/08 21:43:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* -----------------------------------
*/
void
-HashTableWalk(HTAB * hashtable, HashtFunc function, int arg)
+HashTableWalk(HTAB *hashtable, HashtFunc function, int arg)
{
long *hashent;
long *data;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/lib/Attic/lispsort.c,v 1.6 1997/09/08 02:23:02 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/lib/Attic/lispsort.c,v 1.7 1997/09/08 21:43:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
** the nodes sorted. The old list is *not* freed or modified (?)
*/
List *
-lisp_qsort(List * the_list, /* the list to be sorted */
+lisp_qsort(List *the_list, /* the list to be sorted */
int (*compare) ()) /* function to compare two nodes */
{
int i;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.16 1997/09/08 02:23:06 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.17 1997/09/08 21:43:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#endif /* KRB5 */
static int
-pg_password_recvauth(Port * port, char *database, char *DataDir)
+pg_password_recvauth(Port *port, char *database, char *DataDir)
{
PacketBuf buf;
char *user,
* be_recvauth -- server demux routine for incoming authentication information
*/
int
-be_recvauth(MsgType msgtype_arg, Port * port, char *username, StartupInfo * sp)
+be_recvauth(MsgType msgtype_arg, Port *port, char *username, StartupInfo *sp)
{
MsgType msgtype;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-dumpdata.c,v 1.7 1997/09/08 02:23:09 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-dumpdata.c,v 1.8 1997/09/08 21:43:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* ----------------
*/
void
-be_portalpush(PortalEntry * entry)
+be_portalpush(PortalEntry *entry)
{
DLAddTail(be_portalstack, DLNewElem(entry));
}
* ----------------
*/
void
-be_typeinit(PortalEntry * entry,
+be_typeinit(PortalEntry *entry,
TupleDesc tupDesc,
int natts)
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.14 1997/09/08 02:23:10 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.15 1997/09/08 21:43:41 momjian Exp $
*
* NOTES
* This should be moved to a more appropriate place. It is here
static GlobalMemory fscxt = NULL;
-static int newLOfd(LargeObjectDesc * lobjCookie);
+static int newLOfd(LargeObjectDesc *lobjCookie);
static void deleteLOfd(int fd);
* imports a file as an (inversion) large object.
*/
Oid
-lo_import(text * filename)
+lo_import(text *filename)
{
int fd;
int nbytes,
* exports an (inversion) large object.
*/
int4
-lo_export(Oid lobjId, text * filename)
+lo_export(Oid lobjId, text *filename)
{
int fd;
int nbytes,
*****************************************************************************/
static int
-newLOfd(LargeObjectDesc * lobjCookie)
+newLOfd(LargeObjectDesc *lobjCookie)
{
int i;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.6 1997/09/08 02:23:11 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-pqexec.c,v 1.7 1997/09/08 21:43:43 momjian Exp $
*
*-------------------------------------------------------------------------
*/
int *result_buf, /* can't use void, dec compiler barfs */
int result_len,
int result_is_int,
- PQArgBlock * args,
+ PQArgBlock *args,
int nargs)
{
char *retval; /* XXX - should be datum, maybe ? */
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.21 1997/09/08 02:23:12 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.22 1997/09/08 21:43:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
static void
-next_token(FILE * fp, char *buf, const int bufsz)
+next_token(FILE *fp, char *buf, const int bufsz)
{
/*--------------------------------------------------------------------------
Grab one token out of fp. Tokens are strings of non-blank
static void
-read_through_eol(FILE * file)
+read_through_eol(FILE *file)
{
int c;
static void
-read_hba_entry2(FILE * file, enum Userauth * userauth_p, char usermap_name[],
- bool * error_p, bool * matches_p, bool find_password_entries)
+read_hba_entry2(FILE *file, enum Userauth * userauth_p, char usermap_name[],
+ bool *error_p, bool *matches_p, bool find_password_entries)
{
/*--------------------------------------------------------------------------
Read from file FILE the rest of a host record, after the mask field,
static void
-process_hba_record(FILE * file,
+process_hba_record(FILE *file,
const struct in_addr ip_addr, const char database[],
- bool * matches_p, bool * error_p,
+ bool *matches_p, bool *error_p,
enum Userauth * userauth_p, char usermap_name[],
bool find_password_entries)
{
static void
-process_open_config_file(FILE * file,
+process_open_config_file(FILE *file,
const struct in_addr ip_addr, const char database[],
- bool * host_ok_p, enum Userauth * userauth_p,
+ bool *host_ok_p, enum Userauth * userauth_p,
char usermap_name[], bool find_password_entries)
{
/*---------------------------------------------------------------------------
void
find_hba_entry(const char DataDir[], const struct in_addr ip_addr,
const char database[],
- bool * host_ok_p, enum Userauth * userauth_p,
+ bool *host_ok_p, enum Userauth * userauth_p,
char usermap_name[], bool find_password_entries)
{
/*--------------------------------------------------------------------------
static void
interpret_ident_response(char ident_response[],
- bool * error_p, char ident_username[])
+ bool *error_p, char ident_username[])
{
/*----------------------------------------------------------------------------
Parse the string "ident_response[]" as a response from a query to an Ident
static void
ident(const struct in_addr remote_ip_addr, const struct in_addr local_ip_addr,
const ushort remote_port, const ushort local_port,
- bool * ident_failed, char ident_username[])
+ bool *ident_failed, char ident_username[])
{
/*--------------------------------------------------------------------------
Talk to the ident server on host "remote_ip_addr" and find out who
static void
-parse_map_record(FILE * file,
+parse_map_record(FILE *file,
char file_map[], char file_pguser[], char file_iuser[])
{
/*---------------------------------------------------------------------------
static void
-verify_against_open_usermap(FILE * file,
+verify_against_open_usermap(FILE *file,
const char pguser[],
const char ident_username[],
const char usermap_name[],
- bool * checks_out_p)
+ bool *checks_out_p)
{
/*--------------------------------------------------------------------------
This function does the same thing as verify_against_usermap,
const char pguser[],
const char ident_username[],
const char usermap_name[],
- bool * checks_out_p)
+ bool *checks_out_p)
{
/*--------------------------------------------------------------------------
See if the user with ident username "ident_username" is allowed to act
authident(const char DataDir[],
const Port port, const char postgres_username[],
const char usermap_name[],
- bool * authentic_p)
+ bool *authentic_p)
{
/*---------------------------------------------------------------------------
Talk to the ident server on the remote host and find out who owns the
extern int
-hba_recvauth(const Port * port, const char database[], const char user[],
+hba_recvauth(const Port *port, const char database[], const char user[],
const char DataDir[])
{
/*---------------------------------------------------------------------------
case Trust:
retvalue = STATUS_OK;
break;
- case Ident:
+ case Ident:
{
/*
bool authentic; /* He is who he says he
* is. */
- authident(DataDir, *port, user, usermap_name, &authentic);
+ authident(DataDir, *port, user, usermap_name, &authentic);
- if (authentic)
- retvalue = STATUS_OK;
+ if (authentic)
+ retvalue = STATUS_OK;
else
- retvalue = STATUS_ERROR;
+ retvalue = STATUS_ERROR;
}
- break;
+ break;
+
default:
retvalue = STATUS_ERROR;
Assert(false);
#endif
int
-verify_password(char *user, char *password, Port * port,
+verify_password(char *user, char *password, Port *port,
char *database, char *DataDir)
{
bool host_ok;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portal.c,v 1.8 1997/09/08 02:23:14 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portal.c,v 1.9 1997/09/08 21:43:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* --------------------------------
*/
int
-PQrulep(PortalBuffer * portal)
+PQrulep(PortalBuffer *portal)
{
if (!valid_pointer("PQrulep: invalid portal pointer", portal))
return (-1);
* --------------------------------
*/
int
-PQntuples(PortalBuffer * portal)
+PQntuples(PortalBuffer *portal)
{
if (!valid_pointer("PQntuples: invalid portal pointer", portal))
return (-1);
}
int
-PQninstances(PortalBuffer * portal)
+PQninstances(PortalBuffer *portal)
{
return (PQntuples(portal));
}
* --------------------------------
*/
int
-PQngroups(PortalBuffer * portal)
+PQngroups(PortalBuffer *portal)
{
if (!valid_pointer("PQngroups: invalid portal pointer", portal))
return (-1);
* --------------------------------
*/
int
-PQntuplesGroup(PortalBuffer * portal, int group_index)
+PQntuplesGroup(PortalBuffer *portal, int group_index)
{
GroupBuffer *gbp;
}
int
-PQninstancesGroup(PortalBuffer * portal, int group_index)
+PQninstancesGroup(PortalBuffer *portal, int group_index)
{
return (PQntuplesGroup(portal, group_index));
}
* --------------------------------
*/
int
-PQnfieldsGroup(PortalBuffer * portal, int group_index)
+PQnfieldsGroup(PortalBuffer *portal, int group_index)
{
GroupBuffer *gbp;
* --------------------------------
*/
int
-PQfnumberGroup(PortalBuffer * portal, int group_index, char *field_name)
+PQfnumberGroup(PortalBuffer *portal, int group_index, char *field_name)
{
GroupBuffer *gbp;
* --------------------------------
*/
char *
-PQfnameGroup(PortalBuffer * portal, int group_index, int field_number)
+PQfnameGroup(PortalBuffer *portal, int group_index, int field_number)
{
GroupBuffer *gbp;
* --------------------------------
*/
int
-PQftypeGroup(PortalBuffer * portal, int group_index, int field_number)
+PQftypeGroup(PortalBuffer *portal, int group_index, int field_number)
{
GroupBuffer *gbp;
* --------------------------------
*/
int
-PQfsizeGroup(PortalBuffer * portal, int group_index, int field_number)
+PQfsizeGroup(PortalBuffer *portal, int group_index, int field_number)
{
GroupBuffer *gbp;
* --------------------------------
*/
GroupBuffer *
-PQgroup(PortalBuffer * portal, int tuple_index)
+PQgroup(PortalBuffer *portal, int tuple_index)
{
GroupBuffer *gbp;
int tuple_count = 0;
* --------------------------------
*/
int
-PQgetgroup(PortalBuffer * portal, int tuple_index)
+PQgetgroup(PortalBuffer *portal, int tuple_index)
{
GroupBuffer *gbp;
int tuple_count = 0,
* --------------------------------
*/
int
-PQnfields(PortalBuffer * portal, int tuple_index)
+PQnfields(PortalBuffer *portal, int tuple_index)
{
GroupBuffer *gbp;
* --------------------------------
*/
int
-PQfnumber(PortalBuffer * portal, int tuple_index, char *field_name)
+PQfnumber(PortalBuffer *portal, int tuple_index, char *field_name)
{
GroupBuffer *gbp;
* --------------------------------
*/
char *
-PQfname(PortalBuffer * portal, int tuple_index, int field_number)
+PQfname(PortalBuffer *portal, int tuple_index, int field_number)
{
GroupBuffer *gbp;
* --------------------------------
*/
int
-PQftype(PortalBuffer * portal, int tuple_index, int field_number)
+PQftype(PortalBuffer *portal, int tuple_index, int field_number)
{
GroupBuffer *gbp;
* --------------------------------
*/
int
-PQfsize(PortalBuffer * portal, int tuple_index, int field_number)
+PQfsize(PortalBuffer *portal, int tuple_index, int field_number)
{
GroupBuffer *gbp;
* --------------------------------
*/
int
-PQsametype(PortalBuffer * portal, int tuple_index1, int tuple_index2)
+PQsametype(PortalBuffer *portal, int tuple_index1, int tuple_index2)
{
GroupBuffer *gbp1,
*gbp2;
}
static TupleBlock *
-PQGetTupleBlock(PortalBuffer * portal,
+PQGetTupleBlock(PortalBuffer *portal,
int tuple_index,
int *tuple_offset)
{
* --------------------------------
*/
char *
-PQgetvalue(PortalBuffer * portal,
+PQgetvalue(PortalBuffer *portal,
int tuple_index,
int field_number)
{
* --------------------------------
*/
char *
-PQgetAttr(PortalBuffer * portal,
+PQgetAttr(PortalBuffer *portal,
int tuple_index,
int field_number)
{
* --------------------------------
*/
int
-PQgetlength(PortalBuffer * portal,
+PQgetlength(PortalBuffer *portal,
int tuple_index,
int field_number)
{
}
void
-PQremoveNotify(PQNotifyList * nPtr)
+PQremoveNotify(PQNotifyList *nPtr)
{
nPtr->valid = 0; /* remove later */
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portalbuf.c,v 1.6 1997/09/08 02:23:15 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/portalbuf.c,v 1.7 1997/09/08 21:43:48 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* --------------------------------
*/
GroupBuffer *
-pbuf_addGroup(PortalBuffer * portal)
+pbuf_addGroup(PortalBuffer *portal)
{
GroupBuffer *group,
*group1;
* --------------------------------
*/
void
-pbuf_freeTypes(TypeBlock * types)
+pbuf_freeTypes(TypeBlock *types)
{
pbuf_free((caddr_t) types);
}
* --------------------------------
*/
void
-pbuf_freeTuples(TupleBlock * tuples,
+pbuf_freeTuples(TupleBlock *tuples,
int no_tuples,
int no_fields)
{
* --------------------------------
*/
void
-pbuf_freeGroup(GroupBuffer * group)
+pbuf_freeGroup(GroupBuffer *group)
{
if (group->next != NULL)
pbuf_freeGroup(group->next);
* --------------------------------
*/
void
-pbuf_freePortal(PortalBuffer * portal)
+pbuf_freePortal(PortalBuffer *portal)
{
if (portal->groups != NULL)
pbuf_freeGroup(portal->groups);
* --------------------------------
*/
void
-pbuf_setportalinfo(PortalEntry * entry, char *pname)
+pbuf_setportalinfo(PortalEntry *entry, char *pname)
{
if (entry)
strNcpy(entry->name, pname, PortalNameLength - 1);
* --------------------------------
*/
GroupBuffer *
-pbuf_findGroup(PortalBuffer * portal,
+pbuf_findGroup(PortalBuffer *portal,
int group_index)
{
GroupBuffer *group;
* --------------------------------
*/
int
-pbuf_findFnumber(GroupBuffer * group,
+pbuf_findFnumber(GroupBuffer *group,
char *field_name)
{
TypeBlock *types;
* --------------------------------
*/
void
-pbuf_checkFnumber(GroupBuffer * group,
+pbuf_checkFnumber(GroupBuffer *group,
int field_number)
{
if (field_number < 0 || field_number >= group->no_fields)
* --------------------------------
*/
char *
-pbuf_findFname(GroupBuffer * group,
+pbuf_findFname(GroupBuffer *group,
int field_number)
{
pbuf_checkFnumber(group, field_number);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.21 1997/09/08 02:23:16 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.22 1997/09/08 21:43:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* used for debugging libpq
*/
static int
-pq_getc(FILE * fin)
+pq_getc(FILE *fin)
{
int c;
* RETURNS: STATUS_OK or STATUS_ERROR
*/
int
-StreamConnection(int server_fd, Port * port)
+StreamConnection(int server_fd, Port *port)
{
int addrlen;
* ---------------------------
*/
int
-StreamOpen(char *hostName, short portName, Port * port)
+StreamOpen(char *hostName, short portName, Port *port)
{
struct hostent *hp;
int laddrlen = sizeof(struct sockaddr_in);
/* --------------------------------------------------------------------- */
int
-pqPutShort(int integer, FILE * f)
+pqPutShort(int integer, FILE *f)
{
int retval = 0;
u_short n,
/* --------------------------------------------------------------------- */
int
-pqPutLong(int integer, FILE * f)
+pqPutLong(int integer, FILE *f)
{
int retval = 0;
u_long n;
/* --------------------------------------------------------------------- */
int
-pqGetShort(int *result, FILE * f)
+pqGetShort(int *result, FILE *f)
{
int retval = 0;
u_short n;
/* --------------------------------------------------------------------- */
int
-pqGetLong(int *result, FILE * f)
+pqGetLong(int *result, FILE *f)
{
int retval = 0;
u_long n;
Return 0 if ok.
*/
int
-pqGetNBytes(char *s, size_t len, FILE * f)
+pqGetNBytes(char *s, size_t len, FILE *f)
{
int cnt;
/* --------------------------------------------------------------------- */
int
-pqPutNBytes(const char *s, size_t len, FILE * f)
+pqPutNBytes(const char *s, size_t len, FILE *f)
{
if (f == NULL)
return 0;
/* --------------------------------------------------------------------- */
int
-pqGetString(char *s, size_t len, FILE * f)
+pqGetString(char *s, size_t len, FILE *f)
{
int c;
/* --------------------------------------------------------------------- */
int
-pqPutString(const char *s, FILE * f)
+pqPutString(const char *s, FILE *f)
{
if (f == NULL)
return 0;
/* --------------------------------------------------------------------- */
int
-pqGetByte(FILE * f)
+pqGetByte(FILE *f)
{
return getc(f);
}
/* --------------------------------------------------------------------- */
int
-pqPutByte(int c, FILE * f)
+pqPutByte(int c, FILE *f)
{
if (!f)
return 0;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.7 1997/09/08 02:23:18 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.8 1997/09/08 21:43:52 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*
*/
int
-PacketReceive(Port * port, /* receive port */
- PacketBuf * buf, /* MAX_PACKET_SIZE-worth of buffer space */
+PacketReceive(Port *port, /* receive port */
+ PacketBuf *buf, /* MAX_PACKET_SIZE-worth of buffer space */
bool nonBlocking) /* NON_BLOCKING or BLOCKING i/o */
{
PacketLen max_size = sizeof(PacketBuf);
*
*/
int
-PacketSend(Port * port,
- PacketBuf * buf,
+PacketSend(Port *port,
+ PacketBuf *buf,
PacketLen len,
bool nonBlocking)
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.9 1997/09/08 20:55:50 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.10 1997/09/08 21:43:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* its contents. (good for list of pointers as well as list of integers).
*/
List *
-listCopy(List * list)
+listCopy(List *list)
{
List *newlist = NIL;
List *l,
* ----------------
*/
static void
-CopyPlanFields(Plan * from, Plan * newnode)
+CopyPlanFields(Plan *from, Plan *newnode)
{
newnode->cost = from->cost;
newnode->plan_size = from->plan_size;
* ----------------
*/
static Plan *
-_copyPlan(Plan * from)
+_copyPlan(Plan *from)
{
Plan *newnode = makeNode(Plan);
* ----------------
*/
static Existential *
-_copyExistential(Existential * from)
+_copyExistential(Existential *from)
{
Existential *newnode = makeNode(Existential);
* ----------------
*/
static Result *
-_copyResult(Result * from)
+_copyResult(Result *from)
{
Result *newnode = makeNode(Result);
* ----------------
*/
static void
-CopyScanFields(Scan * from, Scan * newnode)
+CopyScanFields(Scan *from, Scan *newnode)
{
newnode->scanrelid = from->scanrelid;
Node_Copy(from, newnode, scanstate);
* ----------------
*/
static Scan *
-_copyScan(Scan * from)
+_copyScan(Scan *from)
{
Scan *newnode = makeNode(Scan);
* ----------------
*/
static SeqScan *
-_copySeqScan(SeqScan * from)
+_copySeqScan(SeqScan *from)
{
SeqScan *newnode = makeNode(SeqScan);
* ----------------
*/
static IndexScan *
-_copyIndexScan(IndexScan * from)
+_copyIndexScan(IndexScan *from)
{
IndexScan *newnode = makeNode(IndexScan);
* ----------------
*/
static void
-CopyJoinFields(Join * from, Join * newnode)
+CopyJoinFields(Join *from, Join *newnode)
{
/* nothing extra */
return;
* ----------------
*/
static Join *
-_copyJoin(Join * from)
+_copyJoin(Join *from)
{
Join *newnode = makeNode(Join);
* ----------------
*/
static NestLoop *
-_copyNestLoop(NestLoop * from)
+_copyNestLoop(NestLoop *from)
{
NestLoop *newnode = makeNode(NestLoop);
* ----------------
*/
static MergeJoin *
-_copyMergeJoin(MergeJoin * from)
+_copyMergeJoin(MergeJoin *from)
{
MergeJoin *newnode = makeNode(MergeJoin);
List *newlist;
* ----------------
*/
static HashJoin *
-_copyHashJoin(HashJoin * from)
+_copyHashJoin(HashJoin *from)
{
HashJoin *newnode = makeNode(HashJoin);
* ----------------
*/
static void
-CopyTempFields(Temp * from, Temp * newnode)
+CopyTempFields(Temp *from, Temp *newnode)
{
newnode->tempid = from->tempid;
newnode->keycount = from->keycount;
* ----------------
*/
static Temp *
-_copyTemp(Temp * from)
+_copyTemp(Temp *from)
{
Temp *newnode = makeNode(Temp);
* ----------------
*/
static Material *
-_copyMaterial(Material * from)
+_copyMaterial(Material *from)
{
Material *newnode = makeNode(Material);
* ----------------
*/
static Sort *
-_copySort(Sort * from)
+_copySort(Sort *from)
{
Sort *newnode = makeNode(Sort);
* ----------------
*/
static Unique *
-_copyUnique(Unique * from)
+_copyUnique(Unique *from)
{
Unique *newnode = makeNode(Unique);
* ----------------
*/
static Hash *
-_copyHash(Hash * from)
+_copyHash(Hash *from)
{
Hash *newnode = makeNode(Hash);
* ----------------
*/
static Resdom *
-_copyResdom(Resdom * from)
+_copyResdom(Resdom *from)
{
Resdom *newnode = makeNode(Resdom);
}
static Fjoin *
-_copyFjoin(Fjoin * from)
+_copyFjoin(Fjoin *from)
{
Fjoin *newnode = makeNode(Fjoin);
* ----------------
*/
static Expr *
-_copyExpr(Expr * from)
+_copyExpr(Expr *from)
{
Expr *newnode = makeNode(Expr);
* ----------------
*/
static Var *
-_copyVar(Var * from)
+_copyVar(Var *from)
{
Var *newnode = makeNode(Var);
* ----------------
*/
static Oper *
-_copyOper(Oper * from)
+_copyOper(Oper *from)
{
Oper *newnode = makeNode(Oper);
* ----------------
*/
static Const *
-_copyConst(Const * from)
+_copyConst(Const *from)
{
static Oid cached_type;
static bool cached_typbyval;
* ----------------
*/
static Param *
-_copyParam(Param * from)
+_copyParam(Param *from)
{
Param *newnode = makeNode(Param);
* ----------------
*/
static Func *
-_copyFunc(Func * from)
+_copyFunc(Func *from)
{
Func *newnode = makeNode(Func);
** -- JMH, 8/2/93
*/
static Rel *
-_copyRel(Rel * from)
+_copyRel(Rel *from)
{
Rel *newnode = makeNode(Rel);
int i,
* ----------------
*/
static void
-CopyPathFields(Path * from, Path * newnode)
+CopyPathFields(Path *from, Path *newnode)
{
newnode->pathtype = from->pathtype;
* ----------------
*/
static Path *
-_copyPath(Path * from)
+_copyPath(Path *from)
{
Path *newnode = makeNode(Path);
* ----------------
*/
static IndexPath *
-_copyIndexPath(IndexPath * from)
+_copyIndexPath(IndexPath *from)
{
IndexPath *newnode = makeNode(IndexPath);
* ----------------
*/
static void
-CopyJoinPathFields(JoinPath * from, JoinPath * newnode)
+CopyJoinPathFields(JoinPath *from, JoinPath *newnode)
{
Node_Copy(from, newnode, pathclauseinfo);
Node_Copy(from, newnode, outerjoinpath);
* ----------------
*/
static JoinPath *
-_copyJoinPath(JoinPath * from)
+_copyJoinPath(JoinPath *from)
{
JoinPath *newnode = makeNode(JoinPath);
* ----------------
*/
static MergePath *
-_copyMergePath(MergePath * from)
+_copyMergePath(MergePath *from)
{
MergePath *newnode = makeNode(MergePath);
* ----------------
*/
static HashPath *
-_copyHashPath(HashPath * from)
+_copyHashPath(HashPath *from)
{
HashPath *newnode = makeNode(HashPath);
* ----------------
*/
static OrderKey *
-_copyOrderKey(OrderKey * from)
+_copyOrderKey(OrderKey *from)
{
OrderKey *newnode = makeNode(OrderKey);
* ----------------
*/
static JoinKey *
-_copyJoinKey(JoinKey * from)
+_copyJoinKey(JoinKey *from)
{
JoinKey *newnode = makeNode(JoinKey);
* ----------------
*/
static MergeOrder *
-_copyMergeOrder(MergeOrder * from)
+_copyMergeOrder(MergeOrder *from)
{
MergeOrder *newnode = makeNode(MergeOrder);
* ----------------
*/
static CInfo *
-_copyCInfo(CInfo * from)
+_copyCInfo(CInfo *from)
{
CInfo *newnode = makeNode(CInfo);
* ----------------
*/
static void
-CopyJoinMethodFields(JoinMethod * from, JoinMethod * newnode)
+CopyJoinMethodFields(JoinMethod *from, JoinMethod *newnode)
{
Node_Copy(from, newnode, jmkeys);
Node_Copy(from, newnode, clauses);
* ----------------
*/
static JoinMethod *
-_copyJoinMethod(JoinMethod * from)
+_copyJoinMethod(JoinMethod *from)
{
JoinMethod *newnode = makeNode(JoinMethod);
* ----------------
*/
static HInfo *
-_copyHInfo(HInfo * from)
+_copyHInfo(HInfo *from)
{
HInfo *newnode = makeNode(HInfo);
* ----------------
*/
static MInfo *
-_copyMInfo(MInfo * from)
+_copyMInfo(MInfo *from)
{
MInfo *newnode = makeNode(MInfo);
* ----------------
*/
static JInfo *
-_copyJInfo(JInfo * from)
+_copyJInfo(JInfo *from)
{
JInfo *newnode = makeNode(JInfo);
}
static Iter *
-_copyIter(Iter * from)
+_copyIter(Iter *from)
{
Iter *newnode = makeNode(Iter);
}
static Stream *
-_copyStream(Stream * from)
+_copyStream(Stream *from)
{
Stream *newnode = makeNode(Stream);
*/
static TargetEntry *
-_copyTargetEntry(TargetEntry * from)
+_copyTargetEntry(TargetEntry *from)
{
TargetEntry *newnode = makeNode(TargetEntry);
}
static RangeTblEntry *
-_copyRangeTblEntry(RangeTblEntry * from)
+_copyRangeTblEntry(RangeTblEntry *from)
{
RangeTblEntry *newnode = makeNode(RangeTblEntry);
}
static SortClause *
-_copySortClause(SortClause * from)
+_copySortClause(SortClause *from)
{
SortClause *newnode = makeNode(SortClause);
}
static TypeName *
-_copyTypeName(TypeName * from)
+_copyTypeName(TypeName *from)
{
TypeName *newnode = makeNode(TypeName);
}
static Query *
-_copyQuery(Query * from)
+_copyQuery(Query *from)
{
Query *newnode = makeNode(Query);
*/
static Value *
-_copyValue(Value * from)
+_copyValue(Value *from)
{
Value *newnode = makeNode(Value);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.9 1997/09/08 20:55:52 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.10 1997/09/08 21:44:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "utils/elog.h"
#include "storage/itemptr.h"
-static bool equali(List * a, List * b);
+static bool equali(List *a, List *b);
/*
* Stuff from primnodes.h
* Resdom is a subclass of Node.
*/
static bool
-_equalResdom(Resdom * a, Resdom * b)
+_equalResdom(Resdom *a, Resdom *b)
{
if (a->resno != b->resno)
return (false);
}
static bool
-_equalFjoin(Fjoin * a, Fjoin * b)
+_equalFjoin(Fjoin *a, Fjoin *b)
{
int nNodes;
* Expr is a subclass of Node.
*/
static bool
-_equalExpr(Expr * a, Expr * b)
+_equalExpr(Expr *a, Expr *b)
{
if (a->opType != b->opType)
return (false);
}
static bool
-_equalIter(Iter * a, Iter * b)
+_equalIter(Iter *a, Iter *b)
{
return (equal(a->iterexpr, b->iterexpr));
}
static bool
-_equalStream(Stream * a, Stream * b)
+_equalStream(Stream *a, Stream *b)
{
if (a->clausetype != b->clausetype)
return (false);
* Var is a subclass of Expr.
*/
static bool
-_equalVar(Var * a, Var * b)
+_equalVar(Var *a, Var *b)
{
if (a->varno != b->varno)
return (false);
* Oper is a subclass of Expr.
*/
static bool
-_equalOper(Oper * a, Oper * b)
+_equalOper(Oper *a, Oper *b)
{
if (a->opno != b->opno)
return (false);
* Const is a subclass of Expr.
*/
static bool
-_equalConst(Const * a, Const * b)
+_equalConst(Const *a, Const *b)
{
/*
* Param is a subclass of Expr.
*/
static bool
-_equalParam(Param * a, Param * b)
+_equalParam(Param *a, Param *b)
{
if (a->paramkind != b->paramkind)
return (false);
* Func is a subclass of Expr.
*/
static bool
-_equalFunc(Func * a, Func * b)
+_equalFunc(Func *a, Func *b)
{
if (a->funcid != b->funcid)
return (false);
* CInfo is a subclass of Node.
*/
static bool
-_equalCInfo(CInfo * a, CInfo * b)
+_equalCInfo(CInfo *a, CInfo *b)
{
Assert(IsA(a, CInfo));
Assert(IsA(b, CInfo));
}
static bool
-_equalJoinMethod(JoinMethod * a, JoinMethod * b)
+_equalJoinMethod(JoinMethod *a, JoinMethod *b)
{
Assert(IsA(a, JoinMethod));
Assert(IsA(b, JoinMethod));
}
static bool
-_equalPath(Path * a, Path * b)
+_equalPath(Path *a, Path *b)
{
if (a->pathtype != b->pathtype)
return (false);
}
static bool
-_equalIndexPath(IndexPath * a, IndexPath * b)
+_equalIndexPath(IndexPath *a, IndexPath *b)
{
if (!_equalPath((Path *) a, (Path *) b))
return (false);
}
static bool
-_equalJoinPath(JoinPath * a, JoinPath * b)
+_equalJoinPath(JoinPath *a, JoinPath *b)
{
Assert(IsA_JoinPath(a));
Assert(IsA_JoinPath(b));
}
static bool
-_equalMergePath(MergePath * a, MergePath * b)
+_equalMergePath(MergePath *a, MergePath *b)
{
Assert(IsA(a, MergePath));
Assert(IsA(b, MergePath));
}
static bool
-_equalHashPath(HashPath * a, HashPath * b)
+_equalHashPath(HashPath *a, HashPath *b)
{
Assert(IsA(a, HashPath));
Assert(IsA(b, HashPath));
}
static bool
-_equalJoinKey(JoinKey * a, JoinKey * b)
+_equalJoinKey(JoinKey *a, JoinKey *b)
{
Assert(IsA(a, JoinKey));
Assert(IsA(b, JoinKey));
}
static bool
-_equalMergeOrder(MergeOrder * a, MergeOrder * b)
+_equalMergeOrder(MergeOrder *a, MergeOrder *b)
{
if (a == (MergeOrder *) NULL && b == (MergeOrder *) NULL)
return (true);
}
static bool
-_equalHInfo(HInfo * a, HInfo * b)
+_equalHInfo(HInfo *a, HInfo *b)
{
Assert(IsA(a, HInfo));
Assert(IsA(b, HInfo));
* fixed to compare all fields.
*/
static bool
-_equalIndexScan(IndexScan * a, IndexScan * b)
+_equalIndexScan(IndexScan *a, IndexScan *b)
{
Assert(IsA(a, IndexScan));
Assert(IsA(b, IndexScan));
}
static bool
-_equalJInfo(JInfo * a, JInfo * b)
+_equalJInfo(JInfo *a, JInfo *b)
{
Assert(IsA(a, JInfo));
Assert(IsA(b, JInfo));
* EState is a subclass of Node.
*/
static bool
-_equalEState(EState * a, EState * b)
+_equalEState(EState *a, EState *b)
{
if (a->es_direction != b->es_direction)
return (false);
}
static bool
-_equalTargetEntry(TargetEntry * a, TargetEntry * b)
+_equalTargetEntry(TargetEntry *a, TargetEntry *b)
{
if (!equal(a->resdom, b->resdom))
return (false);
* to be recursive, but it should run faster if we iterate.
*/
static bool
-_equalValue(Value * a, Value * b)
+_equalValue(Value *a, Value *b)
{
if (a->type != b->type)
return (false);
* XXX temp hack. needs something like T_IntList
*/
static bool
-equali(List * a, List * b)
+equali(List *a, List *b)
{
List *la = (List *) a;
List *lb = (List *) b;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.6 1997/09/08 02:23:38 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.7 1997/09/08 21:44:04 momjian Exp $
*
* NOTES
* XXX a few of the following functions are duplicated to handle
}
List *
-lcons(void *obj, List * list)
+lcons(void *obj, List *list)
{
List *l = makeNode(List);
}
List *
-lconsi(int datum, List * list)
+lconsi(int datum, List *list)
{
List *l = makeNode(List);
}
List *
-lappend(List * list, void *obj)
+lappend(List *list, void *obj)
{
return nconc(list, lcons(obj, NIL));
}
List *
-lappendi(List * list, int datum)
+lappendi(List *list, int datum)
{
return nconc(list, lconsi(datum, NIL));
}
/* n starts with 0 */
void *
-nth(int n, List * l)
+nth(int n, List *l)
{
/* XXX assume list is long enough */
while (n > 0)
}
int
-nthi(int n, List * l)
+nthi(int n, List *l)
{
/* XXX assume list is long enough */
while (n > 0)
/* this is here solely for rt_store. Get rid of me some day! */
void
-set_nth(List * l, int n, void *elem)
+set_nth(List *l, int n, void *elem)
{
/* XXX assume list is long enough */
while (n > 0)
}
int
-length(List * l)
+length(List *l)
{
int i = 0;
}
void
-freeList(List * list)
+freeList(List *list)
{
while (list != NIL)
{
* below are for backwards compatibility
*/
List *
-append(List * l1, List * l2)
+append(List *l1, List *l2)
{
List *newlist,
*newlist2,
* below are for backwards compatibility
*/
List *
-intAppend(List * l1, List * l2)
+intAppend(List *l1, List *l2)
{
List *newlist,
*newlist2,
}
List *
-nconc(List * l1, List * l2)
+nconc(List *l1, List *l2)
{
List *temp;
List *
-nreverse(List * list)
+nreverse(List *list)
{
List *rlist = NIL;
List *p = NIL;
* XXX only good for IntList -ay
*/
bool
-same(List * foo, List * bar)
+same(List *foo, List *bar)
{
List *temp = NIL;
}
List *
-LispUnion(List * foo, List * bar)
+LispUnion(List *foo, List *bar)
{
List *retval = NIL;
List *i = NIL;
}
List *
-LispUnioni(List * foo, List * bar)
+LispUnioni(List *foo, List *bar)
{
List *retval = NIL;
List *i = NIL;
* bar
*/
bool
-member(void *foo, List * bar)
+member(void *foo, List *bar)
{
List *i;
}
bool
-intMember(int foo, List * bar)
+intMember(int foo, List *bar)
{
List *i;
* only does pointer comparisons. Removes 'elem' from the the linked list.
*/
List *
-lremove(void *elem, List * list)
+lremove(void *elem, List *list)
{
List *l;
List *prev = NIL;
}
List *
-LispRemove(void *elem, List * list)
+LispRemove(void *elem, List *list)
{
List *temp = NIL;
List *prev = NIL;
#ifdef NOT_USED
List *
-intLispRemove(int elem, List * list)
+intLispRemove(int elem, List *list)
{
List *temp = NIL;
List *prev = NIL;
#endif
List *
-set_difference(List * list1, List * list2)
+set_difference(List *list1, List *list2)
{
List *temp1 = NIL;
List *result = NIL;
}
List *
-set_differencei(List * list1, List * list2)
+set_differencei(List *list1, List *list2)
{
List *temp1 = NIL;
List *result = NIL;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/nodeFuncs.c,v 1.5 1997/09/08 02:23:40 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/nodeFuncs.c,v 1.6 1997/09/08 21:44:06 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "nodes/nodeFuncs.h"
#include "utils/lsyscache.h"
-static bool var_is_inner(Var * var);
+static bool var_is_inner(Var *var);
/*
* single_node -
* Returns t if node corresponds to a single-noded expression
*/
bool
-single_node(Node * node)
+single_node(Node *node)
{
- if (IsA(node, Ident) || IsA(node, Const) || IsA(node, Var) || IsA(node, Param))
+ if (IsA(node, Ident) ||IsA(node, Const) ||IsA(node, Var) ||IsA(node, Param))
return (true);
else
return (false);
*
*/
bool
-var_is_outer(Var * var)
+var_is_outer(Var *var)
{
return ((bool) (var->varno == OUTER));
}
static bool
-var_is_inner(Var * var)
+var_is_inner(Var *var)
{
return ((bool) (var->varno == INNER));
}
bool
-var_is_rel(Var * var)
+var_is_rel(Var *var)
{
return (bool)
- ! (var_is_inner(var) || var_is_outer(var));
+ !(var_is_inner(var) || var_is_outer(var));
}
/*****************************************************************************
*
*/
Oper *
-replace_opid(Oper * oper)
+replace_opid(Oper *oper)
{
oper->opid = get_opcode(oper->opno);
oper->op_fcache = NULL;
*
*/
bool
-non_null(Expr * c)
+non_null(Expr *c)
{
- if (IsA(c, Const) && !((Const *) c)->constisnull)
+ if (IsA(c, Const) &&!((Const *) c)->constisnull)
return (true);
else
return (false);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.9 1997/09/08 20:55:56 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.10 1997/09/08 21:44:07 momjian Exp $
*
* NOTES
* Every (plan) node in POSTGRES has an associated "out" routine which
* converts a List of integers
*/
static void
-_outIntList(StringInfo str, List * list)
+_outIntList(StringInfo str, List *list)
{
List *l;
char buf[500];
}
static void
-_outQuery(StringInfo str, Query * node)
+_outQuery(StringInfo str, Query *node)
{
char buf[500];
* print the basic stuff of all nodes that inherit from Plan
*/
static void
-_outPlanInfo(StringInfo str, Plan * node)
+_outPlanInfo(StringInfo str, Plan *node)
{
char buf[500];
* Stuff from plannodes.h
*/
static void
-_outPlan(StringInfo str, Plan * node)
+_outPlan(StringInfo str, Plan *node)
{
char buf[500];
}
static void
-_outResult(StringInfo str, Result * node)
+_outResult(StringInfo str, Result *node)
{
char buf[500];
* Existential is a subclass of Plan.
*/
static void
-_outExistential(StringInfo str, Existential * node)
+_outExistential(StringInfo str, Existential *node)
{
char buf[500];
* Join is a subclass of Plan
*/
static void
-_outJoin(StringInfo str, Join * node)
+_outJoin(StringInfo str, Join *node)
{
char buf[500];
* NestLoop is a subclass of Join
*/
static void
-_outNestLoop(StringInfo str, NestLoop * node)
+_outNestLoop(StringInfo str, NestLoop *node)
{
char buf[500];
* MergeJoin is a subclass of Join
*/
static void
-_outMergeJoin(StringInfo str, MergeJoin * node)
+_outMergeJoin(StringInfo str, MergeJoin *node)
{
char buf[500];
* HashJoin is a subclass of Join.
*/
static void
-_outHashJoin(StringInfo str, HashJoin * node)
+_outHashJoin(StringInfo str, HashJoin *node)
{
char buf[500];
* Scan is a subclass of Node
*/
static void
-_outScan(StringInfo str, Scan * node)
+_outScan(StringInfo str, Scan *node)
{
char buf[500];
* SeqScan is a subclass of Scan
*/
static void
-_outSeqScan(StringInfo str, SeqScan * node)
+_outSeqScan(StringInfo str, SeqScan *node)
{
char buf[500];
* IndexScan is a subclass of Scan
*/
static void
-_outIndexScan(StringInfo str, IndexScan * node)
+_outIndexScan(StringInfo str, IndexScan *node)
{
char buf[500];
* Temp is a subclass of Plan
*/
static void
-_outTemp(StringInfo str, Temp * node)
+_outTemp(StringInfo str, Temp *node)
{
char buf[500];
* Sort is a subclass of Temp
*/
static void
-_outSort(StringInfo str, Sort * node)
+_outSort(StringInfo str, Sort *node)
{
char buf[500];
}
static void
-_outGroup(StringInfo str, Group * node)
+_outGroup(StringInfo str, Group *node)
{
char buf[500];
* For some reason, unique is a subclass of Temp.
*/
static void
-_outUnique(StringInfo str, Unique * node)
+_outUnique(StringInfo str, Unique *node)
{
char buf[500];
* Hash is a subclass of Temp
*/
static void
-_outHash(StringInfo str, Hash * node)
+_outHash(StringInfo str, Hash *node)
{
char buf[500];
}
static void
-_outTee(StringInfo str, Tee * node)
+_outTee(StringInfo str, Tee *node)
{
char buf[500];
* Resdom is a subclass of Node
*/
static void
-_outResdom(StringInfo str, Resdom * node)
+_outResdom(StringInfo str, Resdom *node)
{
char buf[500];
}
static void
-_outFjoin(StringInfo str, Fjoin * node)
+_outFjoin(StringInfo str, Fjoin *node)
{
char buf[500];
int i;
* Expr is a subclass of Node
*/
static void
-_outExpr(StringInfo str, Expr * node)
+_outExpr(StringInfo str, Expr *node)
{
char buf[500];
char *opstr = NULL;
* Var is a subclass of Expr
*/
static void
-_outVar(StringInfo str, Var * node)
+_outVar(StringInfo str, Var *node)
{
char buf[500];
* Const is a subclass of Expr
*/
static void
-_outConst(StringInfo str, Const * node)
+_outConst(StringInfo str, Const *node)
{
char buf[500];
* Func is a subclass of Expr
*/
static void
-_outFunc(StringInfo str, Func * node)
+_outFunc(StringInfo str, Func *node)
{
char buf[500];
* Oper is a subclass of Expr
*/
static void
-_outOper(StringInfo str, Oper * node)
+_outOper(StringInfo str, Oper *node)
{
char buf[500];
* Param is a subclass of Expr
*/
static void
-_outParam(StringInfo str, Param * node)
+_outParam(StringInfo str, Param *node)
{
char buf[500];
* EState is a subclass of Node.
*/
static void
-_outEState(StringInfo str, EState * node)
+_outEState(StringInfo str, EState *node)
{
char buf[500];
* Stuff from relation.h
*/
static void
-_outRel(StringInfo str, Rel * node)
+_outRel(StringInfo str, Rel *node)
{
char buf[500];
* TargetEntry is a subclass of Node.
*/
static void
-_outTargetEntry(StringInfo str, TargetEntry * node)
+_outTargetEntry(StringInfo str, TargetEntry *node)
{
char buf[500];
}
static void
-_outRangeTblEntry(StringInfo str, RangeTblEntry * node)
+_outRangeTblEntry(StringInfo str, RangeTblEntry *node)
{
char buf[500];
* Path is a subclass of Node.
*/
static void
-_outPath(StringInfo str, Path * node)
+_outPath(StringInfo str, Path *node)
{
char buf[500];
* IndexPath is a subclass of Path.
*/
static void
-_outIndexPath(StringInfo str, IndexPath * node)
+_outIndexPath(StringInfo str, IndexPath *node)
{
char buf[500];
* JoinPath is a subclass of Path
*/
static void
-_outJoinPath(StringInfo str, JoinPath * node)
+_outJoinPath(StringInfo str, JoinPath *node)
{
char buf[500];
* MergePath is a subclass of JoinPath.
*/
static void
-_outMergePath(StringInfo str, MergePath * node)
+_outMergePath(StringInfo str, MergePath *node)
{
char buf[500];
* HashPath is a subclass of JoinPath.
*/
static void
-_outHashPath(StringInfo str, HashPath * node)
+_outHashPath(StringInfo str, HashPath *node)
{
char buf[500];
* OrderKey is a subclass of Node.
*/
static void
-_outOrderKey(StringInfo str, OrderKey * node)
+_outOrderKey(StringInfo str, OrderKey *node)
{
char buf[500];
* JoinKey is a subclass of Node.
*/
static void
-_outJoinKey(StringInfo str, JoinKey * node)
+_outJoinKey(StringInfo str, JoinKey *node)
{
char buf[500];
* MergeOrder is a subclass of Node.
*/
static void
-_outMergeOrder(StringInfo str, MergeOrder * node)
+_outMergeOrder(StringInfo str, MergeOrder *node)
{
char buf[500];
* CInfo is a subclass of Node.
*/
static void
-_outCInfo(StringInfo str, CInfo * node)
+_outCInfo(StringInfo str, CInfo *node)
{
char buf[500];
* JoinMethod is a subclass of Node.
*/
static void
-_outJoinMethod(StringInfo str, JoinMethod * node)
+_outJoinMethod(StringInfo str, JoinMethod *node)
{
char buf[500];
* HInfo is a subclass of JoinMethod.
*/
static void
-_outHInfo(StringInfo str, HInfo * node)
+_outHInfo(StringInfo str, HInfo *node)
{
char buf[500];
* JInfo is a subclass of Node.
*/
static void
-_outJInfo(StringInfo str, JInfo * node)
+_outJInfo(StringInfo str, JInfo *node)
{
char buf[500];
}
static void
-_outIter(StringInfo str, Iter * node)
+_outIter(StringInfo str, Iter *node)
{
appendStringInfo(str, "ITER");
}
static void
-_outStream(StringInfo str, Stream * node)
+_outStream(StringInfo str, Stream *node)
{
char buf[500];
}
static void
-_outValue(StringInfo str, Value * value)
+_outValue(StringInfo str, Value *value)
{
char buf[500];
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.8 1997/09/08 02:23:42 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/print.c,v 1.9 1997/09/08 21:44:10 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
#include "nodes/plannodes.h"
#include "optimizer/clauses.h"
-static char *plannode_type(Plan * p);
+static char *plannode_type(Plan *p);
/*
* print--
* print contents of range table
*/
void
-print_rt(List * rtable)
+print_rt(List *rtable)
{
List *l;
int i = 1;
* print an expression
*/
void
-print_expr(Node * expr, List * rtable)
+print_expr(Node *expr, List *rtable)
{
if (expr == NULL)
{
* temporary here. where is keys list of list??
*/
void
-print_keys(List * keys, List * rtable)
+print_keys(List *keys, List *rtable)
{
List *k;
* print targetlist in a more legible way.
*/
void
-print_tl(List * tlist, List * rtable)
+print_tl(List *tlist, List *rtable)
{
List *tl;
* print out the tuple with the given TupleTableSlot
*/
void
-print_slot(TupleTableSlot * slot)
+print_slot(TupleTableSlot *slot)
{
if (!slot->val)
{
}
static char *
-plannode_type(Plan * p)
+plannode_type(Plan *p)
{
switch (nodeTag(p))
{
*/
void
-print_plan_recursive(Plan * p, Query * parsetree, int indentLevel, char *label)
+print_plan_recursive(Plan *p, Query *parsetree, int indentLevel, char *label)
{
int i;
char extraInfo[100];
printf(" ");
printf("%s%s :c=%.4f :s=%d :w=%d ", label, plannode_type(p),
p->cost, p->plan_size, p->plan_width);
- if (IsA(p, Scan) || IsA(p, SeqScan))
+ if (IsA(p, Scan) ||IsA(p, SeqScan))
{
RangeTblEntry *rte;
prints just the plan node types */
void
-print_plan(Plan * p, Query * parsetree)
+print_plan(Plan *p, Query *parsetree)
{
print_plan_recursive(p, parsetree, 0, "");
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.8 1997/09/08 02:23:45 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.9 1997/09/08 21:44:11 momjian Exp $
*
* NOTES
* Most of the read functions for plan nodes are tested. (In fact, they
static Datum readDatum(Oid type);
static List *
-toIntList(List * list)
+toIntList(List *list)
{
List *l;
* ----------------
*/
static void
-_getPlan(Plan * node)
+_getPlan(Plan *node)
{
char *token;
int length;
else
{ /* Disgusting hack until I figure out what
* to do here */
- node->state = (EState *) ! NULL;
+ node->state = (EState *) !NULL;
}
token = lsptok(NULL, &length); /* eat :qptargetlist */
* ----------------
*/
static void
-_getJoin(Join * node)
+_getJoin(Join *node)
{
_getPlan((Plan *) node);
}
* ----------------
*/
static void
-_getScan(Scan * node)
+_getScan(Scan *node)
{
char *token;
int length;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_copy.c,v 1.3 1997/09/08 02:23:47 momjian Exp $
+ * $Id: geqo_copy.c,v 1.4 1997/09/08 21:44:13 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*
*/
void
-geqo_copy(Chromosome * chromo1, Chromosome * chromo2, int string_length)
+geqo_copy(Chromosome *chromo1, Chromosome *chromo2, int string_length)
{
int i;
* CX operator according to Oliver et al
* (Proc 2nd Int'l Conf on GA's)
*
-* $Id: geqo_cx.c,v 1.3 1997/09/08 02:23:49 momjian Exp $
+* $Id: geqo_cx.c,v 1.4 1997/09/08 21:44:15 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* cycle crossover
*/
int
-cx(Gene * tour1, Gene * tour2, Gene * offspring, int num_gene, City * city_table)
+cx(Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, City *city_table)
{
int i,
* geqo_erx.c--
* edge recombination crossover [ER]
*
-* $Id: geqo_erx.c,v 1.4 1997/09/08 02:23:52 momjian Exp $
+* $Id: geqo_erx.c,v 1.5 1997/09/08 21:44:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "optimizer/geqo_random.h"
-static int gimme_edge(Gene gene1, Gene gene2, Edge * edge_table);
-static void remove_gene(Gene gene, Edge edge, Edge * edge_table);
-static Gene gimme_gene(Edge edge, Edge * edge_table);
+static int gimme_edge(Gene gene1, Gene gene2, Edge *edge_table);
+static void remove_gene(Gene gene, Edge edge, Edge *edge_table);
+static Gene gimme_gene(Edge edge, Edge *edge_table);
-static Gene edge_failure(Gene * gene, int index, Edge * edge_table, int num_gene);
+static Gene edge_failure(Gene *gene, int index, Edge *edge_table, int num_gene);
/* alloc_edge_table--
*
*/
void
-free_edge_table(Edge * edge_table)
+free_edge_table(Edge *edge_table)
{
pfree(edge_table);
}
*
*/
float
-gimme_edge_table(Gene * tour1, Gene * tour2, int num_gene, Edge * edge_table)
+gimme_edge_table(Gene *tour1, Gene *tour2, int num_gene, Edge *edge_table)
{
int i,
index1,
* 0 if edge was already registered and edge_table is unchanged
*/
static int
-gimme_edge(Gene gene1, Gene gene2, Edge * edge_table)
+gimme_edge(Gene gene1, Gene gene2, Edge *edge_table)
{
int i;
int edges;
*
*/
int
-gimme_tour(Edge * edge_table, Gene * new_gene, int num_gene)
+gimme_tour(Edge *edge_table, Gene *new_gene, int num_gene)
{
int i;
int edge_failures = 0;
*
*/
static void
-remove_gene(Gene gene, Edge edge, Edge * edge_table)
+remove_gene(Gene gene, Edge edge, Edge *edge_table)
{
int i,
j;
*
*/
static Gene
-gimme_gene(Edge edge, Edge * edge_table)
+gimme_gene(Edge edge, Edge *edge_table)
{
int i;
Gene friend;
*
*/
static Gene
-edge_failure(Gene * gene, int index, Edge * edge_table, int num_gene)
+edge_failure(Gene *gene, int index, Edge *edge_table, int num_gene)
{
int i;
Gene fail_gene = gene[index];
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_eval.c,v 1.14 1997/09/08 02:23:53 momjian Exp $
+ * $Id: geqo_eval.c,v 1.15 1997/09/08 21:44:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "optimizer/geqo_paths.h"
-static List *gimme_clause_joins(Query * root, Rel * outer_rel, Rel * inner_rel);
-static Rel *gimme_clauseless_join(Rel * outer_rel, Rel * inner_rel);
-static Rel *init_join_rel(Rel * outer_rel, Rel * inner_rel, JInfo * joininfo);
-static List *new_join_tlist(List * tlist, List * other_relids, int first_resdomno);
-static List *new_joininfo_list(List * joininfo_list, List * join_relids);
-static void geqo_joinrel_size(Rel * joinrel, Rel * outer_rel, Rel * inner_rel);
-static Rel *geqo_nth(int stop, List * rels);
+static List *gimme_clause_joins(Query *root, Rel *outer_rel, Rel *inner_rel);
+static Rel *gimme_clauseless_join(Rel *outer_rel, Rel *inner_rel);
+static Rel *init_join_rel(Rel *outer_rel, Rel *inner_rel, JInfo *joininfo);
+static List *new_join_tlist(List *tlist, List *other_relids, int first_resdomno);
+static List *new_joininfo_list(List *joininfo_list, List *join_relids);
+static void geqo_joinrel_size(Rel *joinrel, Rel *outer_rel, Rel *inner_rel);
+static Rel *geqo_nth(int stop, List *rels);
/*
* geqo_eval--
* Returns cost of a query tree as an individual of the population.
*/
Cost
-geqo_eval(Query * root, Gene * tour, int num_gene)
+geqo_eval(Query *root, Gene *tour, int num_gene)
{
Rel *joinrel;
Cost fitness;
* Returns a new join relation incorporating all joins in a left-sided tree.
*/
Rel *
-gimme_tree(Query * root, Gene * tour, int rel_count, int num_gene, Rel * outer_rel)
+gimme_tree(Query *root, Gene *tour, int rel_count, int num_gene, Rel *outer_rel)
{
Rel *inner_rel; /* current relation */
int base_rel_index;
*/
static List *
-gimme_clause_joins(Query * root, Rel * outer_rel, Rel * inner_rel)
+gimme_clause_joins(Query *root, Rel *outer_rel, Rel *inner_rel)
{
List *join_list = NIL;
List *i = NIL;
*/
static Rel *
-gimme_clauseless_join(Rel * outer_rel, Rel * inner_rel)
+gimme_clauseless_join(Rel *outer_rel, Rel *inner_rel)
{
return (init_join_rel(outer_rel, inner_rel, (JInfo *) NULL));
}
* Returns the new join relation node.
*/
static Rel *
-init_join_rel(Rel * outer_rel, Rel * inner_rel, JInfo * joininfo)
+init_join_rel(Rel *outer_rel, Rel *inner_rel, JInfo *joininfo)
{
Rel *joinrel = makeNode(Rel);
List *joinrel_joininfo_list = NIL;
* Returns the new target list.
*/
static List *
-new_join_tlist(List * tlist,
- List * other_relids,
+new_join_tlist(List *tlist,
+ List *other_relids,
int first_resdomno)
{
int resdomno = first_resdomno - 1;
* Returns a list of joininfo nodes, new and old.
*/
static List *
-new_joininfo_list(List * joininfo_list, List * join_relids)
+new_joininfo_list(List *joininfo_list, List *join_relids)
{
List *current_joininfo_list = NIL;
List *new_otherrels = NIL;
* Modifies the joininfo field of appropriate rel nodes.
*/
static void
-geqo_add_new_joininfos(Query * root, List * joinrels, List * outerrels)
+geqo_add_new_joininfos(Query *root, List *joinrels, List *outerrels)
{
List *xjoinrel = NIL;
List *xrelid = NIL;
* Returns the list of final join relations.
*/
static List *
-geqo_final_join_rels(List * join_rel_list)
+geqo_final_join_rels(List *join_rel_list)
{
List *xrel = NIL;
List *temp = NIL;
* Modifies the superrels field of rel
*/
static void
-add_superrels(Rel * rel, Rel * super_rel)
+add_superrels(Rel *rel, Rel *super_rel)
{
rel->superrels = lappend(rel->superrels, super_rel);
}
* Returns non-nil if rel1 and rel2 do not overlap.
*/
static bool
-nonoverlap_rels(Rel * rel1, Rel * rel2)
+nonoverlap_rels(Rel *rel1, Rel *rel2)
{
return (nonoverlap_sets(rel1->relids, rel2->relids));
}
static bool
-nonoverlap_sets(List * s1, List * s2)
+nonoverlap_sets(List *s1, List *s2)
{
List *x = NIL;
* long join queries; so get logarithm of size when MAXINT overflow;
*/
static void
-geqo_joinrel_size(Rel * joinrel, Rel * outer_rel, Rel * inner_rel)
+geqo_joinrel_size(Rel *joinrel, Rel *outer_rel, Rel *inner_rel)
{
Cost temp;
int ntuples;
}
static Rel *
-geqo_nth(int stop, List * rels)
+geqo_nth(int stop, List *rels)
{
List *r;
int i = 1;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_main.c,v 1.5 1997/09/08 02:23:55 momjian Exp $
+ * $Id: geqo_main.c,v 1.6 1997/09/08 21:44:25 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*/
Rel *
-geqo(Query * root)
+geqo(Query *root)
{
int generation;
Chromosome *momma;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_misc.c,v 1.4 1997/09/08 02:23:57 momjian Exp $
+ * $Id: geqo_misc.c,v 1.5 1997/09/08 21:44:26 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "optimizer/geqo_recombination.h"
#include "optimizer/geqo_misc.h"
-static float avg_pool(Pool * pool);
+static float avg_pool(Pool *pool);
/* avg_pool--
*
*/
static float
-avg_pool(Pool * pool)
+avg_pool(Pool *pool)
{
int i;
double cumulative = 0.0;
/* print_pool--
*/
void
-print_pool(FILE * fp, Pool * pool, int start, int stop)
+print_pool(FILE *fp, Pool *pool, int start, int stop)
{
int i,
j;
*
*/
void
-print_gen(FILE * fp, Pool * pool, int generation)
+print_gen(FILE *fp, Pool *pool, int generation)
{
int lowest;
void
-print_edge_table(FILE * fp, Edge * edge_table, int num_gene)
+print_edge_table(FILE *fp, Edge *edge_table, int num_gene)
{
int i,
j;
*************************************************************/
void
-geqo_print_joinclauses(Query * root, List * clauses)
+geqo_print_joinclauses(Query *root, List *clauses)
{
List *l;
- extern void print_expr(Node * expr, List * rtable); /* in print.c */
+ extern void print_expr(Node *expr, List *rtable); /* in print.c */
foreach(l, clauses)
{
}
void
-geqo_print_path(Query * root, Path * path, int indent)
+geqo_print_path(Query *root, Path *path, int indent)
{
char *ptype = NULL;
JoinPath *jp;
}
void
-geqo_print_rel(Query * root, Rel * rel)
+geqo_print_rel(Query *root, Rel *rel)
{
List *l;
*
* TSP mutation routines
*
-* $Id: geqo_mutation.c,v 1.3 1997/09/08 02:23:57 momjian Exp $
+* $Id: geqo_mutation.c,v 1.4 1997/09/08 21:44:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "optimizer/geqo_mutation.h"
void
-geqo_mutation(Gene * tour, int num_gene)
+geqo_mutation(Gene *tour, int num_gene)
{
int swap1;
int swap2;
* OX1 operator according to Davis
* (Proc Int'l Joint Conf on AI)
*
-* $Id: geqo_ox1.c,v 1.3 1997/09/08 02:23:58 momjian Exp $
+* $Id: geqo_ox1.c,v 1.4 1997/09/08 21:44:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* position crossover
*/
void
-ox1(Gene * tour1, Gene * tour2, Gene * offspring, int num_gene, City * city_table)
+ox1(Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, City *city_table)
{
int left,
right,
* OX2 operator according to Syswerda
* (The Genetic Algorithms Handbook, ed L Davis)
*
-* $Id: geqo_ox2.c,v 1.3 1997/09/08 02:23:59 momjian Exp $
+* $Id: geqo_ox2.c,v 1.4 1997/09/08 21:44:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* position crossover
*/
void
-ox2(Gene * tour1, Gene * tour2, Gene * offspring, int num_gene, City * city_table)
+ox2(Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, City *city_table)
{
int k,
j,
*
* Copyright (c) 1994, Regents of the University of California
*
-* $Id: geqo_params.c,v 1.7 1997/09/08 02:24:00 momjian Exp $
+* $Id: geqo_params.c,v 1.8 1997/09/08 21:44:30 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* other cases return 0.
*/
static int
-next_token(FILE * fp, char *buf, int bufsz)
+next_token(FILE *fp, char *buf, int bufsz)
{
int c;
char *eb = buf + (bufsz - 1);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_paths.c,v 1.6 1997/09/08 02:24:05 momjian Exp $
+ * $Id: geqo_paths.c,v 1.7 1997/09/08 21:44:32 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "optimizer/geqo_paths.h"
-static List *geqo_prune_rel(Rel * rel, List * other_rels);
-static Path *set_paths(Rel * rel, Path * unorderedpath);
+static List *geqo_prune_rel(Rel *rel, List *other_rels);
+static Path *set_paths(Rel *rel, Path *unorderedpath);
/*
* geqo-prune-rels--
*
*/
List *
-geqo_prune_rels(List * rel_list)
+geqo_prune_rels(List *rel_list)
{
List *temp_list = NIL;
*
*/
static List *
-geqo_prune_rel(Rel * rel, List * other_rels)
+geqo_prune_rel(Rel *rel, List *other_rels)
{
List *i = NIL;
List *t_list = NIL;
*
*/
void
-geqo_rel_paths(Rel * rel)
+geqo_rel_paths(Rel *rel)
{
List *y = NIL;
Path *path = (Path *) NULL;
*
*/
static Path *
-set_paths(Rel * rel, Path * unorderedpath)
+set_paths(Rel *rel, Path *unorderedpath)
{
Path *cheapest = set_cheapest(rel, rel->pathlist);
* PMX operator according to Goldberg & Lingle
* (Proc Int'l Conf on GA's)
*
-* $Id: geqo_pmx.c,v 1.3 1997/09/08 02:24:06 momjian Exp $
+* $Id: geqo_pmx.c,v 1.4 1997/09/08 21:44:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* partially matched crossover
*/
void
-pmx(Gene * tour1, Gene * tour2, Gene * offspring, int num_gene)
+pmx(Gene *tour1, Gene *tour2, Gene *offspring, int num_gene)
{
int *failed = (int *) palloc((num_gene + 1) * sizeof(int));
int *from = (int *) palloc((num_gene + 1) * sizeof(int));
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_pool.c,v 1.3 1997/09/08 02:24:06 momjian Exp $
+ * $Id: geqo_pool.c,v 1.4 1997/09/08 21:44:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* deallocates memory for GA pool
*/
void
-free_pool(Pool * pool)
+free_pool(Pool *pool)
{
Chromosome *chromo;
int i;
* initialize genetic pool
*/
void
-random_init_pool(Query * root, Pool * pool, int strt, int stp)
+random_init_pool(Query *root, Pool *pool, int strt, int stp)
{
Chromosome *chromo = (Chromosome *) pool->data;
int i;
* maybe you have to change compare() for different ordering ...
*/
void
-sort_pool(Pool * pool)
+sort_pool(Pool *pool)
{
pg_qsort(pool->data, pool->size, sizeof(Chromosome), compare);
* deallocates a chromosome and string space
*/
void
-free_chromo(Chromosome * chromo)
+free_chromo(Chromosome *chromo)
{
pfree(chromo->string);
pfree(chromo);
* assumes best->worst = smallest->largest
*/
void
-spread_chromo(Chromosome * chromo, Pool * pool)
+spread_chromo(Chromosome *chromo, Pool *pool)
{
int top,
mid,
* PX operator according to Syswerda
* (The Genetic Algorithms Handbook, L Davis, ed)
*
-* $Id: geqo_px.c,v 1.3 1997/09/08 02:24:07 momjian Exp $
+* $Id: geqo_px.c,v 1.4 1997/09/08 21:44:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* position crossover
*/
void
-px(Gene * tour1, Gene * tour2, Gene * offspring, int num_gene, City * city_table)
+px(Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, City *city_table)
{
int num_positions;
* geqo_recombination.c--
* misc recombination procedures
*
-* $Id: geqo_recombination.c,v 1.3 1997/09/08 02:24:08 momjian Exp $
+* $Id: geqo_recombination.c,v 1.4 1997/09/08 21:44:36 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*
*/
void
-init_tour(Gene * tour, int num_gene)
+init_tour(Gene *tour, int num_gene)
{
Gene *tmp;
int remainder;
*
*/
void
-free_city_table(City * city_table)
+free_city_table(City *city_table)
{
pfree(city_table);
}
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_selection.c,v 1.3 1997/09/08 02:24:08 momjian Exp $
+ * $Id: geqo_selection.c,v 1.4 1997/09/08 21:44:41 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* second genes are selected from the pool
*/
void
-geqo_selection(Chromosome * momma, Chromosome * daddy, Pool * pool, double bias)
+geqo_selection(Chromosome *momma, Chromosome *daddy, Pool *pool, double bias)
{
int first,
second;
*
*
* IDENTIFICATION
-* $Header: /cvsroot/pgsql/src/backend/optimizer/geqo/Attic/minspantree.c,v 1.3 1997/09/08 02:24:09 momjian Exp $
+* $Header: /cvsroot/pgsql/src/backend/optimizer/geqo/Attic/minspantree.c,v 1.4 1997/09/08 21:44:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*/
void
-minspantree(Query * root, List * join_rels, Rel * garel)
+minspantree(Query *root, List *join_rels, Rel *garel)
{
int number_of_rels = length(root->base_relation_list_);
int number_of_joins = length(join_rels);
else if (number_of_joins == 3)
{
- Rel *rel12 = (Rel *) & tmprel_array[1][2];
- Rel *rel13 = (Rel *) & tmprel_array[1][3];
- Rel *rel23 = (Rel *) & tmprel_array[2][3];
+ Rel *rel12 = (Rel *) &tmprel_array[1][2];
+ Rel *rel13 = (Rel *) &tmprel_array[1][3];
+ Rel *rel23 = (Rel *) &tmprel_array[2][3];
if (rel12->cheapestpath->path_cost > rel13->cheapestpath->path_cost)
{
{
if (n > tempn)
{
- joinrel = (Rel *) & tmprel_array[tempn][n];
+ joinrel = (Rel *) &tmprel_array[tempn][n];
}
else
{
- joinrel = (Rel *) & tmprel_array[n][tempn];
+ joinrel = (Rel *) &tmprel_array[n][tempn];
}
dist = joinrel->cheapestpath->path_cost;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.12 1997/09/08 02:24:11 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/allpaths.c,v 1.13 1997/09/08 21:44:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
int32 _use_geqo_rels_ = GEQO_RELS;
-static void find_rel_paths(Query * root, List * rels);
-static List *find_join_paths(Query * root, List * outer_rels, int levels_left);
+static void find_rel_paths(Query *root, List *rels);
+static List *find_join_paths(Query *root, List *outer_rels, int levels_left);
/*
* find-paths--
* 'rels' is the list of single relation entries appearing in the query
*/
List *
-find_paths(Query * root, List * rels)
+find_paths(Query *root, List *rels)
{
int levels_left;
* MODIFIES: rels
*/
static void
-find_rel_paths(Query * root, List * rels)
+find_rel_paths(Query *root, List *rels)
{
List *temp;
Rel *rel;
* the result of joining all the original relations togehter.
*/
static List *
-find_join_paths(Query * root, List * outer_rels, int levels_left)
+find_join_paths(Query *root, List *outer_rels, int levels_left)
{
List *x;
List *new_rels;
#ifdef OPTIMIZER_DEBUG
static void
-print_joinclauses(Query * root, List * clauses)
+print_joinclauses(Query *root, List *clauses)
{
List *l;
- extern void print_expr(Node * expr, List * rtable); /* in print.c */
+ extern void print_expr(Node *expr, List *rtable); /* in print.c */
foreach(l, clauses)
{
}
static void
-print_path(Query * root, Path * path, int indent)
+print_path(Query *root, Path *path, int indent)
{
char *ptype = NULL;
JoinPath *jp;
}
static void
-debug_print_rel(Query * root, Rel * rel)
+debug_print_rel(Query *root, Rel *rel)
{
List *l;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.3 1997/09/08 02:24:14 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.4 1997/09/08 21:44:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "utils/elog.h"
#include "utils/lsyscache.h"
-static Cost compute_selec(Query * root, List * clauses, List * or_selectivities);
+static Cost compute_selec(Query *root, List *clauses, List *or_selectivities);
/****************************************************************************
* ROUTINES TO SET CLAUSE SELECTIVITIES
*
*/
void
-set_clause_selectivities(List * clauseinfo_list, Cost new_selectivity)
+set_clause_selectivities(List *clauseinfo_list, Cost new_selectivity)
{
List *temp;
CInfo *clausenode;
* Returns a flonum corresponding to the selectivity of 'clauseinfo-list'.
*/
Cost
-product_selec(List * clauseinfo_list)
+product_selec(List *clauseinfo_list)
{
Cost result = 1.0;
* slots.
*/
void
-set_rest_relselec(Query * root, List * rel_list)
+set_rest_relselec(Query *root, List *rel_list)
{
Rel *rel;
List *x;
*
*/
void
-set_rest_selec(Query * root, List * clauseinfo_list)
+set_rest_selec(Query *root, List *clauseinfo_list)
{
List *temp = NIL;
CInfo *clausenode = (CInfo *) NULL;
*
*/
Cost
-compute_clause_selec(Query * root, Node * clause, List * or_selectivities)
+compute_clause_selec(Query *root, Node *clause, List *or_selectivities)
{
if (!is_opclause(clause))
{
*
*/
static Cost
-compute_selec(Query * root, List * clauses, List * or_selectivities)
+compute_selec(Query *root, List *clauses, List *or_selectivities)
{
Cost s1 = 0;
List *clause = lfirst(clauses);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.18 1997/09/08 02:24:18 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.19 1997/09/08 21:44:50 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern int NBuffers;
-static int compute_attribute_width(TargetEntry * tlistentry);
+static int compute_attribute_width(TargetEntry *tlistentry);
static double base_log(double x, double b);
-static int compute_targetlist_width(List * targetlist);
+static int compute_targetlist_width(List *targetlist);
int _disable_cost_ = 30000000;
*
*/
Cost
-cost_sort(List * keys, int tuples, int width, bool noread)
+cost_sort(List *keys, int tuples, int width, bool noread)
{
Cost temp = 0;
int npages = page_size(tuples, width);
Cost
cost_mergesort(Cost outercost,
Cost innercost,
- List * outersortkeys,
- List * innersortkeys,
+ List *outersortkeys,
+ List *innersortkeys,
int outersize,
int innersize,
int outerwidth,
Cost
cost_hashjoin(Cost outercost,
Cost innercost,
- List * outerkeys,
- List * innerkeys,
+ List *outerkeys,
+ List *innerkeys,
int outersize,
int innersize,
int outerwidth,
* Returns the size.
*/
int
-compute_rel_size(Rel * rel)
+compute_rel_size(Rel *rel)
{
Cost temp;
int temp1;
* Returns the width of the tuple as a fixnum.
*/
int
-compute_rel_width(Rel * rel)
+compute_rel_width(Rel *rel)
{
return (compute_targetlist_width(get_actual_tlist(rel->targetlist)));
}
* Returns the width of the tuple as a fixnum.
*/
static int
-compute_targetlist_width(List * targetlist)
+compute_targetlist_width(List *targetlist)
{
List *temp_tl;
int tuple_width = 0;
* Returns the width of the attribute as a fixnum.
*/
static int
-compute_attribute_width(TargetEntry * tlistentry)
+compute_attribute_width(TargetEntry *tlistentry)
{
int width = get_typlen(tlistentry->resdom->restype);
* Returns a fixnum.
*/
int
-compute_joinrel_size(JoinPath * joinpath)
+compute_joinrel_size(JoinPath *joinpath)
{
Cost temp = 1.0;
int temp1 = 0;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/hashutils.c,v 1.3 1997/09/08 02:24:20 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/hashutils.c,v 1.4 1997/09/08 21:44:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "optimizer/clauses.h"
-static HInfo *match_hashop_hashinfo(Oid hashop, List * hashinfo_list);
+static HInfo *match_hashop_hashinfo(Oid hashop, List *hashinfo_list);
/*
* group-clauses-by-hashop--
*
*/
List *
-group_clauses_by_hashop(List * clauseinfo_list,
+group_clauses_by_hashop(List *clauseinfo_list,
int inner_relid)
{
List *hashinfo_list = NIL;
*
*/
static HInfo *
-match_hashop_hashinfo(Oid hashop, List * hashinfo_list)
+match_hashop_hashinfo(Oid hashop, List *hashinfo_list)
{
Oid key = 0;
HInfo *xhashinfo = (HInfo *) NULL;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.10 1997/09/08 02:24:21 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.11 1997/09/08 21:44:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
static void
-match_index_orclauses(Rel * rel, Rel * index, int indexkey,
- int xclass, List * clauseinfo_list);
+match_index_orclauses(Rel *rel, Rel *index, int indexkey,
+ int xclass, List *clauseinfo_list);
static bool
-match_index_to_operand(int indexkey, Expr * operand,
- Rel * rel, Rel * index);
+match_index_to_operand(int indexkey, Expr *operand,
+ Rel *rel, Rel *index);
static List *
-match_index_orclause(Rel * rel, Rel * index, int indexkey,
- int xclass, List * or_clauses, List * other_matching_indices);
+match_index_orclause(Rel *rel, Rel *index, int indexkey,
+ int xclass, List *or_clauses, List *other_matching_indices);
static List *
-group_clauses_by_indexkey(Rel * rel, Rel * index,
- int *indexkeys, Oid * classes, List * clauseinfo_list);
+group_clauses_by_indexkey(Rel *rel, Rel *index,
+ int *indexkeys, Oid *classes, List *clauseinfo_list);
static List *
-group_clauses_by_ikey_for_joins(Rel * rel, Rel * index,
- int *indexkeys, Oid * classes, List * join_cinfo_list, List * restr_cinfo_list);
+group_clauses_by_ikey_for_joins(Rel *rel, Rel *index,
+ int *indexkeys, Oid *classes, List *join_cinfo_list, List *restr_cinfo_list);
static CInfo *
-match_clause_to_indexkey(Rel * rel, Rel * index, int indexkey,
- int xclass, CInfo * clauseInfo, bool join);
+match_clause_to_indexkey(Rel *rel, Rel *index, int indexkey,
+ int xclass, CInfo *clauseInfo, bool join);
static bool
-pred_test(List * predicate_list, List * clauseinfo_list,
- List * joininfo_list);
-static bool one_pred_test(Expr * predicate, List * clauseinfo_list);
-static bool one_pred_clause_expr_test(Expr * predicate, Node * clause);
-static bool one_pred_clause_test(Expr * predicate, Node * clause);
-static bool clause_pred_clause_test(Expr * predicate, Node * clause);
+pred_test(List *predicate_list, List *clauseinfo_list,
+ List *joininfo_list);
+static bool one_pred_test(Expr *predicate, List *clauseinfo_list);
+static bool one_pred_clause_expr_test(Expr *predicate, Node *clause);
+static bool one_pred_clause_test(Expr *predicate, Node *clause);
+static bool clause_pred_clause_test(Expr *predicate, Node *clause);
static List *
-indexable_joinclauses(Rel * rel, Rel * index,
- List * joininfo_list, List * clauseinfo_list);
+indexable_joinclauses(Rel *rel, Rel *index,
+ List *joininfo_list, List *clauseinfo_list);
static List *
-index_innerjoin(Query * root, Rel * rel,
- List * clausegroup_list, Rel * index);
+index_innerjoin(Query *root, Rel *rel,
+ List *clausegroup_list, Rel *index);
static List *
-create_index_paths(Query * root, Rel * rel, Rel * index,
- List * clausegroup_list, bool join);
-static List *add_index_paths(List * indexpaths, List * new_indexpaths);
-static bool function_index_operand(Expr * funcOpnd, Rel * rel, Rel * index);
-static bool SingleAttributeIndex(Rel * index);
+create_index_paths(Query *root, Rel *rel, Rel *index,
+ List *clausegroup_list, bool join);
+static List *add_index_paths(List *indexpaths, List *new_indexpaths);
+static bool function_index_operand(Expr *funcOpnd, Rel *rel, Rel *index);
+static bool SingleAttributeIndex(Rel *index);
/* If Spyros can use a constant PRS2_BOOL_TYPEID, I can use this */
#define BOOL_TYPEID ((Oid) 16)
*
*/
List *
-find_index_paths(Query * root,
- Rel * rel,
- List * indices,
- List * clauseinfo_list,
- List * joininfo_list)
+find_index_paths(Query *root,
+ Rel *rel,
+ List *indices,
+ List *clauseinfo_list,
+ List *joininfo_list)
{
List *scanclausegroups = NIL;
List *scanpaths = NIL;
*
*/
static void
-match_index_orclauses(Rel * rel,
- Rel * index,
+match_index_orclauses(Rel *rel,
+ Rel *index,
int indexkey,
int xclass,
- List * clauseinfo_list)
+ List *clauseinfo_list)
{
CInfo *clauseinfo = (CInfo *) NULL;
List *i = NIL;
*/
static bool
match_index_to_operand(int indexkey,
- Expr * operand,
- Rel * rel,
- Rel * index)
+ Expr *operand,
+ Rel *rel,
+ Rel *index)
{
/*
* match the third, g,h match the fourth, etc.
*/
static List *
-match_index_orclause(Rel * rel,
- Rel * index,
+match_index_orclause(Rel *rel,
+ Rel *index,
int indexkey,
int xclass,
- List * or_clauses,
- List * other_matching_indices)
+ List *or_clauses,
+ List *other_matching_indices)
{
Node *clause = NULL;
List *matched_indices = other_matching_indices;
*
*/
static List *
-group_clauses_by_indexkey(Rel * rel,
- Rel * index,
+group_clauses_by_indexkey(Rel *rel,
+ Rel *index,
int *indexkeys,
- Oid * classes,
- List * clauseinfo_list)
+ Oid *classes,
+ List *clauseinfo_list)
{
List *curCinfo = NIL;
CInfo *matched_clause = (CInfo *) NULL;
*
*/
static List *
-group_clauses_by_ikey_for_joins(Rel * rel,
- Rel * index,
+group_clauses_by_ikey_for_joins(Rel *rel,
+ Rel *index,
int *indexkeys,
- Oid * classes,
- List * join_cinfo_list,
- List * restr_cinfo_list)
+ Oid *classes,
+ List *join_cinfo_list,
+ List *restr_cinfo_list)
{
List *curCinfo = NIL;
CInfo *matched_clause = (CInfo *) NULL;
*
*/
static CInfo *
-match_clause_to_indexkey(Rel * rel,
- Rel * index,
+match_clause_to_indexkey(Rel *rel,
+ Rel *index,
int indexkey,
int xclass,
- CInfo * clauseInfo,
+ CInfo *clauseInfo,
bool join)
{
Expr *clause = clauseInfo->clause;
* successfully cnfify()-ed). --Nels, Jan '93
*/
static bool
-pred_test(List * predicate_list, List * clauseinfo_list, List * joininfo_list)
+pred_test(List *predicate_list, List *clauseinfo_list, List *joininfo_list)
{
List *pred,
*items,
* expression.
*/
static bool
-one_pred_test(Expr * predicate, List * clauseinfo_list)
+one_pred_test(Expr *predicate, List *clauseinfo_list)
{
CInfo *clauseinfo;
List *item;
* expression.
*/
static bool
-one_pred_clause_expr_test(Expr * predicate, Node * clause)
+one_pred_clause_expr_test(Expr *predicate, Node *clause)
{
List *items,
*item;
* expression for a simple restriction clause.
*/
static bool
-one_pred_clause_test(Expr * predicate, Node * clause)
+one_pred_clause_test(Expr *predicate, Node *clause)
{
List *items,
*item;
* appropriate "RT_implic_table" array.
*/
static bool
-clause_pred_clause_test(Expr * predicate, Node * clause)
+clause_pred_clause_test(Expr *predicate, Node *clause)
{
Var *pred_var,
*clause_var;
*
*/
static List *
-indexable_joinclauses(Rel * rel, Rel * index,
- List * joininfo_list, List * clauseinfo_list)
+indexable_joinclauses(Rel *rel, Rel *index,
+ List *joininfo_list, List *clauseinfo_list)
{
JInfo *joininfo = (JInfo *) NULL;
List *cg_list = NIL;
*/
#ifdef NOT_USED
static List *
-extract_restrict_clauses(List * clausegroup)
+extract_restrict_clauses(List *clausegroup)
{
List *restrict_cls = NIL;
List *l;
*
*/
static List *
-index_innerjoin(Query * root, Rel * rel, List * clausegroup_list, Rel * index)
+index_innerjoin(Query *root, Rel *rel, List *clausegroup_list, Rel *index)
{
List *clausegroup = NIL;
List *cg_list = NIL;
*
*/
static List *
-create_index_paths(Query * root,
- Rel * rel,
- Rel * index,
- List * clausegroup_list,
+create_index_paths(Query *root,
+ Rel *rel,
+ Rel *index,
+ List *clausegroup_list,
bool join)
{
List *clausegroup = NIL;
}
static List *
-add_index_paths(List * indexpaths, List * new_indexpaths)
+add_index_paths(List *indexpaths, List *new_indexpaths)
{
return append(indexpaths, new_indexpaths);
}
static bool
-function_index_operand(Expr * funcOpnd, Rel * rel, Rel * index)
+function_index_operand(Expr *funcOpnd, Rel *rel, Rel *index)
{
Oid heapRelid = (Oid) lfirsti(rel->relids);
Func *function;
}
static bool
-SingleAttributeIndex(Rel * index)
+SingleAttributeIndex(Rel *index)
{
/*
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.4 1997/09/08 02:24:22 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinpath.c,v 1.5 1997/09/08 21:44:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "optimizer/cost.h" /* for _enable_{hashjoin,
* _enable_mergesort} */
-static Path *best_innerjoin(List * join_paths, List * outer_relid);
+static Path *best_innerjoin(List *join_paths, List *outer_relid);
static List *
-sort_inner_and_outer(Rel * joinrel, Rel * outerrel, Rel * innerrel,
- List * mergeinfo_list);
+sort_inner_and_outer(Rel *joinrel, Rel *outerrel, Rel *innerrel,
+ List *mergeinfo_list);
static List *
-match_unsorted_outer(Rel * joinrel, Rel * outerrel, Rel * innerrel,
- List * outerpath_list, Path * cheapest_inner, Path * best_innerjoin,
- List * mergeinfo_list);
+match_unsorted_outer(Rel *joinrel, Rel *outerrel, Rel *innerrel,
+ List *outerpath_list, Path *cheapest_inner, Path *best_innerjoin,
+ List *mergeinfo_list);
static List *
-match_unsorted_inner(Rel * joinrel, Rel * outerrel, Rel * innerrel,
- List * innerpath_list, List * mergeinfo_list);
-static bool EnoughMemoryForHashjoin(Rel * hashrel);
+match_unsorted_inner(Rel *joinrel, Rel *outerrel, Rel *innerrel,
+ List *innerpath_list, List *mergeinfo_list);
+static bool EnoughMemoryForHashjoin(Rel *hashrel);
static List *
-hash_inner_and_outer(Rel * joinrel, Rel * outerrel, Rel * innerrel,
- List * hashinfo_list);
+hash_inner_and_outer(Rel *joinrel, Rel *outerrel, Rel *innerrel,
+ List *hashinfo_list);
/*
* find-all-join-paths--
* It does a destructive modification.
*/
void
-find_all_join_paths(Query * root, List * joinrels)
+find_all_join_paths(Query *root, List *joinrels)
{
List *mergeinfo_list = NIL;
List *hashinfo_list = NIL;
* Returns the pathnode of the selected path.
*/
static Path *
-best_innerjoin(List * join_paths, List * outer_relids)
+best_innerjoin(List *join_paths, List *outer_relids)
{
Path *cheapest = (Path *) NULL;
List *join_path;
* Returns a list of mergesort paths.
*/
static List *
-sort_inner_and_outer(Rel * joinrel,
- Rel * outerrel,
- Rel * innerrel,
- List * mergeinfo_list)
+sort_inner_and_outer(Rel *joinrel,
+ Rel *outerrel,
+ Rel *innerrel,
+ List *mergeinfo_list)
{
List *ms_list = NIL;
MInfo *xmergeinfo = (MInfo *) NULL;
* Returns a list of possible join path nodes.
*/
static List *
-match_unsorted_outer(Rel * joinrel,
- Rel * outerrel,
- Rel * innerrel,
- List * outerpath_list,
- Path * cheapest_inner,
- Path * best_innerjoin,
- List * mergeinfo_list)
+match_unsorted_outer(Rel *joinrel,
+ Rel *outerrel,
+ Rel *innerrel,
+ List *outerpath_list,
+ Path *cheapest_inner,
+ Path *best_innerjoin,
+ List *mergeinfo_list)
{
Path *outerpath = (Path *) NULL;
List *jp_list = NIL;
* Returns a list of possible merge paths.
*/
static List *
-match_unsorted_inner(Rel * joinrel,
- Rel * outerrel,
- Rel * innerrel,
- List * innerpath_list,
- List * mergeinfo_list)
+match_unsorted_inner(Rel *joinrel,
+ Rel *outerrel,
+ Rel *innerrel,
+ List *innerpath_list,
+ List *mergeinfo_list)
{
Path *innerpath = (Path *) NULL;
List *mp_list = NIL;
}
static bool
-EnoughMemoryForHashjoin(Rel * hashrel)
+EnoughMemoryForHashjoin(Rel *hashrel)
{
int ntuples;
int tupsize;
* Returns a list of hashjoin paths.
*/
static List *
-hash_inner_and_outer(Rel * joinrel,
- Rel * outerrel,
- Rel * innerrel,
- List * hashinfo_list)
+hash_inner_and_outer(Rel *joinrel,
+ Rel *outerrel,
+ Rel *innerrel,
+ List *hashinfo_list)
{
HInfo *xhashinfo = (HInfo *) NULL;
List *hjoin_list = NIL;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.6 1997/09/08 02:24:23 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.7 1997/09/08 21:45:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#endif
-static List *find_clause_joins(Query * root, Rel * outer_rel, List * joininfo_list);
-static List *find_clauseless_joins(Rel * outer_rel, List * inner_rels);
-static Rel *init_join_rel(Rel * outer_rel, Rel * inner_rel, JInfo * joininfo);
+static List *find_clause_joins(Query *root, Rel *outer_rel, List *joininfo_list);
+static List *find_clauseless_joins(Rel *outer_rel, List *inner_rels);
+static Rel *init_join_rel(Rel *outer_rel, Rel *inner_rel, JInfo *joininfo);
static List *
-new_join_tlist(List * tlist, List * other_relids,
+new_join_tlist(List *tlist, List *other_relids,
int first_resdomno);
-static List *new_joininfo_list(List * joininfo_list, List * join_relids);
-static void add_superrels(Rel * rel, Rel * super_rel);
-static bool nonoverlap_rels(Rel * rel1, Rel * rel2);
-static bool nonoverlap_sets(List * s1, List * s2);
+static List *new_joininfo_list(List *joininfo_list, List *join_relids);
+static void add_superrels(Rel *rel, Rel *super_rel);
+static bool nonoverlap_rels(Rel *rel1, Rel *rel2);
+static bool nonoverlap_sets(List *s1, List *s2);
static void
-set_joinrel_size(Rel * joinrel, Rel * outer_rel, Rel * inner_rel,
- JInfo * jinfo);
+set_joinrel_size(Rel *joinrel, Rel *outer_rel, Rel *inner_rel,
+ JInfo *jinfo);
/*
* find-join-rels--
* Returns a list of rel nodes corresponding to the new join relations.
*/
List *
-find_join_rels(Query * root, List * outer_rels)
+find_join_rels(Query *root, List *outer_rels)
{
List *joins = NIL;
List *join_list = NIL;
* Returns a list of new join relations.
*/
static List *
-find_clause_joins(Query * root, Rel * outer_rel, List * joininfo_list)
+find_clause_joins(Query *root, Rel *outer_rel, List *joininfo_list)
{
List *join_list = NIL;
List *i = NIL;
* Returns a list of new join relations.
*/
static List *
-find_clauseless_joins(Rel * outer_rel, List * inner_rels)
+find_clauseless_joins(Rel *outer_rel, List *inner_rels)
{
Rel *inner_rel;
List *t_list = NIL;
* Returns the new join relation node.
*/
static Rel *
-init_join_rel(Rel * outer_rel, Rel * inner_rel, JInfo * joininfo)
+init_join_rel(Rel *outer_rel, Rel *inner_rel, JInfo *joininfo)
{
Rel *joinrel = makeNode(Rel);
List *joinrel_joininfo_list = NIL;
* Returns the new target list.
*/
static List *
-new_join_tlist(List * tlist,
- List * other_relids,
+new_join_tlist(List *tlist,
+ List *other_relids,
int first_resdomno)
{
int resdomno = first_resdomno - 1;
* Returns a list of joininfo nodes, new and old.
*/
static List *
-new_joininfo_list(List * joininfo_list, List * join_relids)
+new_joininfo_list(List *joininfo_list, List *join_relids)
{
List *current_joininfo_list = NIL;
List *new_otherrels = NIL;
* Modifies the joininfo field of appropriate rel nodes.
*/
void
-add_new_joininfos(Query * root, List * joinrels, List * outerrels)
+add_new_joininfos(Query *root, List *joinrels, List *outerrels)
{
List *xjoinrel = NIL;
List *xrelid = NIL;
* Returns the list of final join relations.
*/
List *
-final_join_rels(List * join_rel_list)
+final_join_rels(List *join_rel_list)
{
List *xrel = NIL;
List *temp = NIL;
* Modifies the superrels field of rel
*/
static void
-add_superrels(Rel * rel, Rel * super_rel)
+add_superrels(Rel *rel, Rel *super_rel)
{
rel->superrels = lappend(rel->superrels, super_rel);
}
* Returns non-nil if rel1 and rel2 do not overlap.
*/
static bool
-nonoverlap_rels(Rel * rel1, Rel * rel2)
+nonoverlap_rels(Rel *rel1, Rel *rel2)
{
return (nonoverlap_sets(rel1->relids, rel2->relids));
}
static bool
-nonoverlap_sets(List * s1, List * s2)
+nonoverlap_sets(List *s1, List *s2)
{
List *x = NIL;
}
static void
-set_joinrel_size(Rel * joinrel, Rel * outer_rel, Rel * inner_rel, JInfo * jinfo)
+set_joinrel_size(Rel *joinrel, Rel *outer_rel, Rel *inner_rel, JInfo *jinfo)
{
int ntuples;
float selec;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.3 1997/09/08 02:24:23 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/joinutils.c,v 1.4 1997/09/08 21:45:01 momjian Exp $
*
*-------------------------------------------------------------------------
*/
static int
-match_pathkey_joinkeys(List * pathkey, List * joinkeys,
+match_pathkey_joinkeys(List *pathkey, List *joinkeys,
int which_subkey);
static bool
-every_func(List * joinkeys, List * pathkey,
+every_func(List *joinkeys, List *pathkey,
int which_subkey);
static List *
-new_join_pathkey(List * subkeys,
- List * considered_subkeys, List * join_rel_tlist,
- List * joinclauses);
+new_join_pathkey(List *subkeys,
+ List *considered_subkeys, List *join_rel_tlist,
+ List *joinclauses);
static List *
-new_matching_subkeys(Var * subkey, List * considered_subkeys,
- List * join_rel_tlist, List * joinclauses);
+new_matching_subkeys(Var *subkey, List *considered_subkeys,
+ List *join_rel_tlist, List *joinclauses);
/****************************************************************************
* KEY COMPARISONS
* in matchedJoinClausesPtr. - ay 11/94
*/
List *
-match_pathkeys_joinkeys(List * pathkeys,
- List * joinkeys,
- List * joinclauses,
+match_pathkeys_joinkeys(List *pathkeys,
+ List *joinkeys,
+ List *joinclauses,
int which_subkey,
- List ** matchedJoinClausesPtr)
+ List **matchedJoinClausesPtr)
{
List *matched_joinkeys = NIL;
List *matched_joinclauses = NIL;
* outer or inner subkey matches any subkey of 'pathkey'.
*/
static int
-match_pathkey_joinkeys(List * pathkey,
- List * joinkeys,
+match_pathkey_joinkeys(List *pathkey,
+ List *joinkeys,
int which_subkey)
{
Var *path_subkey;
* Returns the matching path node if one exists, nil otherwise.
*/
static bool
-every_func(List * joinkeys, List * pathkey, int which_subkey)
+every_func(List *joinkeys, List *pathkey, int which_subkey)
{
JoinKey *xjoinkey;
Var *temp;
* find the cheapest path that matches the join keys
*/
Path *
-match_paths_joinkeys(List * joinkeys,
- PathOrder * ordering,
- List * paths,
+match_paths_joinkeys(List *joinkeys,
+ PathOrder *ordering,
+ List *paths,
int which_subkey)
{
Path *matched_path = NULL;
* [I've no idea why they have to be list of lists. Should be fixed. -ay 12/94]
*/
List *
-extract_path_keys(List * joinkeys,
- List * tlist,
+extract_path_keys(List *joinkeys,
+ List *tlist,
int which_subkey)
{
List *pathkeys = NIL;
*
*/
List *
-new_join_pathkeys(List * outer_pathkeys,
- List * join_rel_tlist,
- List * joinclauses)
+new_join_pathkeys(List *outer_pathkeys,
+ List *join_rel_tlist,
+ List *joinclauses)
{
List *outer_pathkey = NIL;
List *t_list = NIL;
*
*/
static List *
-new_join_pathkey(List * subkeys,
- List * considered_subkeys,
- List * join_rel_tlist,
- List * joinclauses)
+new_join_pathkey(List *subkeys,
+ List *considered_subkeys,
+ List *join_rel_tlist,
+ List *joinclauses)
{
List *t_list = NIL;
Var *subkey;
*
*/
static List *
-new_matching_subkeys(Var * subkey,
- List * considered_subkeys,
- List * join_rel_tlist,
- List * joinclauses)
+new_matching_subkeys(Var *subkey,
+ List *considered_subkeys,
+ List *join_rel_tlist,
+ List *joinclauses)
{
Expr *joinclause = NULL;
List *t_list = NIL;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/mergeutils.c,v 1.3 1997/09/08 02:24:24 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/mergeutils.c,v 1.4 1997/09/08 21:45:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*
*/
List *
-group_clauses_by_order(List * clauseinfo_list,
+group_clauses_by_order(List *clauseinfo_list,
int inner_relid)
{
List *mergeinfo_list = NIL;
*
*/
MInfo *
-match_order_mergeinfo(PathOrder * ordering, List * mergeinfo_list)
+match_order_mergeinfo(PathOrder *ordering, List *mergeinfo_list)
{
MergeOrder *xmergeorder;
List *xmergeinfo = NIL;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.3 1997/09/08 02:24:25 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/orindxpath.c,v 1.4 1997/09/08 21:45:04 momjian Exp $
*
*-------------------------------------------------------------------------
*/
static void
-best_or_subclause_indices(Query * root, Rel * rel, List * subclauses,
- List * indices, List * examined_indexids, Cost subcost, List * selectivities,
- List ** indexids, Cost * cost, List ** selecs);
+best_or_subclause_indices(Query *root, Rel *rel, List *subclauses,
+List *indices, List *examined_indexids, Cost subcost, List *selectivities,
+ List **indexids, Cost *cost, List **selecs);
static void
-best_or_subclause_index(Query * root, Rel * rel, Expr * subclause,
- List * indices, int *indexid, Cost * cost, Cost * selec);
+best_or_subclause_index(Query *root, Rel *rel, Expr *subclause,
+ List *indices, int *indexid, Cost *cost, Cost *selec);
/*
*
*/
List *
-create_or_index_paths(Query * root,
- Rel * rel, List * clauses)
+create_or_index_paths(Query *root,
+ Rel *rel, List *clauses)
{
List *t_list = NIL;
* 'cost' is a flonum, and 's' is a flonum.
*/
static void
-best_or_subclause_indices(Query * root,
- Rel * rel,
- List * subclauses,
- List * indices,
- List * examined_indexids,
+best_or_subclause_indices(Query *root,
+ Rel *rel,
+ List *subclauses,
+ List *indices,
+ List *examined_indexids,
Cost subcost,
- List * selectivities,
- List ** indexids, /* return value */
- Cost * cost, /* return value */
- List ** selecs) /* return value */
+ List *selectivities,
+ List **indexids, /* return value */
+ Cost *cost, /* return value */
+ List **selecs) /* return value */
{
if (subclauses == NIL)
{
*
*/
static void
-best_or_subclause_index(Query * root,
- Rel * rel,
- Expr * subclause,
- List * indices,
+best_or_subclause_index(Query *root,
+ Rel *rel,
+ Expr *subclause,
+ List *indices,
int *retIndexid, /* return value */
- Cost * retCost, /* return value */
- Cost * retSelec) /* return value */
+ Cost *retCost, /* return value */
+ Cost *retSelec) /* return value */
{
if (indices != NIL)
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/predmig.c,v 1.5 1997/09/08 20:56:03 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/predmig.c,v 1.6 1997/09/08 21:45:07 momjian Exp $
*
*-------------------------------------------------------------------------
*/
static void
xfunc_predmig(JoinPath pathnode, Stream streamroot,
- Stream laststream, bool * progressp);
+ Stream laststream, bool *progressp);
static bool xfunc_series_llel(Stream stream);
static bool xfunc_llel_chains(Stream root, Stream bottom);
static Stream xfunc_complete_stream(Stream stream);
static bool xfunc_check_stream(Stream node);
static bool xfunc_in_stream(Stream node, Stream stream);
-/* ----------------- MAIN FUNCTIONS ------------------------ */
+/* ----------------- MAIN FUNCTIONS ------------------------ */
/*
** xfunc_do_predmig
** wrapper for Predicate Migration. It calls xfunc_predmig until no
Stream laststream,/* for recursive calls -- these are the
* root of the stream under construction,
* and the lowest node created so far */
- bool * progressp)
+ bool *progressp)
{
Stream newstream;
** the same groupcost and groupsel (since they're in the same group!)
*/
static void
-xfunc_form_groups(Query * queryInfo, Stream root, Stream bottom)
+xfunc_form_groups(Query *queryInfo, Stream root, Stream bottom)
{
Stream temp,
parent;
}
-/* ------------------- UTILITY FUNCTIONS ------------------------- */
+/* ------------------- UTILITY FUNCTIONS ------------------------- */
/*
** xfunc_free_stream --
}
}
-/* ------------------ DEBUGGING ROUTINES ---------------------------- */
+/* ------------------ DEBUGGING ROUTINES ---------------------------- */
/*
** Make sure all pointers in stream make sense. Make sure no joins are
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.5 1997/09/08 02:24:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/prune.c,v 1.6 1997/09/08 21:45:08 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "utils/elog.h"
-static List *prune_joinrel(Rel * rel, List * other_rels);
+static List *prune_joinrel(Rel *rel, List *other_rels);
/*
* prune-joinrels--
*
*/
List *
-prune_joinrels(List * rel_list)
+prune_joinrels(List *rel_list)
{
List *temp_list = NIL;
*
*/
static List *
-prune_joinrel(Rel * rel, List * other_rels)
+prune_joinrel(Rel *rel, List *other_rels)
{
List *i = NIL;
List *t_list = NIL;
*
*/
void
-prune_rel_paths(List * rel_list)
+prune_rel_paths(List *rel_list)
{
List *x = NIL;
List *y = NIL;
*
*/
Path *
-prune_rel_path(Rel * rel, Path * unorderedpath)
+prune_rel_path(Rel *rel, Path *unorderedpath)
{
Path *cheapest = set_cheapest(rel, rel->pathlist);
* Returns one pruned rel node list
*/
List *
-merge_joinrels(List * rel_list1, List * rel_list2)
+merge_joinrels(List *rel_list1, List *rel_list2)
{
List *xrel = NIL;
* Returns a new list of rel nodes
*/
List *
-prune_oldrels(List * old_rels)
+prune_oldrels(List *old_rels)
{
Rel *rel;
List *joininfo_list,
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.5 1997/09/08 02:24:28 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.6 1997/09/08 21:45:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* local funcs */
static int
-xfunc_card_unreferenced(Query * queryInfo,
- Expr * clause, Relid referenced);
+xfunc_card_unreferenced(Query *queryInfo,
+ Expr *clause, Relid referenced);
*/
** XFUNC_JOINPRD if a secondary join predicate is to be pulled up
*/
int
-xfunc_shouldpull(Query * queryInfo,
+xfunc_shouldpull(Query *queryInfo,
Path childpath,
JoinPath parentpath,
int whichchild,
- CInfo * maxcinfopt) /* Out: pointer to clause to
+ CInfo *maxcinfopt) /* Out: pointer to clause to
* pullup */
{
LispValue clauselist,
|| (!is_join(childpath)
&& (whichchild == INNER)
&& IsA(parentpath, JoinPath)
- && !IsA(parentpath, HashPath)
- && !IsA(parentpath, MergePath)))))
+ &&!IsA(parentpath, HashPath)
+ &&!IsA(parentpath, MergePath)))))
{
*maxcinfopt = maxcinfo;
** Now returns a pointer to the new pulled-up CInfo. -- JMH, 11/18/92
*/
CInfo
-xfunc_pullup(Query * queryInfo,
+xfunc_pullup(Query *queryInfo,
Path childpath,
JoinPath parentpath,
CInfo cinfo, /* clause to pull up */
** calculate (selectivity-1)/cost.
*/
Cost
-xfunc_rank(Query * queryInfo, LispValue clause)
+xfunc_rank(Query *queryInfo, LispValue clause)
{
Cost selec = compute_clause_selec(queryInfo, clause, LispNil);
Cost cost = xfunc_expense(queryInfo, clause);
** referenced in the clause.
*/
Cost
-xfunc_expense(Query * queryInfo, clause)
+xfunc_expense(Query *queryInfo, clause)
LispValue clause;
{
Cost cost = xfunc_local_expense(clause);
** Find global expense of a join clause
*/
Cost
-xfunc_join_expense(Query * queryInfo, JoinPath path, int whichchild)
+xfunc_join_expense(Query *queryInfo, JoinPath path, int whichchild)
{
LispValue primjoinclause = xfunc_primary_join(path);
LispValue tmpclause;
/* First handle the base case */
- if (IsA(clause, Const) || IsA(clause, Var) || IsA(clause, Param))
+ if (IsA(clause, Const) ||IsA(clause, Var) ||IsA(clause, Param))
return (0);
/* now other stuff */
else if (IsA(clause, Iter))
LispValue tmpplan;
List planlist;
- if (IsA(node, Oper) || get_func_planlist((Func) node) == LispNil)
+ if (IsA(node, Oper) ||get_func_planlist((Func) node) == LispNil)
{
Oid *argOidVect; /* vector of argtypes */
char *pq_src; /* text of PQ function */
** for joins).
*/
static Count
-xfunc_card_unreferenced(Query * queryInfo,
+xfunc_card_unreferenced(Query *queryInfo,
LispValue clause, Relid referenced)
{
Relid unreferenced,
** multiple together cardinalities of a list relations.
*/
Count
-xfunc_card_product(Query * queryInfo, Relid relids)
+xfunc_card_product(Query *queryInfo, Relid relids)
{
LispValue cinfonode;
LispValue temp;
/* Base cases */
if (IsA(clause, Var))
return (lispCons(lfirst(get_varid((Var) clause)), LispNil));
- else if (IsA(clause, Const) || IsA(clause, Param))
+ else if (IsA(clause, Const) ||IsA(clause, Param))
return ((List) LispNil);
/* recursion */
** get the expensive function costs of the path
*/
Cost
-xfunc_get_path_cost(Query * queryInfo, Path pathnode)
+xfunc_get_path_cost(Query *queryInfo, Path pathnode)
{
Cost cost = 0;
LispValue tmplist;
}
else if (IsA(pathnode, HashPath))
{
- HashPath hashnode = (HashPath) pathnode;
+ HashPath hashnode = (HashPath) pathnode;
cost += cost_hashjoin(get_path_cost((Path) get_outerjoinpath(hashnode)),
get_path_cost((Path) get_innerjoinpath(hashnode)),
TargetEntry *tle; /* tlist member corresponding to var */
- if (IsA(clause, Const) || IsA(clause, Param))
+ if (IsA(clause, Const) ||IsA(clause, Param))
return;
else if (IsA(clause, Var))
{
** arg1 and arg2 are really pointers to disjuncts
*/
int
-xfunc_disjunct_compare(Query * queryInfo, void *arg1, void *arg2)
+xfunc_disjunct_compare(Query *queryInfo, void *arg1, void *arg2)
{
LispValue disjunct1 = *(LispValue *) arg1;
LispValue disjunct2 = *(LispValue *) arg2;
** Just like _copyRel, but doesn't copy the paths
*/
bool
-xfunc_copyrel(Rel from, Rel * to)
+xfunc_copyrel(Rel from, Rel *to)
{
Rel newnode;
- Pointer(*alloc) () = palloc;
+ Pointer (*alloc) () = palloc;
/* COPY_CHECKARGS() */
if (to == NULL)
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.14 1997/09/08 20:56:10 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.15 1997/09/08 21:45:13 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define TEMP_SORT 1
#define TEMP_MATERIAL 2
-static List *switch_outer(List * clauses);
-static Scan *create_scan_node(Path * best_path, List * tlist);
-static Join *create_join_node(JoinPath * best_path, List * tlist);
+static List *switch_outer(List *clauses);
+static Scan *create_scan_node(Path *best_path, List *tlist);
+static Join *create_join_node(JoinPath *best_path, List *tlist);
static SeqScan *
-create_seqscan_node(Path * best_path, List * tlist,
- List * scan_clauses);
+create_seqscan_node(Path *best_path, List *tlist,
+ List *scan_clauses);
static IndexScan *
-create_indexscan_node(IndexPath * best_path, List * tlist,
- List * scan_clauses);
+create_indexscan_node(IndexPath *best_path, List *tlist,
+ List *scan_clauses);
static NestLoop *
-create_nestloop_node(JoinPath * best_path, List * tlist,
- List * clauses, Plan * outer_node, List * outer_tlist,
- Plan * inner_node, List * inner_tlist);
+create_nestloop_node(JoinPath *best_path, List *tlist,
+ List *clauses, Plan *outer_node, List *outer_tlist,
+ Plan *inner_node, List *inner_tlist);
static MergeJoin *
-create_mergejoin_node(MergePath * best_path, List * tlist,
- List * clauses, Plan * outer_node, List * outer_tlist,
- Plan * inner_node, List * inner_tlist);
+create_mergejoin_node(MergePath *best_path, List *tlist,
+ List *clauses, Plan *outer_node, List *outer_tlist,
+ Plan *inner_node, List *inner_tlist);
static HashJoin *
-create_hashjoin_node(HashPath * best_path, List * tlist,
- List * clauses, Plan * outer_node, List * outer_tlist,
- Plan * inner_node, List * inner_tlist);
-static Node *fix_indxqual_references(Node * clause, Path * index_path);
+create_hashjoin_node(HashPath *best_path, List *tlist,
+ List *clauses, Plan *outer_node, List *outer_tlist,
+ Plan *inner_node, List *inner_tlist);
+static Node *fix_indxqual_references(Node *clause, Path *index_path);
static Temp *
-make_temp(List * tlist, List * keys, Oid * operators,
- Plan * plan_node, int temptype);
+make_temp(List *tlist, List *keys, Oid *operators,
+ Plan *plan_node, int temptype);
static IndexScan *
-make_indexscan(List * qptlist, List * qpqual, Index scanrelid,
- List * indxid, List * indxqual);
+make_indexscan(List *qptlist, List *qpqual, Index scanrelid,
+ List *indxid, List *indxqual);
static NestLoop *
-make_nestloop(List * qptlist, List * qpqual, Plan * lefttree,
- Plan * righttree);
+make_nestloop(List *qptlist, List *qpqual, Plan *lefttree,
+ Plan *righttree);
static HashJoin *
-make_hashjoin(List * tlist, List * qpqual,
- List * hashclauses, Plan * lefttree, Plan * righttree);
-static Hash *make_hash(List * tlist, Var * hashkey, Plan * lefttree);
+make_hashjoin(List *tlist, List *qpqual,
+ List *hashclauses, Plan *lefttree, Plan *righttree);
+static Hash *make_hash(List *tlist, Var *hashkey, Plan *lefttree);
static MergeJoin *
-make_mergesort(List * tlist, List * qpqual,
- List * mergeclauses, Oid opcode, Oid * rightorder,
- Oid * leftorder, Plan * righttree, Plan * lefttree);
+make_mergesort(List *tlist, List *qpqual,
+ List *mergeclauses, Oid opcode, Oid *rightorder,
+ Oid *leftorder, Plan *righttree, Plan *lefttree);
static Material *
-make_material(List * tlist, Oid tempid, Plan * lefttree,
+make_material(List *tlist, Oid tempid, Plan *lefttree,
int keycount);
/*
* Returns the optimal(?) access plan.
*/
Plan *
-create_plan(Path * best_path)
+create_plan(Path *best_path)
{
List *tlist;
Plan *plan_node = (Plan *) NULL;
* Returns the scan node.
*/
static Scan *
-create_scan_node(Path * best_path, List * tlist)
+create_scan_node(Path *best_path, List *tlist)
{
Scan *node = NULL;
* Returns the join node.
*/
static Join *
-create_join_node(JoinPath * best_path, List * tlist)
+create_join_node(JoinPath *best_path, List *tlist)
{
Plan *outer_node;
List *outer_tlist;
* with restriction clauses 'scan-clauses' and targetlist 'tlist'.
*/
static SeqScan *
-create_seqscan_node(Path * best_path, List * tlist, List * scan_clauses)
+create_seqscan_node(Path *best_path, List *tlist, List *scan_clauses)
{
SeqScan *scan_node = (SeqScan *) NULL;
Index scan_relid = -1;
* with restriction clauses 'scan-clauses' and targetlist 'tlist'.
*/
static IndexScan *
-create_indexscan_node(IndexPath * best_path,
- List * tlist,
- List * scan_clauses)
+create_indexscan_node(IndexPath *best_path,
+ List *tlist,
+ List *scan_clauses)
{
/*
*****************************************************************************/
static NestLoop *
-create_nestloop_node(JoinPath * best_path,
- List * tlist,
- List * clauses,
- Plan * outer_node,
- List * outer_tlist,
- Plan * inner_node,
- List * inner_tlist)
+create_nestloop_node(JoinPath *best_path,
+ List *tlist,
+ List *clauses,
+ Plan *outer_node,
+ List *outer_tlist,
+ Plan *inner_node,
+ List *inner_tlist)
{
NestLoop *join_node = (NestLoop *) NULL;
}
static MergeJoin *
-create_mergejoin_node(MergePath * best_path,
- List * tlist,
- List * clauses,
- Plan * outer_node,
- List * outer_tlist,
- Plan * inner_node,
- List * inner_tlist)
+create_mergejoin_node(MergePath *best_path,
+ List *tlist,
+ List *clauses,
+ Plan *outer_node,
+ List *outer_tlist,
+ Plan *inner_node,
+ List *inner_tlist)
{
List *qpqual,
*mergeclauses;
* these?? at runtime? what about a hash index?
*/
static HashJoin *
-create_hashjoin_node(HashPath * best_path,
- List * tlist,
- List * clauses,
- Plan * outer_node,
- List * outer_tlist,
- Plan * inner_node,
- List * inner_tlist)
+create_hashjoin_node(HashPath *best_path,
+ List *tlist,
+ List *clauses,
+ Plan *outer_node,
+ List *outer_tlist,
+ Plan *inner_node,
+ List *inner_tlist)
{
List *qpqual;
List *hashclauses;
*****************************************************************************/
static Node *
-fix_indxqual_references(Node * clause, Path * index_path)
+fix_indxqual_references(Node *clause, Path *index_path)
{
Node *newclause;
* XXX Shouldn't the operator be commuted?!
*/
static List *
-switch_outer(List * clauses)
+switch_outer(List *clauses)
{
List *t_list = NIL;
Expr *temp = NULL;
* Returns the modified target list.
*/
static List *
-set_temp_tlist_operators(List * tlist, List * pathkeys, Oid * operators)
+set_temp_tlist_operators(List *tlist, List *pathkeys, Oid *operators)
{
Node *keys = NULL;
int keyno = 1;
* 'temptype' indicates which operation(sort or hash) to perform
*/
static Temp *
-make_temp(List * tlist,
- List * keys,
- Oid * operators,
- Plan * plan_node,
+make_temp(List *tlist,
+ List *keys,
+ Oid *operators,
+ Plan *plan_node,
int temptype)
{
List *temp_tlist;
SeqScan *
-make_seqscan(List * qptlist,
- List * qpqual,
+make_seqscan(List *qptlist,
+ List *qpqual,
Index scanrelid,
- Plan * lefttree)
+ Plan *lefttree)
{
SeqScan *node = makeNode(SeqScan);
Plan *plan = &node->plan;
}
static IndexScan *
-make_indexscan(List * qptlist,
- List * qpqual,
+make_indexscan(List *qptlist,
+ List *qpqual,
Index scanrelid,
- List * indxid,
- List * indxqual)
+ List *indxid,
+ List *indxqual)
{
IndexScan *node = makeNode(IndexScan);
Plan *plan = &node->scan.plan;
static NestLoop *
-make_nestloop(List * qptlist,
- List * qpqual,
- Plan * lefttree,
- Plan * righttree)
+make_nestloop(List *qptlist,
+ List *qpqual,
+ Plan *lefttree,
+ Plan *righttree)
{
NestLoop *node = makeNode(NestLoop);
Plan *plan = &node->join;
}
static HashJoin *
-make_hashjoin(List * tlist,
- List * qpqual,
- List * hashclauses,
- Plan * lefttree,
- Plan * righttree)
+make_hashjoin(List *tlist,
+ List *qpqual,
+ List *hashclauses,
+ Plan *lefttree,
+ Plan *righttree)
{
HashJoin *node = makeNode(HashJoin);
Plan *plan = &node->join;
}
static Hash *
-make_hash(List * tlist, Var * hashkey, Plan * lefttree)
+make_hash(List *tlist, Var *hashkey, Plan *lefttree)
{
Hash *node = makeNode(Hash);
Plan *plan = &node->plan;
}
static MergeJoin *
-make_mergesort(List * tlist,
- List * qpqual,
- List * mergeclauses,
+make_mergesort(List *tlist,
+ List *qpqual,
+ List *mergeclauses,
Oid opcode,
- Oid * rightorder,
- Oid * leftorder,
- Plan * righttree,
- Plan * lefttree)
+ Oid *rightorder,
+ Oid *leftorder,
+ Plan *righttree,
+ Plan *lefttree)
{
MergeJoin *node = makeNode(MergeJoin);
Plan *plan = &node->join;
}
Sort *
-make_sort(List * tlist, Oid tempid, Plan * lefttree, int keycount)
+make_sort(List *tlist, Oid tempid, Plan *lefttree, int keycount)
{
Sort *node = makeNode(Sort);
Plan *plan = &node->plan;
}
static Material *
-make_material(List * tlist,
+make_material(List *tlist,
Oid tempid,
- Plan * lefttree,
+ Plan *lefttree,
int keycount)
{
Material *node = makeNode(Material);
}
Agg *
-make_agg(List * tlist, int nagg, Aggreg **aggs)
+make_agg(List *tlist, int nagg, Aggreg **aggs)
{
Agg *node = makeNode(Agg);
}
Group *
-make_group(List * tlist,
+make_group(List *tlist,
bool tuplePerGroup,
int ngrp,
AttrNumber *grpColIdx,
- Sort * lefttree)
+ Sort *lefttree)
{
Group *node = makeNode(Group);
*/
Unique *
-make_unique(List * tlist, Plan * lefttree, char *uniqueAttr)
+make_unique(List *tlist, Plan *lefttree, char *uniqueAttr)
{
Unique *node = makeNode(Unique);
Plan *plan = &node->plan;
}
List *
-generate_fjoin(List * tlist)
+generate_fjoin(List *tlist)
{
#if 0
List tlistP;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.7 1997/09/08 02:24:36 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.8 1997/09/08 21:45:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern int Quiet;
-static void add_clause_to_rels(Query * root, List * clause);
+static void add_clause_to_rels(Query *root, List *clause);
static void
-add_join_clause_info_to_rels(Query * root, CInfo * clauseinfo,
- List * join_relids);
-static void add_vars_to_rels(Query * root, List * vars, List * join_relids);
+add_join_clause_info_to_rels(Query *root, CInfo *clauseinfo,
+ List *join_relids);
+static void add_vars_to_rels(Query *root, List *vars, List *join_relids);
-static MergeOrder *mergesortop(Expr * clause);
-static Oid hashjoinop(Expr * clause);
+static MergeOrder *mergesortop(Expr *clause);
+static Oid hashjoinop(Expr *clause);
/*****************************************************************************
* Returns nothing.
*/
void
-initialize_base_rels_list(Query * root, List * tlist)
+initialize_base_rels_list(Query *root, List *tlist)
{
List *tlist_vars = NIL;
List *l = NIL;
* into a join.
*/
void
-add_missing_vars_to_base_rels(Query * root, List * tlist)
+add_missing_vars_to_base_rels(Query *root, List *tlist)
{
List *l;
int varno;
* Returns nothing of interest.
*/
void
-initialize_base_rels_jinfo(Query * root, List * clauses)
+initialize_base_rels_jinfo(Query *root, List *clauses)
{
List *clause;
* Returns nothing of interest.
*/
static void
-add_clause_to_rels(Query * root, List * clause)
+add_clause_to_rels(Query *root, List *clause)
{
List *relids;
List *vars;
*
*/
static void
-add_join_clause_info_to_rels(Query * root, CInfo * clauseinfo, List * join_relids)
+add_join_clause_info_to_rels(Query *root, CInfo *clauseinfo, List *join_relids)
{
List *join_relid;
* Returns nothing.
*/
static void
-add_vars_to_rels(Query * root, List * vars, List * join_relids)
+add_vars_to_rels(Query *root, List *vars, List *join_relids)
{
Var *var;
List *temp = NIL;
* Returns nothing.
*/
void
-initialize_join_clause_info(List * rel_list)
+initialize_join_clause_info(List *rel_list)
{
List *x,
*y,
* a mergesortable operator.
*/
static MergeOrder *
-mergesortop(Expr * clause)
+mergesortop(Expr *clause)
{
Oid leftOp,
rightOp;
* a hashjoinable operator.
*/
static Oid
-hashjoinop(Expr * clause)
+hashjoinop(Expr *clause)
{
return (op_hashjoinable(((Oper *) clause->oper)->opno,
(get_leftop(clause))->vartype,
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.6 1997/09/08 02:24:37 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.7 1997/09/08 21:45:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "utils/mcxt.h"
#include "utils/lsyscache.h"
-static Plan *subplanner(Query * root, List * flat_tlist, List * qual);
-static Result *make_result(List * tlist, Node * resconstantqual, Plan * subplan);
+static Plan *subplanner(Query *root, List *flat_tlist, List *qual);
+static Result *make_result(List *tlist, Node *resconstantqual, Plan *subplan);
static Plan *
-make_groupPlan(List ** tlist, bool tuplePerGroup,
- List * groupClause, Plan * subplan);
+make_groupPlan(List **tlist, bool tuplePerGroup,
+ List *groupClause, Plan *subplan);
/*
* query_planner--
* Returns a query plan.
*/
Plan *
-query_planner(Query * root,
+query_planner(Query *root,
int command_type,
- List * tlist,
- List * qual)
+ List *tlist,
+ List *qual)
{
List *constant_qual = NIL;
List *flattened_tlist = NIL;
*
*/
static Plan *
-subplanner(Query * root,
- List * flat_tlist,
- List * qual)
+subplanner(Query *root,
+ List *flat_tlist,
+ List *qual)
{
Rel *final_relation;
List *final_relation_list;
*****************************************************************************/
static Result *
-make_result(List * tlist,
- Node * resconstantqual,
- Plan * subplan)
+make_result(List *tlist,
+ Node *resconstantqual,
+ Plan *subplan)
{
Result *node = makeNode(Result);
Plan *plan = &node->plan;
*****************************************************************************/
static Plan *
-make_groupPlan(List ** tlist,
+make_groupPlan(List **tlist,
bool tuplePerGroup,
- List * groupClause,
- Plan * subplan)
+ List *groupClause,
+ Plan *subplan)
{
List *sort_tlist;
List *sl,
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.8 1997/09/08 02:24:38 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.9 1997/09/08 21:45:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "executor/executor.h"
-static Plan *make_sortplan(List * tlist, List * sortcls, Plan * plannode);
-static Plan *init_query_planner(Query * parse);
-static Existential *make_existential(Plan * left, Plan * right);
+static Plan *make_sortplan(List *tlist, List *sortcls, Plan *plannode);
+static Plan *init_query_planner(Query *parse);
+static Existential *make_existential(Plan *left, Plan *right);
/*****************************************************************************
*
*
*/
Plan *
-planner(Query * parse)
+planner(Query *parse)
{
List *tlist = parse->targetList;
List *rangetable = parse->rtable;
* sortops: (sortop1 sortop2 sortop3 ...)
*/
static Plan *
-make_sortplan(List * tlist, List * sortcls, Plan * plannode)
+make_sortplan(List *tlist, List *sortcls, Plan *plannode)
{
Plan *sortplan = (Plan *) NULL;
List *temp_tlist = NIL;
*
*/
static Plan *
-init_query_planner(Query * root)
+init_query_planner(Query *root)
{
List *primary_qual;
List *existential_qual;
* the left and right subtree slots.
*/
static Existential *
-make_existential(Plan * left, Plan * right)
+make_existential(Plan *left, Plan *right)
{
Existential *node = makeNode(Existential);
* type he claims.
*/
void
-pg_checkretval(Oid rettype, QueryTreeList * queryTreeList)
+pg_checkretval(Oid rettype, QueryTreeList *queryTreeList)
{
Query *parse;
List *tlist;
tletype = (Oid) ((Param *) thenode)->paramtype;
else if (IsA(thenode, Expr))
tletype = Expr;
+
else if (IsA(thenode, LispList))
{
thenode = lfirst(thenode);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.7 1997/09/08 20:56:16 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.8 1997/09/08 21:45:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "optimizer/var.h"
#include "optimizer/tlist.h"
-static void set_join_tlist_references(Join * join);
-static void set_tempscan_tlist_references(SeqScan * tempscan);
-static void set_temp_tlist_references(Temp * temp);
+static void set_join_tlist_references(Join *join);
+static void set_tempscan_tlist_references(SeqScan *tempscan);
+static void set_temp_tlist_references(Temp *temp);
static List *
-replace_clause_joinvar_refs(Expr * clause,
- List * outer_tlist, List * inner_tlist);
+replace_clause_joinvar_refs(Expr *clause,
+ List *outer_tlist, List *inner_tlist);
static List *
-replace_subclause_joinvar_refs(List * clauses,
- List * outer_tlist, List * inner_tlist);
-static Var *replace_joinvar_refs(Var * var, List * outer_tlist, List * inner_tlist);
-static List *tlist_temp_references(Oid tempid, List * tlist);
-static void replace_result_clause(List * clause, List * subplanTargetList);
-static bool OperandIsInner(Node * opnd, int inner_relid);
-static void replace_agg_clause(Node * expr, List * targetlist);
+replace_subclause_joinvar_refs(List *clauses,
+ List *outer_tlist, List *inner_tlist);
+static Var *replace_joinvar_refs(Var *var, List *outer_tlist, List *inner_tlist);
+static List *tlist_temp_references(Oid tempid, List *tlist);
+static void replace_result_clause(List *clause, List *subplanTargetList);
+static bool OperandIsInner(Node *opnd, int inner_relid);
+static void replace_agg_clause(Node *expr, List *targetlist);
/*****************************************************************************
*
*
*/
void
-set_tlist_references(Plan * plan)
+set_tlist_references(Plan *plan)
{
if (plan == NULL)
return;
{
set_join_tlist_references((Join *) plan);
}
- else if (IsA(plan, SeqScan) && plan->lefttree &&
+ else if (IsA(plan, SeqScan) &&plan->lefttree &&
IsA_Temp(plan->lefttree))
{
set_tempscan_tlist_references((SeqScan *) plan);
*
*/
static void
-set_join_tlist_references(Join * join)
+set_join_tlist_references(Join *join)
{
Plan *outer = ((Plan *) join)->lefttree;
Plan *inner = ((Plan *) join)->righttree;
*
*/
static void
-set_tempscan_tlist_references(SeqScan * tempscan)
+set_tempscan_tlist_references(SeqScan *tempscan)
{
Temp *temp = (Temp *) ((Plan *) tempscan)->lefttree;
*
*/
static void
-set_temp_tlist_references(Temp * temp)
+set_temp_tlist_references(Temp *temp)
{
Plan *source = ((Plan *) temp)->lefttree;
*
*/
List *
-join_references(List * clauses,
- List * outer_tlist,
- List * inner_tlist)
+join_references(List *clauses,
+ List *outer_tlist,
+ List *inner_tlist)
{
return (replace_subclause_joinvar_refs(clauses,
outer_tlist,
*
*/
List *
-index_outerjoin_references(List * inner_indxqual,
- List * outer_tlist,
+index_outerjoin_references(List *inner_indxqual,
+ List *outer_tlist,
Index inner_relid)
{
List *t_list = NIL;
*
*/
static List *
-replace_clause_joinvar_refs(Expr * clause,
- List * outer_tlist,
- List * inner_tlist)
+replace_clause_joinvar_refs(Expr *clause,
+ List *outer_tlist,
+ List *inner_tlist)
{
List *temp = NULL;
}
static List *
-replace_subclause_joinvar_refs(List * clauses,
- List * outer_tlist,
- List * inner_tlist)
+replace_subclause_joinvar_refs(List *clauses,
+ List *outer_tlist,
+ List *inner_tlist)
{
List *t_list = NIL;
List *temp = NIL;
}
static Var *
-replace_joinvar_refs(Var * var, List * outer_tlist, List * inner_tlist)
+replace_joinvar_refs(Var *var, List *outer_tlist, List *inner_tlist)
{
Resdom *outer_resdom = (Resdom *) NULL;
*/
static List *
tlist_temp_references(Oid tempid,
- List * tlist)
+ List *tlist)
{
List *t_list = NIL;
TargetEntry *temp = (TargetEntry *) NULL;
* fields....
*/
void
-set_result_tlist_references(Result * resultNode)
+set_result_tlist_references(Result *resultNode)
{
Plan *subplan;
List *resultTargetList;
*
*/
static void
-replace_result_clause(List * clause,
- List * subplanTargetList) /* target list of the
+replace_result_clause(List *clause,
+ List *subplanTargetList) /* target list of the
* subplan */
{
List *t;
subClause = (List *) get_rightop((Expr *) clause);
replace_result_clause(subClause, subplanTargetList);
}
- else if (IsA(clause, Param) || IsA(clause, Const))
+ else if (IsA(clause, Param) ||IsA(clause, Const))
{
/* do nothing! */
}
}
static
- bool
-OperandIsInner(Node * opnd, int inner_relid)
+bool
+OperandIsInner(Node *opnd, int inner_relid)
{
/*
}
static void
-replace_agg_clause(Node * clause, List * subplanTargetList)
+replace_agg_clause(Node *clause, List *subplanTargetList)
{
List *t;
TargetEntry *subplanVar;
if (right != (Node *) NULL)
replace_agg_clause(right, subplanTargetList);
}
- else if (IsA(clause, Param) || IsA(clause, Const))
+ else if (IsA(clause, Param) ||IsA(clause, Const))
{
/* do nothing! */
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/Attic/archive.c,v 1.3 1997/09/08 02:24:41 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/Attic/archive.c,v 1.4 1997/09/08 21:45:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "commands/creatinh.h"
void
-plan_archive(List * rt)
+plan_archive(List *rt)
{
List *rtitem;
RangeTblEntry *rte;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepqual.c,v 1.5 1997/09/08 02:24:42 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepqual.c,v 1.6 1997/09/08 21:45:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "utils/lsyscache.h"
-static Expr *pull_args(Expr * qual);
-static List *pull_ors(List * orlist);
-static List *pull_ands(List * andlist);
-static Expr *find_nots(Expr * qual);
-static Expr *push_nots(Expr * qual);
-static Expr *normalize(Expr * qual);
-static List *or_normalize(List * orlist);
-static List *distribute_args(List * item, List * args);
-static List *qualcleanup(Expr * qual);
-static List *remove_ands(Expr * qual);
-static List *remove_duplicates(List * list);
+static Expr *pull_args(Expr *qual);
+static List *pull_ors(List *orlist);
+static List *pull_ands(List *andlist);
+static Expr *find_nots(Expr *qual);
+static Expr *push_nots(Expr *qual);
+static Expr *normalize(Expr *qual);
+static List *or_normalize(List *orlist);
+static List *distribute_args(List *item, List *args);
+static List *qualcleanup(Expr *qual);
+static List *remove_ands(Expr *qual);
+static List *remove_duplicates(List *list);
/*
* preprocess-qualification--
* normal form (see cnfify() below )
*/
List *
-preprocess_qualification(Expr * qual, List * tlist, List ** existentialQualPtr)
+preprocess_qualification(Expr *qual, List *tlist, List **existentialQualPtr)
{
List *cnf_qual = cnfify(qual, true);
*
*/
List *
-cnfify(Expr * qual, bool removeAndFlag)
+cnfify(Expr *qual, bool removeAndFlag)
{
Expr *newqual = NULL;
*
*/
static Expr *
-pull_args(Expr * qual)
+pull_args(Expr *qual)
{
if (qual == NULL)
return (NULL);
* Returns the modified list.
*/
static List *
-pull_ors(List * orlist)
+pull_ors(List *orlist)
{
if (orlist == NIL)
return (NIL);
* Returns the modified list.
*/
static List *
-pull_ands(List * andlist)
+pull_ands(List *andlist)
{
if (andlist == NIL)
return (NIL);
*
*/
static Expr *
-find_nots(Expr * qual)
+find_nots(Expr *qual)
{
if (qual == NULL)
return (NULL);
*
*/
static Expr *
-push_nots(Expr * qual)
+push_nots(Expr *qual)
{
if (qual == NULL)
return (NULL);
*
*/
static Expr *
-normalize(Expr * qual)
+normalize(Expr *qual)
{
if (qual == NULL)
return (NULL);
*
*/
static List *
-or_normalize(List * orlist)
+or_normalize(List *orlist)
{
List *distributable = NIL;
List *new_orlist = NIL;
*
*/
static List *
-distribute_args(List * item, List * args)
+distribute_args(List *item, List *args)
{
List *or_list = NIL;
List *n_list = NIL;
*
*/
static List *
-qualcleanup(Expr * qual)
+qualcleanup(Expr *qual)
{
if (qual == NULL)
return (NIL);
* MODIFIES: qual
*/
static List *
-remove_ands(Expr * qual)
+remove_ands(Expr *qual)
{
List *t_list = NIL;
*/
#ifdef NOT_USED
static List *
-update_relations(List * tlist)
+update_relations(List *tlist)
{
return (NIL);
}
*****************************************************************************/
static List *
-remove_duplicates(List * list)
+remove_duplicates(List *list)
{
List *i;
List *j;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.4 1997/09/08 02:24:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/preptlist.c,v 1.5 1997/09/08 21:45:36 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "optimizer/tlist.h"
static List *
-expand_targetlist(List * tlist, Oid relid, int command_type,
+expand_targetlist(List *tlist, Oid relid, int command_type,
Index result_relation);
static List *
-replace_matching_resname(List * new_tlist,
- List * old_tlist);
+replace_matching_resname(List *new_tlist,
+ List *old_tlist);
static List *
new_relation_targetlist(Oid relid, Index rt_index,
NodeTag node_type);
* Returns the new targetlist.
*/
List *
-preprocess_targetlist(List * tlist,
+preprocess_targetlist(List *tlist,
int command_type,
Index result_relation,
- List * range_table)
+ List *range_table)
{
List *expanded_tlist = NIL;
Oid relid = InvalidOid;
* Returns the expanded target list, sorted in resno order.
*/
static List *
-expand_targetlist(List * tlist,
+expand_targetlist(List *tlist,
Oid relid,
int command_type,
Index result_relation)
static List *
-replace_matching_resname(List * new_tlist, List * old_tlist)
+replace_matching_resname(List *new_tlist, List *old_tlist)
{
List *temp,
*i;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.5 1997/09/08 02:24:47 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.6 1997/09/08 21:45:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "optimizer/prep.h"
static List *
-plan_union_query(List * relids, Index rt_index,
- RangeTblEntry * rt_entry, Query * parse, UnionFlag flag,
- List ** union_rtentriesPtr);
+plan_union_query(List *relids, Index rt_index,
+ RangeTblEntry *rt_entry, Query *parse, UnionFlag flag,
+ List **union_rtentriesPtr);
static RangeTblEntry *
new_rangetable_entry(Oid new_relid,
- RangeTblEntry * old_entry);
+ RangeTblEntry *old_entry);
static Query *
-subst_rangetable(Query * root, Index index,
- RangeTblEntry * new_entry);
+subst_rangetable(Query *root, Index index,
+ RangeTblEntry *new_entry);
static void
fix_parsetree_attnums(Index rt_index, Oid old_relid,
- Oid new_relid, Query * parsetree);
+ Oid new_relid, Query *parsetree);
static Append *
-make_append(List * unionplans, Index rt_index,
- List * union_rt_entries, List * tlist);
+make_append(List *unionplans, Index rt_index,
+ List *union_rt_entries, List *tlist);
/*
* lists.
*/
List *
-find_all_inheritors(List * unexamined_relids,
- List * examined_relids)
+find_all_inheritors(List *unexamined_relids,
+ List *examined_relids)
{
List *new_inheritors = NIL;
List *new_examined_relids = NIL;
* Returns a rangetable index., Returns -1 if no matches
*/
int
-first_matching_rt_entry(List * rangetable, UnionFlag flag)
+first_matching_rt_entry(List *rangetable, UnionFlag flag)
{
int count = 0;
List *temp = NIL;
*/
Append *
plan_union_queries(Index rt_index,
- Query * parse,
+ Query *parse,
UnionFlag flag)
{
List *rangetable = parse->rtable;
* in union_rtentries.
*/
static List *
-plan_union_query(List * relids,
+plan_union_query(List *relids,
Index rt_index,
- RangeTblEntry * rt_entry,
- Query * root,
+ RangeTblEntry *rt_entry,
+ Query *root,
UnionFlag flag,
- List ** union_rtentriesPtr)
+ List **union_rtentriesPtr)
{
List *i;
List *union_plans = NIL;
* Returns a copy of 'old-entry' with the parameters substituted.
*/
static RangeTblEntry *
-new_rangetable_entry(Oid new_relid, RangeTblEntry * old_entry)
+new_rangetable_entry(Oid new_relid, RangeTblEntry *old_entry)
{
RangeTblEntry *new_entry = copyObject(old_entry);
* Returns a new copy of 'root'.
*/
static Query *
-subst_rangetable(Query * root, Index index, RangeTblEntry * new_entry)
+subst_rangetable(Query *root, Index index, RangeTblEntry *new_entry)
{
Query *new_root = copyObject(root);
List *temp = NIL;
fix_parsetree_attnums_nodes(Index rt_index,
Oid old_relid,
Oid new_relid,
- Node * node)
+ Node *node)
{
if (node == NULL)
return;
fix_parsetree_attnums(Index rt_index,
Oid old_relid,
Oid new_relid,
- Query * parsetree)
+ Query *parsetree)
{
if (old_relid == new_relid)
return;
}
static Append *
-make_append(List * unionplans,
+make_append(List *unionplans,
Index rt_index,
- List * union_rt_entries,
- List * tlist)
+ List *union_rt_entries,
+ List *tlist)
{
Append *node = makeNode(Append);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/clauseinfo.c,v 1.5 1997/09/08 02:24:48 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/clauseinfo.c,v 1.6 1997/09/08 21:45:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*
*/
bool
-valid_or_clause(CInfo * clauseinfo)
+valid_or_clause(CInfo *clauseinfo)
{
if (clauseinfo != NULL &&
!single_node((Node *) clauseinfo->clause) &&
*
*/
List *
-get_actual_clauses(List * clauseinfo_list)
+get_actual_clauses(List *clauseinfo_list)
{
List *temp = NIL;
List *result = NIL;
*
*/
void
-get_relattvals(List * clauseinfo_list,
- List ** attnos,
- List ** values,
- List ** flags)
+get_relattvals(List *clauseinfo_list,
+ List **attnos,
+ List **values,
+ List **flags)
{
List *result1 = NIL;
List *result2 = NIL;
*/
void
get_joinvars(Oid relid,
- List * clauseinfo_list,
- List ** attnos,
- List ** values,
- List ** flags)
+ List *clauseinfo_list,
+ List **attnos,
+ List **values,
+ List **flags)
{
List *result1 = NIL;
List *result2 = NIL;
*
*/
List *
-get_opnos(List * clauseinfo_list)
+get_opnos(List *clauseinfo_list)
{
CInfo *temp = (CInfo *) NULL;
List *result = NIL;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.10 1997/09/08 20:56:19 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.11 1997/09/08 21:45:47 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
#include "optimizer/internal.h"
#include "optimizer/var.h"
-static bool agg_clause(Node * clause);
+static bool agg_clause(Node *clause);
Expr *
-make_clause(int type, Node * oper, List * args)
+make_clause(int type, Node *oper, List *args)
{
if (type == AND_EXPR || type == OR_EXPR || type == NOT_EXPR ||
type == OP_EXPR || type == FUNC_EXPR)
* - ay 10/94.]
*/
bool
-is_opclause(Node * clause)
+is_opclause(Node *clause)
{
return
- (clause != NULL &&
- nodeTag(clause) == T_Expr && ((Expr *) clause)->opType == OP_EXPR);
+ (clause != NULL &&
+ nodeTag(clause) == T_Expr && ((Expr *) clause)->opType == OP_EXPR);
}
/*
*
*/
Expr *
-make_opclause(Oper * op, Var * leftop, Var * rightop)
+make_opclause(Oper *op, Var *leftop, Var *rightop)
{
Expr *expr = makeNode(Expr);
* NB: it is assumed (for now) that all expr must be Var nodes
*/
Var *
-get_leftop(Expr * clause)
+get_leftop(Expr *clause)
{
if (clause->args != NULL)
return (lfirst(clause->args));
*
*/
Var *
-get_rightop(Expr * clause)
+get_rightop(Expr *clause)
{
if (clause->args != NULL && lnext(clause->args) != NULL)
return (lfirst(lnext(clause->args)));
*****************************************************************************/
static bool
-agg_clause(Node * clause)
+agg_clause(Node *clause)
{
return
(clause != NULL && nodeTag(clause) == T_Aggreg);
*
*/
bool
-is_funcclause(Node * clause)
+is_funcclause(Node *clause)
{
return
- (clause != NULL &&
- nodeTag(clause) == T_Expr && ((Expr *) clause)->opType == FUNC_EXPR);
+ (clause != NULL &&
+ nodeTag(clause) == T_Expr && ((Expr *) clause)->opType == FUNC_EXPR);
}
/*
*
*/
Expr *
-make_funcclause(Func * func, List * funcargs)
+make_funcclause(Func *func, List *funcargs)
{
Expr *expr = makeNode(Expr);
*
*/
bool
-or_clause(Node * clause)
+or_clause(Node *clause)
{
return
- (clause != NULL &&
- nodeTag(clause) == T_Expr && ((Expr *) clause)->opType == OR_EXPR);
+ (clause != NULL &&
+ nodeTag(clause) == T_Expr && ((Expr *) clause)->opType == OR_EXPR);
}
/*
*
*/
Expr *
-make_orclause(List * orclauses)
+make_orclause(List *orclauses)
{
Expr *expr = makeNode(Expr);
*
*/
bool
-not_clause(Node * clause)
+not_clause(Node *clause)
{
return
- (clause != NULL &&
+ (clause != NULL &&
nodeTag(clause) == T_Expr && ((Expr *) clause)->opType == NOT_EXPR);
}
*
*/
Expr *
-make_notclause(Expr * notclause)
+make_notclause(Expr *notclause)
{
Expr *expr = makeNode(Expr);
*
*/
Expr *
-get_notclausearg(Expr * notclause)
+get_notclausearg(Expr *notclause)
{
return (lfirst(notclause->args));
}
*
*/
bool
-and_clause(Node * clause)
+and_clause(Node *clause)
{
return
- (clause != NULL &&
+ (clause != NULL &&
nodeTag(clause) == T_Expr && ((Expr *) clause)->opType == AND_EXPR);
}
*
*/
Expr *
-make_andclause(List * andclauses)
+make_andclause(List *andclauses)
{
Expr *expr = makeNode(Expr);
*
*/
List *
-pull_constant_clauses(List * quals, List ** constantQual)
+pull_constant_clauses(List *quals, List **constantQual)
{
List *q;
List *constqual = NIL;
*
*/
void
-clause_relids_vars(Node * clause, List ** relids, List ** vars)
+clause_relids_vars(Node *clause, List **relids, List **vars)
{
List *clvars = pull_var_clause(clause);
List *var_list = NIL;
* Returns the number of different relations referenced in 'clause'.
*/
int
-NumRelids(Node * clause)
+NumRelids(Node *clause)
{
List *vars = pull_var_clause(clause);
List *i = NIL;
*
*/
bool
-contains_not(Node * clause)
+contains_not(Node *clause)
{
if (single_node(clause))
return (false);
*
*/
bool
-join_clause_p(Node * clause)
+join_clause_p(Node *clause)
{
Node *leftop,
*rightop;
* One side of the clause (i.e. left or right operands) must either be
* a var node ...
*/
- if (IsA(leftop, Var) || IsA(rightop, Var))
+ if (IsA(leftop, Var) ||IsA(rightop, Var))
return true;
/*
*
*/
bool
-qual_clause_p(Node * clause)
+qual_clause_p(Node *clause)
{
if (!is_opclause(clause))
return false;
*
*/
void
-fix_opid(Node * clause)
+fix_opid(Node *clause)
{
if (clause == NULL || single_node(clause))
{
*
*/
List *
-fix_opids(List * clauses)
+fix_opids(List *clauses)
{
List *clause;
*
*/
void
-get_relattval(Node * clause,
+get_relattval(Node *clause,
int *relid,
AttrNumber *attno,
- Datum * constval,
+ Datum *constval,
int *flag)
{
Var *left = get_leftop((Expr *) clause);
}
#ifdef INDEXSCAN_PATCH
}
- else if (is_opclause(clause) && IsA(left, Var) && IsA(right, Param))
+ else if (is_opclause(clause) && IsA(left, Var) &&IsA(right, Param))
{
/* Function parameter used as index scan arg. DZ - 27-8-1996 */
*relid = left->varno;
}
#ifdef INDEXSCAN_PATCH
}
- else if (is_opclause(clause) && IsA(right, Var) && IsA(left, Param))
+ else if (is_opclause(clause) && IsA(right, Var) &&IsA(left, Param))
{
/* ...And here... - vadim 01/22/97 */
*relid = right->varno;
*
*/
void
-get_rels_atts(Node * clause,
+get_rels_atts(Node *clause,
int *relid1,
AttrNumber *attno1,
int *relid2,
Var *right = get_rightop((Expr *) clause);
bool var_left = (IsA(left, Var));
bool var_right = (IsA(right, Var));
- bool varexpr_left = (bool) ((IsA(left, Func) || IsA(left, Oper)) &&
+ bool varexpr_left = (bool) ((IsA(left, Func) ||IsA(left, Oper)) &&
contain_var_clause((Node *) left));
- bool varexpr_right = (bool) ((IsA(right, Func) || IsA(right, Oper)) &&
+ bool varexpr_right = (bool) ((IsA(right, Func) ||IsA(right, Oper)) &&
contain_var_clause((Node *) right));
if (is_opclause(clause))
}
void
-CommuteClause(Node * clause)
+CommuteClause(Node *clause)
{
Node *temp;
Oper *commu;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/indexnode.c,v 1.4 1997/09/08 02:24:54 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/indexnode.c,v 1.5 1997/09/08 21:45:48 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "optimizer/pathnode.h" /* where the decls go */
-static List *find_secondary_index(Query * root, Oid relid);
+static List *find_secondary_index(Query *root, Oid relid);
/*
* find-relation-indices--
*
*/
List *
-find_relation_indices(Query * root, Rel * rel)
+find_relation_indices(Query *root, Rel *rel)
{
if (rel->indexed)
{
*
*/
static List *
-find_secondary_index(Query * root, Oid relid)
+find_secondary_index(Query *root, Oid relid)
{
IdxInfoRetval indexinfo;
List *indexes = NIL;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/internal.c,v 1.5 1997/09/08 02:24:56 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/internal.c,v 1.6 1997/09/08 21:45:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* the following should probably be moved elsewhere -ay */
TargetEntry *
-MakeTLE(Resdom * resdom, Node * expr)
+MakeTLE(Resdom *resdom, Node *expr)
{
TargetEntry *rt = makeNode(TargetEntry);
}
Var *
-get_expr(TargetEntry * tle)
+get_expr(TargetEntry *tle)
{
Assert(tle != NULL);
Assert(tle->expr != NULL);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/joininfo.c,v 1.4 1997/09/08 02:24:57 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/joininfo.c,v 1.5 1997/09/08 21:45:50 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*
*/
JInfo *
-joininfo_member(List * join_relids, List * joininfo_list)
+joininfo_member(List *join_relids, List *joininfo_list)
{
List *i = NIL;
List *other_rels = NIL;
*
*/
JInfo *
-find_joininfo_node(Rel * this_rel, List * join_relids)
+find_joininfo_node(Rel *this_rel, List *join_relids)
{
JInfo *joininfo = joininfo_member(join_relids,
this_rel->joininfo);
*
*/
Var *
-other_join_clause_var(Var * var, Expr * clause)
+other_join_clause_var(Var *var, Expr *clause)
{
Var *retval;
Var *l,
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/keys.c,v 1.4 1997/09/08 02:24:58 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/keys.c,v 1.5 1997/09/08 21:45:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "optimizer/tlist.h"
-static Expr *matching2_tlvar(int var, List * tlist, bool(*test) ());
-static bool equal_indexkey_var(int index_key, Var * var);
+static Expr *matching2_tlvar(int var, List *tlist, bool (*test) ());
+static bool equal_indexkey_var(int index_key, Var *var);
/*
* 1. index key
*
*/
bool
-match_indexkey_operand(int indexkey, Var * operand, Rel * rel)
+match_indexkey_operand(int indexkey, Var *operand, Rel *rel)
{
if (IsA(operand, Var) &&
(lfirsti(rel->relids) == operand->varno) &&
*
*/
static bool
-equal_indexkey_var(int index_key, Var * var)
+equal_indexkey_var(int index_key, Var *var)
{
if (index_key == var->varattno)
return (true);
*
*/
Var *
-extract_subkey(JoinKey * jk, int which_subkey)
+extract_subkey(JoinKey *jk, int which_subkey)
{
Var *retval;
*
*/
bool
-samekeys(List * keys1, List * keys2)
+samekeys(List *keys1, List *keys2)
{
bool allmember = true;
List *key1,
* They should be merged.
*/
static Expr *
-matching2_tlvar(int var, List * tlist, bool(*test) ())
+matching2_tlvar(int var, List *tlist, bool (*test) ())
{
TargetEntry *tlentry = NULL;
List *
-collect_index_pathkeys(int *index_keys, List * tlist)
+collect_index_pathkeys(int *index_keys, List *tlist)
{
List *retval = NIL;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/ordering.c,v 1.5 1997/09/08 02:24:58 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/ordering.c,v 1.6 1997/09/08 21:45:52 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "optimizer/internal.h"
#include "optimizer/ordering.h"
-static bool equal_sortops_order(Oid * ordering1, Oid * ordering2);
+static bool equal_sortops_order(Oid *ordering1, Oid *ordering2);
/*
* equal-path-path-ordering--
*
*/
bool
-equal_path_path_ordering(PathOrder * path_ordering1,
- PathOrder * path_ordering2)
+equal_path_path_ordering(PathOrder *path_ordering1,
+ PathOrder *path_ordering2)
{
if (path_ordering1 == path_ordering2)
return true;
*
*/
bool
-equal_path_merge_ordering(Oid * path_ordering,
- MergeOrder * merge_ordering)
+equal_path_merge_ordering(Oid *path_ordering,
+ MergeOrder *merge_ordering)
{
if (path_ordering == NULL || merge_ordering == NULL)
return (false);
*
*/
bool
-equal_merge_merge_ordering(MergeOrder * merge_ordering1,
- MergeOrder * merge_ordering2)
+equal_merge_merge_ordering(MergeOrder *merge_ordering1,
+ MergeOrder *merge_ordering2)
{
return (equal(merge_ordering1, merge_ordering2));
}
* Returns true iff the sort operators are in the same order.
*/
static bool
-equal_sortops_order(Oid * ordering1, Oid * ordering2)
+equal_sortops_order(Oid *ordering1, Oid *ordering2)
{
int i = 0;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.5 1997/09/08 02:24:59 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.6 1997/09/08 21:45:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "parser/parsetree.h" /* for getrelid() */
-static Path *better_path(Path * new_path, List * unique_paths, bool * noOther);
+static Path *better_path(Path *new_path, List *unique_paths, bool *noOther);
/*****************************************************************************
*
*/
bool
-path_is_cheaper(Path * path1, Path * path2)
+path_is_cheaper(Path *path1, Path *path2)
{
Cost cost1 = path1->path_cost;
Cost cost2 = path2->path_cost;
*
*/
Path *
-set_cheapest(Rel * parent_rel, List * pathlist)
+set_cheapest(Rel *parent_rel, List *pathlist)
{
List *p;
Path *cheapest_so_far;
*
*/
List *
-add_pathlist(Rel * parent_rel, List * unique_paths, List * new_paths)
+add_pathlist(Rel *parent_rel, List *unique_paths, List *new_paths)
{
List *x;
Path *new_path;
*
*/
static Path *
-better_path(Path * new_path, List * unique_paths, bool * noOther)
+better_path(Path *new_path, List *unique_paths, bool *noOther)
{
Path *old_path = (Path *) NULL;
Path *path = (Path *) NULL;
*
*/
Path *
-create_seqscan_path(Rel * rel)
+create_seqscan_path(Rel *rel)
{
int relid = 0;
*
*/
IndexPath *
-create_index_path(Query * root,
- Rel * rel,
- Rel * index,
- List * restriction_clauses,
+create_index_path(Query *root,
+ Rel *rel,
+ Rel *index,
+ List *restriction_clauses,
bool is_join_scan)
{
IndexPath *pathnode = makeNode(IndexPath);
*
*/
JoinPath *
-create_nestloop_path(Rel * joinrel,
- Rel * outer_rel,
- Path * outer_path,
- Path * inner_path,
- List * keys)
+create_nestloop_path(Rel *joinrel,
+ Rel *outer_rel,
+ Path *outer_path,
+ Path *inner_path,
+ List *keys)
{
JoinPath *pathnode = makeNode(JoinPath);
*
*/
MergePath *
-create_mergesort_path(Rel * joinrel,
+create_mergesort_path(Rel *joinrel,
int outersize,
int innersize,
int outerwidth,
int innerwidth,
- Path * outer_path,
- Path * inner_path,
- List * keys,
- MergeOrder * order,
- List * mergeclauses,
- List * outersortkeys,
- List * innersortkeys)
+ Path *outer_path,
+ Path *inner_path,
+ List *keys,
+ MergeOrder *order,
+ List *mergeclauses,
+ List *outersortkeys,
+ List *innersortkeys)
{
MergePath *pathnode = makeNode(MergePath);
*
*/
HashPath *
-create_hashjoin_path(Rel * joinrel,
+create_hashjoin_path(Rel *joinrel,
int outersize,
int innersize,
int outerwidth,
int innerwidth,
- Path * outer_path,
- Path * inner_path,
- List * keys,
+ Path *outer_path,
+ Path *inner_path,
+ List *keys,
Oid operator,
- List * hashclauses,
- List * outerkeys,
- List * innerkeys)
+ List *hashclauses,
+ List *outerkeys,
+ List *innerkeys)
{
HashPath *pathnode = makeNode(HashPath);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.8 1997/09/08 02:25:01 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.9 1997/09/08 21:45:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* number of tuples
*/
void
-relation_info(Query * root, Index relid,
- bool * hasindex, int *pages, int *tuples)
+relation_info(Query *root, Index relid,
+ bool *hasindex, int *pages, int *tuples)
{
HeapTuple relationTuple;
Form_pg_class relation;
*
*/
bool
-index_info(Query * root, bool first, int relid, IdxInfoRetval * info)
+index_info(Query *root, bool first, int relid, IdxInfoRetval *info)
{
register i;
HeapTuple indexTuple,
*/
void
index_selectivity(Oid indid,
- Oid * classes,
- List * opnos,
+ Oid *classes,
+ List *opnos,
Oid relid,
- List * attnos,
- List * values,
- List * flags,
+ List *attnos,
+ List *values,
+ List *flags,
int32 nkeys,
float *idxPages,
float *idxSelec)
elog(WARN, "RestrictionClauseSelectivity: bad value %lf",
*result);
- return ((Cost) * result);
+ return ((Cost) *result);
}
/*
elog(WARN, "JoinClauseSelectivity: bad value %lf",
*result);
- return ((Cost) * result);
+ return ((Cost) *result);
}
/*
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/relnode.c,v 1.3 1997/09/08 02:25:02 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/relnode.c,v 1.4 1997/09/08 21:45:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*
*/
Rel *
-get_base_rel(Query * root, int relid)
+get_base_rel(Query *root, int relid)
{
List *relids;
Rel *rel;
*
*/
Rel *
-get_join_rel(Query * root, List * relid)
+get_join_rel(Query *root, List *relid)
{
return rel_member(relid, root->join_relation_list_);
}
*
*/
Rel *
-rel_member(List * relid, List * rels)
+rel_member(List *relid, List *rels)
{
List *temp = NIL;
List *temprelid = NIL;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.6 1997/09/08 02:25:03 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.7 1997/09/08 21:45:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "nodes/makefuncs.h"
#include "parser/catalog_utils.h"
-static Node *flatten_tlistentry(Node * tlistentry, List * flat_tlist);
+static Node *flatten_tlistentry(Node *tlistentry, List *flat_tlist);
/*****************************************************************************
* ---------- RELATION node target list routines ----------
* targetlist = valid sequence
*/
TargetEntry *
-tlistentry_member(Var * var, List * targetlist)
+tlistentry_member(Var *var, List *targetlist)
{
if (var)
{
*
*/
Expr *
-matching_tlvar(Var * var, List * targetlist)
+matching_tlvar(Var *var, List *targetlist)
{
TargetEntry *tlentry;
* CREATES: new var-node iff no matching var-node exists in targetlist
*/
void
-add_tl_element(Rel * rel, Var * var)
+add_tl_element(Rel *rel, Var *var)
{
Expr *oldvar = (Expr *) NULL;
* CREATES: new targetlist entry (always).
*/
TargetEntry *
-create_tl_element(Var * var, int resdomno)
+create_tl_element(Var *var, int resdomno)
{
TargetEntry *tlelement = makeNode(TargetEntry);
*
*/
List *
-get_actual_tlist(List * tlist)
+get_actual_tlist(List *tlist)
{
/*
*
*/
Resdom *
-tlist_member(Var * var, List * tlist)
+tlist_member(Var *var, List *tlist)
{
List *i = NIL;
TargetEntry *temp_tle = (TargetEntry *) NULL;
* Routine to get the resdom out of a targetlist.
*/
Resdom *
-tlist_resdom(List * tlist, Resdom * resnode)
+tlist_resdom(List *tlist, Resdom *resnode)
{
Resdom *resdom = (Resdom *) NULL;
List *i = NIL;
* varoattno. Also, nested attnos are long gone. - ay 2/95]
*/
TargetEntry *
-match_varid(Var * test_var, List * tlist)
+match_varid(Var *test_var, List *tlist)
{
List *tl;
Oid type_var;
*
*/
List *
-new_unsorted_tlist(List * targetlist)
+new_unsorted_tlist(List *targetlist)
{
List *new_targetlist = (List *) copyObject((Node *) targetlist);
List *x = NIL;
*
*/
List *
-copy_vars(List * target, List * source)
+copy_vars(List *target, List *source)
{
List *result = NIL;
List *src = NIL;
*
*/
List *
-flatten_tlist(List * tlist)
+flatten_tlist(List *tlist)
{
int last_resdomno = 1;
List *new_tlist = NIL;
*
*/
List *
-flatten_tlist_vars(List * full_tlist, List * flat_tlist)
+flatten_tlist_vars(List *full_tlist, List *flat_tlist)
{
List *x = NIL;
List *result = NIL;
*
*/
static Node *
-flatten_tlistentry(Node * tlistentry, List * flat_tlist)
+flatten_tlistentry(Node *tlistentry, List *flat_tlist)
{
if (tlistentry == NULL)
{
TargetEntry *
-MakeTLE(Resdom * resdom, Node * expr)
+MakeTLE(Resdom *resdom, Node *expr)
{
TargetEntry *rt = makeNode(TargetEntry);
}
Var *
-get_expr(TargetEntry * tle)
+get_expr(TargetEntry *tle)
{
Assert(tle != NULL);
Assert(tle->expr != NULL);
*/
#ifdef NOT_USED
void
-AddGroupAttrToTlist(List * tlist, List * grpCl)
+AddGroupAttrToTlist(List *tlist, List *grpCl)
{
List *gl;
int last_resdomno = length(tlist) + 1;
/* was ExecTargetListLength() in execQual.c,
moved here to reduce dependencies on the executor module */
int
-exec_tlist_length(List * targetlist)
+exec_tlist_length(List *targetlist)
{
int len;
List *tl;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/var.c,v 1.5 1997/09/08 02:25:07 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/var.c,v 1.6 1997/09/08 21:45:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* (though it currently is, see primnodes.h)
*/
List *
-pull_varnos(Node * me)
+pull_varnos(Node *me)
{
List *i,
*result = NIL;
* Returns true if any varnode found.
*/
bool
-contain_var_clause(Node * clause)
+contain_var_clause(Node *clause)
{
if (clause == NULL)
return FALSE;
* Returns list of varnodes found.
*/
List *
-pull_var_clause(Node * clause)
+pull_var_clause(Node *clause)
{
List *retval = NIL;
* Returns t iff two var nodes correspond to the same attribute.
*/
bool
-var_equal(Var * var1, Var * var2)
+var_equal(Var *var1, Var *var2)
{
- if (IsA(var1, Var) && IsA(var2, Var) &&
+ if (IsA(var1, Var) &&IsA(var2, Var) &&
(((Var *) var1)->varno == ((Var *) var2)->varno) &&
(((Var *) var1)->vartype == ((Var *) var2)->vartype) &&
(((Var *) var1)->varattno == ((Var *) var2)->varattno))
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.41 1997/09/08 20:56:25 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.42 1997/09/08 21:46:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "port-protos.h" /* strdup() */
/* convert the parse tree into a query tree */
-static Query *transformStmt(ParseState * pstate, Node * stmt);
-
-static Query *transformDeleteStmt(ParseState * pstate, DeleteStmt * stmt);
-static Query *transformInsertStmt(ParseState * pstate, AppendStmt *stmt);
-static Query *transformIndexStmt(ParseState * pstate, IndexStmt * stmt);
-static Query *transformExtendStmt(ParseState * pstate, ExtendStmt * stmt);
-static Query *transformRuleStmt(ParseState * query, RuleStmt * stmt);
-static Query *transformSelectStmt(ParseState * pstate, RetrieveStmt * stmt);
-static Query *transformUpdateStmt(ParseState * pstate, ReplaceStmt * stmt);
-static Query *transformCursorStmt(ParseState * pstate, CursorStmt * stmt);
-static Node *handleNestedDots(ParseState * pstate, Attr *attr, int *curr_resno);
+static Query *transformStmt(ParseState *pstate, Node *stmt);
+
+static Query *transformDeleteStmt(ParseState *pstate, DeleteStmt *stmt);
+static Query *transformInsertStmt(ParseState *pstate, AppendStmt *stmt);
+static Query *transformIndexStmt(ParseState *pstate, IndexStmt *stmt);
+static Query *transformExtendStmt(ParseState *pstate, ExtendStmt *stmt);
+static Query *transformRuleStmt(ParseState *query, RuleStmt *stmt);
+static Query *transformSelectStmt(ParseState *pstate, RetrieveStmt *stmt);
+static Query *transformUpdateStmt(ParseState *pstate, ReplaceStmt *stmt);
+static Query *transformCursorStmt(ParseState *pstate, CursorStmt *stmt);
+static Node *handleNestedDots(ParseState *pstate, Attr *attr, int *curr_resno);
#define EXPR_COLUMN_FIRST 1
#define EXPR_RELATION_FIRST 2
-static Node *transformExpr(ParseState * pstate, Node * expr, int precedence);
-static Node *transformIdent(ParseState * pstate, Node * expr, int precedence);
-
-static void makeRangeTable(ParseState * pstate, char *relname, List * frmList);
-static List *expandAllTables(ParseState * pstate);
-static char *figureColname(Node * expr, Node * resval);
-static List *makeTargetNames(ParseState * pstate, List * cols);
-static List *transformTargetList(ParseState * pstate, List * targetlist);
+static Node *transformExpr(ParseState *pstate, Node *expr, int precedence);
+static Node *transformIdent(ParseState *pstate, Node *expr, int precedence);
+
+static void makeRangeTable(ParseState *pstate, char *relname, List *frmList);
+static List *expandAllTables(ParseState *pstate);
+static char *figureColname(Node *expr, Node *resval);
+static List *makeTargetNames(ParseState *pstate, List *cols);
+static List *transformTargetList(ParseState *pstate, List *targetlist);
static TargetEntry *
-make_targetlist_expr(ParseState * pstate,
- char *colname, Node * expr,
- List * arrayRef);
+make_targetlist_expr(ParseState *pstate,
+ char *colname, Node *expr,
+ List *arrayRef);
static bool inWhereClause = false;
-static Node *transformWhereClause(ParseState * pstate, Node * a_expr);
+static Node *transformWhereClause(ParseState *pstate, Node *a_expr);
static List *
-transformGroupClause(ParseState * pstate, List * grouplist,
- List * targetlist);
+transformGroupClause(ParseState *pstate, List *grouplist,
+ List *targetlist);
static List *
-transformSortClause(ParseState * pstate,
- List * orderlist, List * targetlist,
+transformSortClause(ParseState *pstate,
+ List *orderlist, List *targetlist,
char *uniqueFlag);
-static void parseFromClause(ParseState * pstate, List * frmList);
+static void parseFromClause(ParseState *pstate, List *frmList);
static Node *
-ParseFunc(ParseState * pstate, char *funcname,
- List * fargs, int *curr_resno);
+ParseFunc(ParseState *pstate, char *funcname,
+ List *fargs, int *curr_resno);
static List *setup_tlist(char *attname, Oid relid);
static List *setup_base_tlist(Oid typeid);
static void
-make_arguments(int nargs, List * fargs, Oid * input_typeids,
- Oid * function_typeids);
-static void AddAggToParseState(ParseState * pstate, Aggreg *aggreg);
-static void finalizeAggregates(ParseState * pstate, Query * qry);
-static void parseCheckAggregates(ParseState * pstate, Query * qry);
+make_arguments(int nargs, List *fargs, Oid *input_typeids,
+ Oid *function_typeids);
+static void AddAggToParseState(ParseState *pstate, Aggreg *aggreg);
+static void finalizeAggregates(ParseState *pstate, Query *qry);
+static void parseCheckAggregates(ParseState *pstate, Query *qry);
static ParseState *makeParseState(void);
/*****************************************************************************
* CALLER is responsible for freeing the QueryTreeList* returned
*/
QueryTreeList *
-parse_analyze(List * pl)
+parse_analyze(List *pl)
{
QueryTreeList *result;
ParseState *pstate;
* into a Query tree.
*/
static Query *
-transformStmt(ParseState * pstate, Node * parseTree)
+transformStmt(ParseState *pstate, Node *parseTree)
{
Query *result = NULL;
* transforms a Delete Statement
*/
static Query *
-transformDeleteStmt(ParseState * pstate, DeleteStmt * stmt)
+transformDeleteStmt(ParseState *pstate, DeleteStmt *stmt)
{
Query *qry = makeNode(Query);
* transform an Insert Statement
*/
static Query *
-transformInsertStmt(ParseState * pstate, AppendStmt *stmt)
+transformInsertStmt(ParseState *pstate, AppendStmt *stmt)
{
Query *qry = makeNode(Query); /* make a new query tree */
* transforms the qualification of the index statement
*/
static Query *
-transformIndexStmt(ParseState * pstate, IndexStmt * stmt)
+transformIndexStmt(ParseState *pstate, IndexStmt *stmt)
{
Query *q;
*
*/
static Query *
-transformExtendStmt(ParseState * pstate, ExtendStmt * stmt)
+transformExtendStmt(ParseState *pstate, ExtendStmt *stmt)
{
Query *q;
* trees which is transformed into a list of query trees.
*/
static Query *
-transformRuleStmt(ParseState * pstate, RuleStmt * stmt)
+transformRuleStmt(ParseState *pstate, RuleStmt *stmt)
{
Query *q;
List *actions;
*
*/
static Query *
-transformSelectStmt(ParseState * pstate, RetrieveStmt * stmt)
+transformSelectStmt(ParseState *pstate, RetrieveStmt *stmt)
{
Query *qry = makeNode(Query);
*
*/
static Query *
-transformUpdateStmt(ParseState * pstate, ReplaceStmt * stmt)
+transformUpdateStmt(ParseState *pstate, ReplaceStmt *stmt)
{
Query *qry = makeNode(Query);
*
*/
static Query *
-transformCursorStmt(ParseState * pstate, CursorStmt * stmt)
+transformCursorStmt(ParseState *pstate, CursorStmt *stmt)
{
Query *qry = makeNode(Query);
* here.
*/
static Node *
-transformExpr(ParseState * pstate, Node * expr, int precedence)
+transformExpr(ParseState *pstate, Node *expr, int precedence)
{
Node *result = NULL;
}
static Node *
-transformIdent(ParseState * pstate, Node * expr, int precedence)
+transformIdent(ParseState *pstate, Node *expr, int precedence)
{
Ident *ident = (Ident *) expr;
RangeTblEntry *rte;
*
*/
static void
-parseFromClause(ParseState * pstate, List * frmList)
+parseFromClause(ParseState *pstate, List *frmList)
{
List *fl;
* from-clause.
*/
static void
-makeRangeTable(ParseState * pstate, char *relname, List * frmList)
+makeRangeTable(ParseState *pstate, char *relname, List *frmList)
{
RangeTblEntry *rte;
* returns the Oid of the type of the expression. (Used for typechecking.)
*/
Oid
-exprType(Node * expr)
+exprType(Node *expr)
{
Oid type = (Oid) 0;
* relations in the range table)
*/
static List *
-expandAllTables(ParseState * pstate)
+expandAllTables(ParseState *pstate)
{
List *target = NIL;
List *legit_rtable = NIL;
*
*/
static char *
-figureColname(Node * expr, Node * resval)
+figureColname(Node *expr, Node *resval)
{
switch (nodeTag(expr))
{
* (used exclusively for inserts)
*/
static List *
-makeTargetNames(ParseState * pstate, List * cols)
+makeTargetNames(ParseState *pstate, List *cols)
{
List *tl = NULL;
* turns a list of ResTarget's into a list of TargetEntry's
*/
static List *
-transformTargetList(ParseState * pstate, List * targetlist)
+transformTargetList(ParseState *pstate, List *targetlist)
{
List *p_target = NIL;
List *tail_p_target = NIL;
* arrayRef is a list of transformed A_Indices
*/
static TargetEntry *
-make_targetlist_expr(ParseState * pstate,
+make_targetlist_expr(ParseState *pstate,
char *colname,
- Node * expr,
- List * arrayRef)
+ Node *expr,
+ List *arrayRef)
{
Oid type_id,
attrtype;
*
*/
static Node *
-transformWhereClause(ParseState * pstate, Node * a_expr)
+transformWhereClause(ParseState *pstate, Node *a_expr)
{
Node *qual;
*
*/
static TargetEntry *
-find_targetlist_entry(ParseState * pstate, SortGroupBy * sortgroupby, List * tlist)
+find_targetlist_entry(ParseState *pstate, SortGroupBy *sortgroupby, List *tlist)
{
List *i;
int real_rtable_pos = 0,
*
*/
static List *
-transformGroupClause(ParseState * pstate, List * grouplist, List * targetlist)
+transformGroupClause(ParseState *pstate, List *grouplist, List *targetlist)
{
List *glist = NIL,
*gl = NIL;
*
*/
static List *
-transformSortClause(ParseState * pstate,
- List * orderlist, List * targetlist,
+transformSortClause(ParseState *pstate,
+ List *orderlist, List *targetlist,
char *uniqueFlag)
{
List *sortlist = NIL;
** a tree with of Iter and Func nodes.
*/
static Node *
-handleNestedDots(ParseState * pstate, Attr *attr, int *curr_resno)
+handleNestedDots(ParseState *pstate, Attr *attr, int *curr_resno)
{
List *mutator_iter;
Node *retval = NULL;
*/
static void
make_arguments(int nargs,
- List * fargs,
- Oid * input_typeids,
- Oid * function_typeids)
+ List *fargs,
+ Oid *input_typeids,
+ Oid *function_typeids)
{
/*
* This routine returns NULL if it can't handle the projection (eg. sets).
*/
static Node *
-ParseComplexProjection(ParseState * pstate,
+ParseComplexProjection(ParseState *pstate,
char *funcname,
- Node * first_arg,
- bool * attisset)
+ Node *first_arg,
+ bool *attisset)
{
Oid argtype;
Oid argrelid;
}
static Node *
-ParseFunc(ParseState * pstate, char *funcname, List * fargs, int *curr_resno)
+ParseFunc(ParseState *pstate, char *funcname, List *fargs, int *curr_resno)
{
Oid rettype = (Oid) 0;
Oid argrelid = (Oid) 0;
* SIDE EFFECT: aggno in target list entry will be modified
*/
static void
-AddAggToParseState(ParseState * pstate, Aggreg *aggreg)
+AddAggToParseState(ParseState *pstate, Aggreg *aggreg)
{
List *ag;
int i;
* are used in the proper place.
*/
static void
-finalizeAggregates(ParseState * pstate, Query * qry)
+finalizeAggregates(ParseState *pstate, Query *qry)
{
List *l;
int i;
* Returns true if any aggregate found.
*/
static bool
-contain_agg_clause(Node * clause)
+contain_agg_clause(Node *clause)
{
if (clause == NULL)
return FALSE;
* returns true if the expression does not contain non-group columns.
*/
static bool
-exprIsAggOrGroupCol(Node * expr, List * groupClause)
+exprIsAggOrGroupCol(Node *expr, List *groupClause)
{
List *gl;
if (expr == NULL || IsA(expr, Const) ||
- IsA(expr, Param) || IsA(expr, Aggreg))
+ IsA(expr, Param) ||IsA(expr, Aggreg))
return TRUE;
foreach(gl, groupClause)
* returns true if the TargetEntry is Agg or GroupCol.
*/
static bool
-tleIsAggOrGroupCol(TargetEntry * tle, List * groupClause)
+tleIsAggOrGroupCol(TargetEntry *tle, List *groupClause)
{
Node *expr = tle->expr;
List *gl;
- if (expr == NULL || IsA(expr, Const) || IsA(expr, Param))
+ if (expr == NULL || IsA(expr, Const) ||IsA(expr, Param))
return TRUE;
foreach(gl, groupClause)
* here when the target list and the qualifications are finalized.
*/
static void
-parseCheckAggregates(ParseState * pstate, Query * qry)
+parseCheckAggregates(ParseState *pstate, Query *qry)
{
List *tl;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.24 1997/09/08 02:25:15 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.25 1997/09/08 21:46:04 momjian Exp $
*
*-------------------------------------------------------------------------
*/
int nsupers; /* number of superclasses */
Oid self; /* this class */
Oid *supervec; /* vector of superclasses */
-} InhPaths;
+} InhPaths;
/*
* This structure holds a list of possible functions or operators that
struct _CandidateList *next;
} *CandidateList;
-static Oid **argtype_inherit(int nargs, Oid * oid_array);
-static Oid **genxprod(InhPaths * arginh, int nargs);
-static int findsupers(Oid relid, Oid ** supervec);
+static Oid **argtype_inherit(int nargs, Oid *oid_array);
+static Oid **genxprod(InhPaths *arginh, int nargs);
+static int findsupers(Oid relid, Oid **supervec);
static bool check_typeid(Oid id);
static char *instr1(TypeTupleForm tp, char *string, int typlen);
static void op_error(char *op, Oid arg1, Oid arg2);
binary_oper_get_candidates(char *opname,
Oid leftTypeId,
Oid rightTypeId,
- CandidateList * candidates)
+ CandidateList *candidates)
{
CandidateList current_candidate;
Relation pg_operator_desc;
static int
unary_oper_get_candidates(char *op,
Oid typeId,
- CandidateList * candidates,
+ CandidateList *candidates,
char rightleft)
{
CandidateList current_candidate;
*candidates = NULL;
- fmgr_info(NameEqualRegProcedure, (func_ptr *) & opKey[0].sk_func,
+ fmgr_info(NameEqualRegProcedure, (func_ptr *) &opKey[0].sk_func,
&opKey[0].sk_nargs);
opKey[0].sk_argument = NameGetDatum(op);
- fmgr_info(CharacterEqualRegProcedure, (func_ptr *) & opKey[1].sk_func,
+ fmgr_info(CharacterEqualRegProcedure, (func_ptr *) &opKey[1].sk_func,
&opKey[1].sk_nargs);
opKey[1].sk_argument = CharGetDatum(rightleft);
if (type_struct_array->typelem == InvalidOid)
{
elog(WARN, "GetArrayElementType: type %s is not an array",
- (Name) & (type_struct_array->typname.data[0]));
+ (Name) &(type_struct_array->typname.data[0]));
}
return (type_struct_array->typelem);
* can input_typeids be coerced to func_typeids?
*/
static bool
-can_coerce(int nargs, Oid * input_typeids, Oid * func_typeids)
+can_coerce(int nargs, Oid *input_typeids, Oid *func_typeids)
{
int i;
Type tp;
*/
static int
match_argtypes(int nargs,
- Oid * input_typeids,
+ Oid *input_typeids,
CandidateList function_typeids,
- CandidateList * candidates) /* return value */
+ CandidateList *candidates) /* return value */
{
CandidateList current_candidate;
CandidateList matching_candidate;
*/
static Oid *
func_select_candidate(int nargs,
- Oid * input_typeids,
+ Oid *input_typeids,
CandidateList candidates)
{
/* XXX no conflict resolution implemeneted yet */
bool
func_get_detail(char *funcname,
int nargs,
- Oid * oid_array,
- Oid * funcid, /* return value */
- Oid * rettype, /* return value */
- bool * retset, /* return value */
- Oid ** true_typeids) /* return value */
+ Oid *oid_array,
+ Oid *funcid, /* return value */
+ Oid *rettype, /* return value */
+ bool *retset, /* return value */
+ Oid **true_typeids) /* return value */
{
Oid **input_typeid_vector;
Oid *current_input_typeids;
* catalogs.
*/
static Oid **
-argtype_inherit(int nargs, Oid * oid_array)
+argtype_inherit(int nargs, Oid *oid_array)
{
Oid relid;
int i;
typedef struct _SuperQE
{
Oid sqe_relid;
-} SuperQE;
+} SuperQE;
static int
-findsupers(Oid relid, Oid ** supervec)
+findsupers(Oid relid, Oid **supervec)
{
Oid *relidvec;
Relation inhrel;
}
static Oid **
-genxprod(InhPaths * arginh, int nargs)
+genxprod(InhPaths *arginh, int nargs)
{
int nanswers;
Oid **result,
* argument types
*/
void
-func_error(char *caller, char *funcname, int nargs, Oid * argtypes)
+func_error(char *caller, char *funcname, int nargs, Oid *argtypes)
{
char p[(NAMEDATALEN + 2) * MAXFMGRARGS],
*ptr;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/Attic/dbcommands.c,v 1.8 1997/09/08 02:25:16 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/dbcommands.c,v 1.9 1997/09/08 21:46:07 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* non-export function prototypes */
static void
check_permissions(char *command, char *dbname,
- Oid * dbIdP, Oid * userIdP);
+ Oid *dbIdP, Oid *userIdP);
static HeapTuple get_pg_dbtup(char *command, char *dbname, Relation dbrel);
static void stop_vacuum(char *dbname);
static void
check_permissions(char *command,
char *dbname,
- Oid * dbIdP,
- Oid * userIdP)
+ Oid *dbIdP,
+ Oid *userIdP)
{
Relation dbrel;
HeapTuple dbtup,
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/Attic/parse_query.c,v 1.20 1997/09/08 02:25:18 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/parse_query.c,v 1.21 1997/09/08 21:46:08 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "nodes/makefuncs.h"
static void
-checkTargetTypes(ParseState * pstate, char *target_colname,
+checkTargetTypes(ParseState *pstate, char *target_colname,
char *refname, char *colname);
Oid *param_type_info;
/* given refname, return a pointer to the range table entry */
RangeTblEntry *
-refnameRangeTableEntry(List * rtable, char *refname)
+refnameRangeTableEntry(List *rtable, char *refname)
{
List *temp;
/* given refname, return id of variable; position starts with 1 */
int
-refnameRangeTablePosn(List * rtable, char *refname)
+refnameRangeTablePosn(List *rtable, char *refname)
{
int index;
List *temp;
* returns range entry if found, else NULL
*/
RangeTblEntry *
-colnameRangeTableEntry(ParseState * pstate, char *colname)
+colnameRangeTableEntry(ParseState *pstate, char *colname)
{
List *et;
List *rtable;
* if pstate null
*/
RangeTblEntry *
-addRangeTableEntry(ParseState * pstate,
+addRangeTableEntry(ParseState *pstate,
char *relname,
char *refname,
bool inh, bool inFromCl,
- TimeRange * timeRange)
+ TimeRange *timeRange)
{
Relation relation;
RangeTblEntry *rte = makeNode(RangeTblEntry);
* assumes reldesc caching works
*/
List *
-expandAll(ParseState * pstate, char *relname, char *refname, int *this_resno)
+expandAll(ParseState *pstate, char *relname, char *refname, int *this_resno)
{
Relation rdesc;
List *te_tail = NIL,
}
static void
-disallow_setop(char *op, Type optype, Node * operand)
+disallow_setop(char *op, Type optype, Node *operand)
{
if (operand == NULL)
return;
static Node *
make_operand(char *opname,
- Node * tree,
+ Node *tree,
Oid orig_typeId,
Oid true_typeId)
{
Expr *
-make_op(char *opname, Node * ltree, Node * rtree)
+make_op(char *opname, Node *ltree, Node *rtree)
{
Oid ltypeId,
rtypeId;
Var *
-make_var(ParseState * pstate, char *refname, char *attrname, Oid * type_id)
+make_var(ParseState *pstate, char *refname, char *attrname, Oid *type_id)
{
Var *varnode;
int vnum,
* indirection is a list of A_Indices
*/
ArrayRef *
-make_array_ref(Node * expr,
- List * indirection)
+make_array_ref(Node *expr,
+ List *indirection)
{
Oid typearray;
HeapTuple type_tuple;
if (type_struct_array->typelem == InvalidOid)
{
elog(WARN, "make_array_ref: type %s is not an array",
- (Name) & (type_struct_array->typname.data[0]));
+ (Name) &(type_struct_array->typname.data[0]));
}
/* get the type tuple for the element type */
}
ArrayRef *
-make_array_set(Expr * target_expr,
- List * upperIndexpr,
- List * lowerIndexpr,
- Expr * expr)
+make_array_set(Expr *target_expr,
+ List *upperIndexpr,
+ List *lowerIndexpr,
+ Expr *expr)
{
Oid typearray;
HeapTuple type_tuple;
if (type_struct_array->typelem == InvalidOid)
{
elog(WARN, "make_array_ref: type %s is not an array",
- (Name) & (type_struct_array->typname.data[0]));
+ (Name) &(type_struct_array->typname.data[0]));
}
/* get the type tuple for the element type */
type_tuple = SearchSysCacheTuple(TYPOID,
* eventually, produces a "const" lisp-struct as per nodedefs.cl
*/
Const *
-make_const(Value * value)
+make_const(Value *value)
{
Type tp;
Datum val;
* used in postquel functions
*/
void
-param_type_init(Oid * typev, int nargs)
+param_type_init(Oid *typev, int nargs)
{
pfunc_num_args = nargs;
param_type_info = typev;
* use column names from insert
*/
void
-handleTargetColname(ParseState * pstate, char **resname,
+handleTargetColname(ParseState *pstate, char **resname,
char *refname, char *colname)
{
if (pstate->p_is_insert)
* checks value and target column types
*/
static void
-checkTargetTypes(ParseState * pstate, char *target_colname,
+checkTargetTypes(ParseState *pstate, char *target_colname,
char *refname, char *colname)
{
Oid attrtype_id,
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.24 1997/09/08 02:25:20 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.25 1997/09/08 21:46:12 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "optimizer/clauses.h"
void init_io(); /* from scan.l */
-void parser_init(Oid * typev, int nargs); /* from gram.y */
+void parser_init(Oid *typev, int nargs); /* from gram.y */
int yyparse(); /* from gram.c */
char *parseString; /* the char* which holds the string to be
* CALLER is responsible for free'ing the list returned
*/
QueryTreeList *
-parser(char *str, Oid * typev, int nargs)
+parser(char *str, Oid *typev, int nargs)
{
QueryTreeList *queryList;
int yyresult;
#ifdef SETS_FIXED
static void
-fixupsets(Query * parse)
+fixupsets(Query *parse)
{
if (parse == NULL)
return;
* the set, and store the OID of the new set in the Const instead.
*/
static void
-define_sets(Node * clause)
+define_sets(Node *clause)
{
Oid setoid;
Type t = type("oid");
*/
Node *
-parser_typecast(Value * expr, TypeName * typename, int typlen)
+parser_typecast(Value *expr, TypeName *typename, int typlen)
{
/* check for passing non-ints */
Const *adt;
}
Node *
-parser_typecast2(Node * expr, Oid exprType, Type tp, int typlen)
+parser_typecast2(Node *expr, Oid exprType, Type tp, int typlen)
{
/* check for passing non-ints */
Const *adt;
}
Aggreg *
-ParseAgg(char *aggname, Oid basetype, Node * target)
+ParseAgg(char *aggname, Oid basetype, Node *target)
{
Oid fintype;
Oid vartype;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.56 1997/09/08 20:56:38 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.57 1997/09/08 21:46:16 momjian Exp $
*
* NOTES
*
*/
static void pmdaemonize(void);
static void
-ConnStartup(Port * port, int *status,
+ConnStartup(Port *port, int *status,
char *errormsg, const int errormsg_len);
static int ConnCreate(int serverFd, int *newFdP);
static void reset_shared(short port);
static void reaper(SIGNAL_ARGS);
static void dumpstatus(SIGNAL_ARGS);
static void CleanupProc(int pid, int exitstatus);
-static int DoExec(StartupInfo * packet, int portFd);
+static int DoExec(StartupInfo *packet, int portFd);
static void ExitPostmaster(int status);
static void usage(const char *);
static int ServerLoop(void);
-static int BackendStartup(StartupInfo * packet, Port * port, int *pidPtr);
-static void send_error_reply(Port * port, const char *errormsg);
+static int BackendStartup(StartupInfo *packet, Port *port, int *pidPtr);
+static void send_error_reply(Port *port, const char *errormsg);
extern char *optarg;
extern int optind,
static void
-checkDataDir(const char *DataDir, bool * DataDirOK)
+checkDataDir(const char *DataDir, bool *DataDirOK)
{
if (DataDir == NULL)
{
*/
static void
-ConnStartup(Port * port, int *status,
+ConnStartup(Port *port, int *status,
char *errormsg, const int errormsg_len)
{
MsgType msgType;
*/
static void
-send_error_reply(Port * port, const char *errormsg)
+send_error_reply(Port *port, const char *errormsg)
{
int rc; /* return code from sendto */
char *reply;
*
*/
static int
-BackendStartup(StartupInfo * packet, /* client's startup packet */
- Port * port,
+BackendStartup(StartupInfo *packet, /* client's startup packet */
+ Port *port,
int *pidPtr)
{
Backend *bn; /* for backend cleanup */
* If execv() fails, return status.
*/
static int
-DoExec(StartupInfo * packet, int portFd)
+DoExec(StartupInfo *packet, int portFd)
{
char execbuf[MAXPATHLEN];
char portbuf[ARGV_SIZE];
#define NNONCHAR (CODEMAX-CHAR_MAX)
#ifdef REDEBUG
static void
- print(struct match * m, char *caption, states st, int ch, FILE * d);
+ print(struct match * m, char *caption, states st, int ch, FILE *d);
#endif
#ifdef REDEBUG
static void
static int p_simp_re(struct parse * p, int starordinary);
static int p_count(struct parse * p);
static void p_bracket(struct parse * p);
- static void p_b_term(struct parse * p, cset * cs);
- static void p_b_cclass(struct parse * p, cset * cs);
- static void p_b_eclass(struct parse * p, cset * cs);
+ static void p_b_term(struct parse * p, cset *cs);
+ static void p_b_cclass(struct parse * p, cset *cs);
+ static void p_b_eclass(struct parse * p, cset *cs);
static char p_b_symbol(struct parse * p);
static char p_b_coll_elem(struct parse * p, int endc);
static char othercase(int ch);
static void repeat(struct parse * p, sopno start, int from, int to);
static int seterr(struct parse * p, int e);
static cset *allocset(struct parse * p);
- static void freeset(struct parse * p, cset * cs);
- static int freezeset(struct parse * p, cset * cs);
- static int firstch(struct parse * p, cset * cs);
- static int nch(struct parse * p, cset * cs);
- static void mcadd(struct parse * p, cset * cs, char *cp);
- static void mcinvert(struct parse * p, cset * cs);
- static void mccase(struct parse * p, cset * cs);
+ static void freeset(struct parse * p, cset *cs);
+ static int freezeset(struct parse * p, cset *cs);
+ static int firstch(struct parse * p, cset *cs);
+ static int nch(struct parse * p, cset *cs);
+ static void mcadd(struct parse * p, cset *cs, char *cp);
+ static void mcinvert(struct parse * p, cset *cs);
+ static void mccase(struct parse * p, cset *cs);
static int isinsets(struct re_guts * g, int c);
static int samesets(struct re_guts * g, int c1, int c2);
static void categorize(struct parse * p, struct re_guts * g);
- dupl - emit a duplicate of a bunch of sops
== static sopno dupl(register struct parse *p, sopno start, sopno finish);
*/
-static sopno /* start of duplicate */
+static sopno /* start of duplicate */
dupl(p, start, finish)
register struct parse *p;
sopno start; /* from here */
- pluscount - count + nesting
== static sopno pluscount(register struct parse *p, register struct re_guts *g);
*/
-static sopno /* nesting depth */
+static sopno /* nesting depth */
pluscount(p, g)
struct parse *p;
register struct re_guts *g;
#endif
/* === regerror.c === */
- static char *regatoi(const regex_t * preg, char *localbuf);
+ static char *regatoi(const regex_t *preg, char *localbuf);
#ifdef __cplusplus
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/Attic/locks.c,v 1.4 1997/09/08 02:28:15 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/Attic/locks.c,v 1.5 1997/09/08 21:46:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* otherwise, we return false
*/
static bool
-nodeThisLockWasTriggered(Node * node, int varno, AttrNumber attnum)
+nodeThisLockWasTriggered(Node *node, int varno, AttrNumber attnum)
{
if (node == NULL)
return FALSE;
static bool
thisLockWasTriggered(int varno,
AttrNumber attnum,
- Query * parsetree)
+ Query *parsetree)
{
return
(nodeThisLockWasTriggered(parsetree->qual, varno, attnum) ||
*/
List *
matchLocks(CmdType event,
- RuleLock * rulelocks,
+ RuleLock *rulelocks,
int varno,
- Query * parsetree)
+ Query *parsetree)
{
List *real_locks = NIL;
int nlocks;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.5 1997/09/08 02:28:16 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.6 1997/09/08 21:46:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
ValidateRule(int event_type,
char *eobj_string,
char *eslot_string,
- Node * event_qual,
- List ** action,
+ Node *event_qual,
+ List **action,
int is_instead,
Oid event_attype)
{
}
void
-DefineQueryRewrite(RuleStmt * stmt)
+DefineQueryRewrite(RuleStmt *stmt)
{
CmdType event_type = stmt->event;
Attr *event_obj = stmt->object;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.5 1997/09/08 02:28:17 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.6 1997/09/08 21:46:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "access/heapam.h"
static void
-ApplyRetrieveRule(Query * parsetree, RewriteRule * rule,
+ApplyRetrieveRule(Query *parsetree, RewriteRule *rule,
int rt_index, int relation_level, int *modified);
static List *
-fireRules(Query * parsetree, int rt_index, CmdType event,
- bool * instead_flag, List * locks, List ** qual_products);
-static List *deepRewriteQuery(Query * parsetree);
+fireRules(Query *parsetree, int rt_index, CmdType event,
+ bool *instead_flag, List *locks, List **qual_products);
+static List *deepRewriteQuery(Query *parsetree);
/*
* gatherRewriteMeta -
* maintain semantic validity
*/
static RewriteInfo *
-gatherRewriteMeta(Query * parsetree,
- Query * rule_action,
- Node * rule_qual,
+gatherRewriteMeta(Query *parsetree,
+ Query *rule_action,
+ Node *rule_qual,
int rt_index,
CmdType event,
- bool * instead_flag)
+ bool *instead_flag)
{
RewriteInfo *info;
int rt_length;
}
static List *
-OptimizeRIRRules(List * locks)
+OptimizeRIRRules(List *locks)
{
List *attr_level = NIL,
*i;
* excess semantically queasy queries aren't processed
*/
static List *
-orderRules(List * locks)
+orderRules(List *locks)
{
List *regular = NIL,
*i;
}
static int
-AllRetrieve(List * actions)
+AllRetrieve(List *actions)
{
List *n;
}
static List *
-FireRetrieveRulesAtQuery(Query * parsetree,
+FireRetrieveRulesAtQuery(Query *parsetree,
int rt_index,
Relation relation,
- bool * instead_flag,
+ bool *instead_flag,
int rule_flag)
{
List *i,
* side effect: parsetree's rtable field might be changed
*/
static void
-ApplyRetrieveRule(Query * parsetree,
- RewriteRule * rule,
+ApplyRetrieveRule(Query *parsetree,
+ RewriteRule *rule,
int rt_index,
int relation_level,
int *modified)
}
static List *
-ProcessRetrieveQuery(Query * parsetree,
- List * rtable,
- bool * instead_flag,
+ProcessRetrieveQuery(Query *parsetree,
+ List *rtable,
+ bool *instead_flag,
bool rule)
{
List *rt;
}
static Query *
-CopyAndAddQual(Query * parsetree,
- List * actions,
- Node * rule_qual,
+CopyAndAddQual(Query *parsetree,
+ List *actions,
+ Node *rule_qual,
int rt_index,
CmdType event)
{
*
*/
static List *
-fireRules(Query * parsetree,
+fireRules(Query *parsetree,
int rt_index,
CmdType event,
- bool * instead_flag,
- List * locks,
- List ** qual_products)
+ bool *instead_flag,
+ List *locks,
+ List **qual_products)
{
RewriteInfo *info;
List *results = NIL;
}
static List *
-RewriteQuery(Query * parsetree, bool * instead_flag, List ** qual_products)
+RewriteQuery(Query *parsetree, bool *instead_flag, List **qual_products)
{
CmdType event;
List *product_queries = NIL;
* queries
*/
List *
-QueryRewrite(Query * parsetree)
+QueryRewrite(Query *parsetree)
{
numQueryRewriteInvoked = 0;
* rewrites the query and apply the rules again on the queries rewritten
*/
static List *
-deepRewriteQuery(Query * parsetree)
+deepRewriteQuery(Query *parsetree)
{
List *n;
List *rewritten = NIL;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.6 1997/09/08 02:28:18 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.7 1997/09/08 21:46:43 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "nodes/plannodes.h"
#include "optimizer/clauses.h"
-static void ResolveNew(RewriteInfo * info, List * targetlist, Node ** node);
+static void ResolveNew(RewriteInfo *info, List *targetlist, Node **node);
void
-OffsetVarNodes(Node * node, int offset)
+OffsetVarNodes(Node *node, int offset)
{
if (node == NULL)
return;
}
void
-ChangeVarNodes(Node * node, int old_varno, int new_varno)
+ChangeVarNodes(Node *node, int old_varno, int new_varno)
{
if (node == NULL)
return;
}
void
-AddQual(Query * parsetree, Node * qual)
+AddQual(Query *parsetree, Node *qual)
{
Node *copy,
*old;
}
void
-AddNotQual(Query * parsetree, Node * qual)
+AddNotQual(Query *parsetree, Node *qual)
{
Node *copy;
}
void
-FixResdomTypes(List * tlist)
+FixResdomTypes(List *tlist)
{
List *i;
}
static Node *
-FindMatchingNew(List * tlist, int attno)
+FindMatchingNew(List *tlist, int attno)
{
List *i;
}
static Node *
-FindMatchingTLEntry(List * tlist, char *e_attname)
+FindMatchingTLEntry(List *tlist, char *e_attname)
{
List *i;
}
static void
-ResolveNew(RewriteInfo * info, List * targetlist, Node ** nodePtr)
+ResolveNew(RewriteInfo *info, List *targetlist, Node **nodePtr)
{
Node *node = *nodePtr;
foreach(l, (List *) node)
{
- ResolveNew(info, targetlist, (Node **) & (lfirst(l)));
+ ResolveNew(info, targetlist, (Node **) &(lfirst(l)));
}
break;
}
}
void
-FixNew(RewriteInfo * info, Query * parsetree)
+FixNew(RewriteInfo *info, Query *parsetree)
{
ResolveNew(info, parsetree->targetList,
- (Node **) & (info->rule_action->targetList));
+ (Node **) &(info->rule_action->targetList));
ResolveNew(info, parsetree->targetList, &info->rule_action->qual);
}
static void
-nodeHandleRIRAttributeRule(Node ** nodePtr,
- List * rtable,
- List * targetlist,
+nodeHandleRIRAttributeRule(Node **nodePtr,
+ List *rtable,
+ List *targetlist,
int rt_index,
int attr_num,
int *modified,
* do instead retrieve (attribute = expression) w/qual'
*/
void
-HandleRIRAttributeRule(Query * parsetree,
- List * rtable,
- List * targetlist,
+HandleRIRAttributeRule(Query *parsetree,
+ List *rtable,
+ List *targetlist,
int rt_index,
int attr_num,
int *modified,
static void
-nodeHandleViewRule(Node ** nodePtr,
- List * rtable,
- List * targetlist,
+nodeHandleViewRule(Node **nodePtr,
+ List *rtable,
+ List *targetlist,
int rt_index,
int *modified)
{
}
void
-HandleViewRule(Query * parsetree,
- List * rtable,
- List * targetlist,
+HandleViewRule(Query *parsetree,
+ List *rtable,
+ List *targetlist,
int rt_index,
int *modified)
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.8 1997/09/08 02:28:20 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.9 1997/09/08 21:46:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*/
#ifdef NOT_USED
static Node *
-RuleIdGetActionInfo(Oid ruleoid, bool * instead_flag, Query ** parseTrees)
+RuleIdGetActionInfo(Oid ruleoid, bool *instead_flag, Query **parseTrees)
{
HeapTuple ruletuple;
char *ruleaction = NULL;
CmdType event_type,
AttrNumber attno,
bool isInstead,
- Node * qual,
- List * actions)
+ Node *qual,
+ List *actions)
{
Relation relation;
RewriteRule *thisRule;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_table.c,v 1.7 1997/09/08 20:56:41 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_table.c,v 1.8 1997/09/08 21:46:46 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
BufferTag key;
Buffer id;
-} LookupEnt;
+} LookupEnt;
/*
* Initialize shmem hash table for mapping buffers
}
BufferDesc *
-BufTableLookup(BufferTag * tagPtr)
+BufTableLookup(BufferTag *tagPtr)
{
LookupEnt *result;
bool found;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.22 1997/09/08 20:56:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.23 1997/09/08 21:46:50 momjian Exp $
*
*-------------------------------------------------------------------------
*/
bool bufferLockHeld);
static BufferDesc *
BufferAlloc(Relation reln, BlockNumber blockNum,
- bool * foundPtr, bool bufferLockHeld);
+ bool *foundPtr, bool bufferLockHeld);
static int FlushBuffer(Buffer buffer, bool release);
static void BufferSync(void);
static int BufferReplace(BufferDesc *bufHdr, bool bufferLockHeld);
static BufferDesc *
BufferAlloc(Relation reln,
BlockNumber blockNum,
- bool * foundPtr,
+ bool *foundPtr,
bool bufferLockHeld)
{
BufferDesc *buf,
long NDirectFileWrite; /* e.g., I/O in psort and hashjoin. */
void
-PrintBufferUsage(FILE * statfp)
+PrintBufferUsage(FILE *statfp)
{
float hitrate;
float localhitrate;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.10 1997/09/08 02:28:34 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.11 1997/09/08 21:46:52 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* allocate a local buffer. We do round robin allocation for now.
*/
BufferDesc *
-LocalBufferAlloc(Relation reln, BlockNumber blockNum, bool * foundPtr)
+LocalBufferAlloc(Relation reln, BlockNumber blockNum, bool *foundPtr)
{
int i;
BufferDesc *bufHdr = (BufferDesc *) NULL;
* Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Id: fd.c,v 1.24 1997/09/08 02:28:38 momjian Exp $
+ * $Id: fd.c,v 1.25 1997/09/08 21:46:54 momjian Exp $
*
* NOTES:
*
char *fileName;
int fileFlags;
int fileMode;
-} Vfd;
+} Vfd;
/*
* Virtual File Descriptor array pointer and size. This grows as
* AllocateFile()?
*/
void
-FreeFile(FILE * file)
+FreeFile(FILE *file)
{
DO_DB(elog(DEBUG, "FreeFile: Allocated %d.", allocatedFiles));
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.13 1997/09/08 02:28:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.14 1997/09/08 21:46:59 momjian Exp $
*
* NOTES
*
{
int id;
char *memptr;
-} PrivateMem;
+} PrivateMem;
PrivateMem IpcPrivateMem[16];
slockM = (struct ipcdummy *) IpcMemoryAttach(SLockMemoryId);
if (slockM == IpcMemAttachFailed)
elog(FATAL, "AttachSLockMemory: could not attach segment");
- FreeSLockPP = (SLock **) & (slockM->free);
+ FreeSLockPP = (SLock **) &(slockM->free);
UnusedSLockIP = (int *) &(slockM->unused);
- SLockMemoryLock = (slock_t *) & (slockM->memlock);
+ SLockMemoryLock = (slock_t *) &(slockM->memlock);
S_INIT_LOCK(SLockMemoryLock);
- SLockArray = (SLock *) & (slockM->slocks[0]);
+ SLockArray = (SLock *) &(slockM->slocks[0]);
return;
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.23 1997/09/08 02:28:51 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.24 1997/09/08 21:47:04 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* slock_t is defined as a struct mutex.
*/
void
-S_LOCK(slock_t * lock)
+S_LOCK(slock_t *lock)
{
mutex_lock(lock);
}
void
-S_UNLOCK(slock_t * lock)
+S_UNLOCK(slock_t *lock)
{
mutex_unlock(lock);
}
void
-S_INIT_LOCK(slock_t * lock)
+S_INIT_LOCK(slock_t *lock)
{
mutex_init(lock);
}
/* S_LOCK_FREE should return 1 if lock is free; 0 if lock is locked */
int
-S_LOCK_FREE(slock_t * lock)
+S_LOCK_FREE(slock_t *lock)
{
/* For Mach, we have to delve inside the entrails of `struct mutex'. Ick! */
return (lock->lock == 0);
* for the R3000 chips out there.
*/
void
-S_LOCK(slock_t * lock)
+S_LOCK(slock_t *lock)
{
/* spin_lock(lock); */
while (!acquire_lock(lock))
}
void
-S_UNLOCK(slock_t * lock)
+S_UNLOCK(slock_t *lock)
{
release_lock(lock);
}
void
-S_INIT_LOCK(slock_t * lock)
+S_INIT_LOCK(slock_t *lock)
{
init_lock(lock);
}
/* S_LOCK_FREE should return 1 if lock is free; 0 if lock is locked */
int
-S_LOCK_FREE(slock_t * lock)
+S_LOCK_FREE(slock_t *lock)
{
return (stat_lock(lock) == UNLOCKED);
}
#if defined(__alpha__) || defined(__alpha)
void
-S_LOCK(slock_t * lock)
+S_LOCK(slock_t *lock)
{
while (msem_lock(lock, MSEM_IF_NOWAIT) < 0)
;
}
void
-S_UNLOCK(slock_t * lock)
+S_UNLOCK(slock_t *lock)
{
msem_unlock(lock, 0);
}
void
-S_INIT_LOCK(slock_t * lock)
+S_INIT_LOCK(slock_t *lock)
{
msem_init(lock, MSEM_UNLOCKED);
}
int
-S_LOCK_FREE(slock_t * lock)
+S_LOCK_FREE(slock_t *lock)
{
return (lock->msem_state ? 0 : 1);
}
defined(sparc_solaris)
/* for xxxxx_solaris, this is defined in port/.../tas.s */
-static int tas(slock_t * lock);
+static int tas(slock_t *lock);
void
-S_LOCK(slock_t * lock)
+S_LOCK(slock_t *lock)
{
while (tas(lock))
;
}
void
-S_UNLOCK(slock_t * lock)
+S_UNLOCK(slock_t *lock)
{
*lock = 0;
}
void
-S_INIT_LOCK(slock_t * lock)
+S_INIT_LOCK(slock_t *lock)
{
S_UNLOCK(lock);
}
#if defined(aix)
void
-S_LOCK(slock_t * lock)
+S_LOCK(slock_t *lock)
{
while (cs((int *) lock, 0, 1))
;
}
void
-S_UNLOCK(slock_t * lock)
+S_UNLOCK(slock_t *lock)
{
*lock = 0;
}
void
-S_INIT_LOCK(slock_t * lock)
+S_INIT_LOCK(slock_t *lock)
{
S_UNLOCK(lock);
}
*/
static slock_t clear_lock = {-1, -1, -1, -1};
-static int tas(slock_t * lock);
+static int tas(slock_t *lock);
void
-S_LOCK(slock_t * lock)
+S_LOCK(slock_t *lock)
{
while (tas(lock))
;
}
void
-S_UNLOCK(slock_t * lock)
+S_UNLOCK(slock_t *lock)
{
*lock = clear_lock; /* struct assignment */
}
void
-S_INIT_LOCK(slock_t * lock)
+S_INIT_LOCK(slock_t *lock)
{
S_UNLOCK(lock);
}
int
-S_LOCK_FREE(slock_t * lock)
+S_LOCK_FREE(slock_t *lock)
{
register int *lock_word = (int *) (((long) lock + 15) & ~15);
#if defined(sun3)
-static int tas(slock_t * lock);
+static int tas(slock_t *lock);
void
-S_LOCK(slock_t * lock)
+S_LOCK(slock_t *lock)
{
while (tas(lock));
}
void
-S_UNLOCK(slock_t * lock)
+S_UNLOCK(slock_t *lock)
{
*lock = 0;
}
void
-S_INIT_LOCK(slock_t * lock)
+S_INIT_LOCK(slock_t *lock)
{
S_UNLOCK(lock);
}
#define asm(x) __asm__(x)
#endif
-static int tas(slock_t * lock);
+static int tas(slock_t *lock);
static int
tas_dummy()
#if defined(NEED_I386_TAS_ASM)
void
-S_LOCK(slock_t * lock)
+S_LOCK(slock_t *lock)
{
slock_t res;
}
void
-S_UNLOCK(slock_t * lock)
+S_UNLOCK(slock_t *lock)
{
*lock = 0;
}
void
-S_INIT_LOCK(slock_t * lock)
+S_INIT_LOCK(slock_t *lock)
{
S_UNLOCK(lock);
}
#if defined(__alpha__) && defined(linux)
void
-S_LOCK(slock_t * lock)
+S_LOCK(slock_t *lock)
{
slock_t res;
}
void
-S_UNLOCK(slock_t * lock)
+S_UNLOCK(slock_t *lock)
{
__asm__("mb");
*lock = 0;
}
void
-S_INIT_LOCK(slock_t * lock)
+S_INIT_LOCK(slock_t *lock)
{
S_UNLOCK(lock);
}
#if defined(linux) && defined(sparc)
void
-S_LOCK(slock_t * lock)
+S_LOCK(slock_t *lock)
{
slock_t res;
}
void
-S_UNLOCK(slock_t * lock)
+S_UNLOCK(slock_t *lock)
{
*lock = 0;
}
void
-S_INIT_LOCK(slock_t * lock)
+S_INIT_LOCK(slock_t *lock)
{
S_UNLOCK(lock);
}
}
void
-S_LOCK(slock_t * lock)
+S_LOCK(slock_t *lock)
{
while (tas(lock))
;
}
void
-S_UNLOCK(slock_t * lock)
+S_UNLOCK(slock_t *lock)
{
*lock = 0;
}
void
-S_INIT_LOCK(slock_t * lock)
+S_INIT_LOCK(slock_t *lock)
{
S_UNLOCK(lock);
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.12 1997/09/08 02:28:53 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.13 1997/09/08 21:47:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
ShmemInitHash(char *name, /* table string name for binding */
long init_size, /* initial size */
long max_size, /* max size of the table */
- HASHCTL * infoP, /* info about key and bucket size */
+ HASHCTL *infoP, /* info about key and bucket size */
int hash_flags) /* info about infoP */
{
bool found;
* locationPtr.
*/
bool
-ShmemPIDLookup(int pid, SHMEM_OFFSET * locationPtr)
+ShmemPIDLookup(int pid, SHMEM_OFFSET *locationPtr)
{
BindingEnt *result,
item;
* initialized).
*/
long *
-ShmemInitStruct(char *name, unsigned long size, bool * foundPtr)
+ShmemInitStruct(char *name, unsigned long size, bool *foundPtr)
{
BindingEnt *result,
item;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmqueue.c,v 1.5 1997/09/08 02:28:56 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmqueue.c,v 1.6 1997/09/08 21:47:10 momjian Exp $
*
* NOTES
*
* to itself
*/
void
-SHMQueueInit(SHM_QUEUE * queue)
+SHMQueueInit(SHM_QUEUE *queue)
{
Assert(SHM_PTR_VALID(queue));
(queue)->prev = (queue)->next = MAKE_OFFSET(queue);
*/
#ifdef NOT_USED
bool
-SHMQueueIsDetached(SHM_QUEUE * queue)
+SHMQueueIsDetached(SHM_QUEUE *queue)
{
Assert(SHM_PTR_VALID(queue));
return ((queue)->prev == INVALID_OFFSET);
* SHMQueueElemInit -- clear an element's links
*/
void
-SHMQueueElemInit(SHM_QUEUE * queue)
+SHMQueueElemInit(SHM_QUEUE *queue)
{
Assert(SHM_PTR_VALID(queue));
(queue)->prev = (queue)->next = INVALID_OFFSET;
* close the links
*/
void
-SHMQueueDelete(SHM_QUEUE * queue)
+SHMQueueDelete(SHM_QUEUE *queue)
{
SHM_QUEUE *nextElem = (SHM_QUEUE *) MAKE_PTR((queue)->next);
SHM_QUEUE *prevElem = (SHM_QUEUE *) MAKE_PTR((queue)->prev);
#ifdef SHMQUEUE_DEBUG
void
-dumpQ(SHM_QUEUE * q, char *s)
+dumpQ(SHM_QUEUE *q, char *s)
{
char elem[16];
char buf[1024];
*/
#ifdef NOT_USED
void
-SHMQueueInsertHD(SHM_QUEUE * queue, SHM_QUEUE * elem)
+SHMQueueInsertHD(SHM_QUEUE *queue, SHM_QUEUE *elem)
{
SHM_QUEUE *prevPtr = (SHM_QUEUE *) MAKE_PTR((queue)->prev);
SHMEM_OFFSET elemOffset = MAKE_OFFSET(elem);
#endif
void
-SHMQueueInsertTL(SHM_QUEUE * queue, SHM_QUEUE * elem)
+SHMQueueInsertTL(SHM_QUEUE *queue, SHM_QUEUE *elem)
{
SHM_QUEUE *nextPtr = (SHM_QUEUE *) MAKE_PTR((queue)->next);
SHMEM_OFFSET elemOffset = MAKE_OFFSET(elem);
* next.
*/
void
-SHMQueueFirst(SHM_QUEUE * queue, Pointer * nextPtrPtr, SHM_QUEUE * nextQueue)
+SHMQueueFirst(SHM_QUEUE *queue, Pointer *nextPtrPtr, SHM_QUEUE *nextQueue)
{
SHM_QUEUE *elemPtr = (SHM_QUEUE *) MAKE_PTR((queue)->next);
* SHMQueueEmpty -- TRUE if queue head is only element, FALSE otherwise
*/
bool
-SHMQueueEmpty(SHM_QUEUE * queue)
+SHMQueueEmpty(SHM_QUEUE *queue)
{
Assert(SHM_PTR_VALID(queue));
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.7 1997/09/08 02:29:01 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.8 1997/09/08 21:47:15 momjian Exp $
*
*-------------------------------------------------------------------------
*/
SISeg *shmInvalBuffer;
extern BackendId MyBackendId;
-static void CleanupInvalidationState(int status, SISeg * segInOutP);
-static BackendId SIAssignBackendId(SISeg * segInOutP, BackendTag backendTag);
-static int SIGetNumEntries(SISeg * segP);
+static void CleanupInvalidationState(int status, SISeg *segInOutP);
+static BackendId SIAssignBackendId(SISeg *segInOutP, BackendTag backendTag);
+static int SIGetNumEntries(SISeg *segP);
/************************************************************************/
/* SISetActiveProcess(segP, backendId) set the backend status active */
/************************************************************************/
/* XXX I suspect that the segP parameter is extraneous. -hirohama */
static void
-SISetActiveProcess(SISeg * segInOutP, BackendId backendId)
+SISetActiveProcess(SISeg *segInOutP, BackendId backendId)
{
/* mark all messages as read */
/* SIBackendInit() initializes a backend to operate on the buffer */
/****************************************************************************/
int
-SIBackendInit(SISeg * segInOutP)
+SIBackendInit(SISeg *segInOutP)
{
LRelId LtCreateRelId();
TransactionId LMITransactionIdCopy();
* ----------------
*/
static BackendId
-SIAssignBackendId(SISeg * segInOutP, BackendTag backendTag)
+SIAssignBackendId(SISeg *segInOutP, BackendTag backendTag)
{
Index index;
ProcState *stateP;
/* should be called only by the postmaster when a backend died */
/************************************************************************/
static void
-SISetDeadProcess(SISeg * segP, int backendId)
+SISetDeadProcess(SISeg *segP, int backendId)
{
/* XXX call me.... */
*/
static void
CleanupInvalidationState(int status, /* XXX */
- SISeg * segInOutP) /* XXX style */
+ SISeg *segInOutP) /* XXX style */
{
Assert(PointerIsValid(segInOutP));
/* SISetStartEntrySection(segP, offset) - sets the offset */
/************************************************************************/
static void
-SISetStartEntrySection(SISeg * segP, Offset offset)
+SISetStartEntrySection(SISeg *segP, Offset offset)
{
segP->startEntrySection = offset;
}
/* SIGetStartEntrySection(segP) - returnss the offset */
/************************************************************************/
static Offset
-SIGetStartEntrySection(SISeg * segP)
+SIGetStartEntrySection(SISeg *segP)
{
return (segP->startEntrySection);
}
/* SISetEndEntrySection(segP, offset) - sets the offset */
/************************************************************************/
static void
-SISetEndEntrySection(SISeg * segP, Offset offset)
+SISetEndEntrySection(SISeg *segP, Offset offset)
{
segP->endEntrySection = offset;
}
/* SISetEndEntryChain(segP, offset) - sets the offset */
/************************************************************************/
static void
-SISetEndEntryChain(SISeg * segP, Offset offset)
+SISetEndEntryChain(SISeg *segP, Offset offset)
{
segP->endEntryChain = offset;
}
/* SIGetEndEntryChain(segP) - returnss the offset */
/************************************************************************/
static Offset
-SIGetEndEntryChain(SISeg * segP)
+SIGetEndEntryChain(SISeg *segP)
{
return (segP->endEntryChain);
}
/* SISetStartEntryChain(segP, offset) - sets the offset */
/************************************************************************/
static void
-SISetStartEntryChain(SISeg * segP, Offset offset)
+SISetStartEntryChain(SISeg *segP, Offset offset)
{
segP->startEntryChain = offset;
}
/* SIGetStartEntryChain(segP) - returns the offset */
/************************************************************************/
static Offset
-SIGetStartEntryChain(SISeg * segP)
+SIGetStartEntryChain(SISeg *segP)
{
return (segP->startEntryChain);
}
/* SISetNumEntries(segP, num) sets the current nuber of entries */
/************************************************************************/
static bool
-SISetNumEntries(SISeg * segP, int num)
+SISetNumEntries(SISeg *segP, int num)
{
if (num <= MAXNUMMESSAGES)
{
/* SIGetNumEntries(segP) - returns the current nuber of entries */
/************************************************************************/
static int
-SIGetNumEntries(SISeg * segP)
+SIGetNumEntries(SISeg *segP)
{
return (segP->numEntries);
}
/* SISetMaxNumEntries(segP, num) sets the maximal number of entries */
/************************************************************************/
static bool
-SISetMaxNumEntries(SISeg * segP, int num)
+SISetMaxNumEntries(SISeg *segP, int num)
{
if (num <= MAXNUMMESSAGES)
{
/* SIGetProcStateLimit(segP, i) returns the limit of read messages */
/************************************************************************/
static int
-SIGetProcStateLimit(SISeg * segP, int i)
+SIGetProcStateLimit(SISeg *segP, int i)
{
return (segP->procState[i].limit);
}
/* SIIncNumEntries(segP, num) increments the current nuber of entries */
/************************************************************************/
static bool
-SIIncNumEntries(SISeg * segP, int num)
+SIIncNumEntries(SISeg *segP, int num)
{
if ((segP->numEntries + num) <= MAXNUMMESSAGES)
{
/* SIDecNumEntries(segP, num) decrements the current nuber of entries */
/************************************************************************/
static bool
-SIDecNumEntries(SISeg * segP, int num)
+SIDecNumEntries(SISeg *segP, int num)
{
if ((segP->numEntries - num) >= 0)
{
/* SISetStartFreeSpace(segP, offset) - sets the offset */
/************************************************************************/
static void
-SISetStartFreeSpace(SISeg * segP, Offset offset)
+SISetStartFreeSpace(SISeg *segP, Offset offset)
{
segP->startFreeSpace = offset;
}
/* SIGetStartFreeSpace(segP) - returns the offset */
/************************************************************************/
static Offset
-SIGetStartFreeSpace(SISeg * segP)
+SIGetStartFreeSpace(SISeg *segP)
{
return (segP->startFreeSpace);
}
/* SIGetFirstDataEntry(segP) returns first data entry */
/************************************************************************/
static SISegEntry *
-SIGetFirstDataEntry(SISeg * segP)
+SIGetFirstDataEntry(SISeg *segP)
{
SISegEntry *eP;
Offset startChain;
/* SIGetLastDataEntry(segP) returns last data entry in the chain */
/************************************************************************/
static SISegEntry *
-SIGetLastDataEntry(SISeg * segP)
+SIGetLastDataEntry(SISeg *segP)
{
SISegEntry *eP;
Offset endChain;
/* SIGetNextDataEntry(segP, offset) returns next data entry */
/************************************************************************/
static SISegEntry *
-SIGetNextDataEntry(SISeg * segP, Offset offset)
+SIGetNextDataEntry(SISeg *segP, Offset offset)
{
SISegEntry *eP;
/* SIGetNthDataEntry(segP, n) returns the n-th data entry in chain */
/************************************************************************/
static SISegEntry *
-SIGetNthDataEntry(SISeg * segP,
+SIGetNthDataEntry(SISeg *segP,
int n) /* must range from 1 to MaxMessages */
{
SISegEntry *eP;
/* SIEntryOffset(segP, entryP) returns the offset for an pointer */
/************************************************************************/
static Offset
-SIEntryOffset(SISeg * segP, SISegEntry * entryP)
+SIEntryOffset(SISeg *segP, SISegEntry *entryP)
{
/* relative to B !! */
return ((Offset) ((Pointer) entryP -
/* SISetDataEntry(segP, data) - sets a message in the segemnt */
/************************************************************************/
bool
-SISetDataEntry(SISeg * segP, SharedInvalidData * data)
+SISetDataEntry(SISeg *segP, SharedInvalidData *data)
{
Offset offsetToNewData;
SISegEntry *eP,
/* SIDecProcLimit(segP, num) decrements all process limits */
/************************************************************************/
static void
-SIDecProcLimit(SISeg * segP, int num)
+SIDecProcLimit(SISeg *segP, int num)
{
int i;
/* SIDelDataEntry(segP) - free the FIRST entry */
/************************************************************************/
bool
-SIDelDataEntry(SISeg * segP)
+SIDelDataEntry(SISeg *segP)
{
SISegEntry *e1P;
/* invalid */
/************************************************************************/
void
-SISetProcStateInvalid(SISeg * segP)
+SISetProcStateInvalid(SISeg *segP)
{
int i;
/* and executes function */
/************************************************************************/
void
-SIReadEntryData(SISeg * segP,
+SIReadEntryData(SISeg *segP,
int backendId,
void (*invalFunction) (),
void (*resetFunction) ())
/* SIDelExpiredDataEntries (segP) - removes irrelevant messages */
/************************************************************************/
void
-SIDelExpiredDataEntries(SISeg * segP)
+SIDelExpiredDataEntries(SISeg *segP)
{
int min,
i,
/* SISegInit(segP) - initializes the segment */
/************************************************************************/
static void
-SISegInit(SISeg * segP)
+SISegInit(SISeg *segP)
{
SISegOffsets *oP;
int segSize,
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.16 1997/09/08 20:56:50 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.17 1997/09/08 21:47:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* non-export function prototypes */
static HeapTuple
-inv_newtuple(LargeObjectDesc * obj_desc, Buffer buffer,
+inv_newtuple(LargeObjectDesc *obj_desc, Buffer buffer,
Page page, char *dbuf, int nwrite);
-static HeapTuple inv_fetchtup(LargeObjectDesc * obj_desc, Buffer *bufP);
-static int inv_wrnew(LargeObjectDesc * obj_desc, char *buf, int nbytes);
+static HeapTuple inv_fetchtup(LargeObjectDesc *obj_desc, Buffer *bufP);
+static int inv_wrnew(LargeObjectDesc *obj_desc, char *buf, int nbytes);
static int
-inv_wrold(LargeObjectDesc * obj_desc, char *dbuf, int nbytes,
+inv_wrold(LargeObjectDesc *obj_desc, char *dbuf, int nbytes,
HeapTuple htup, Buffer buffer);
-static void inv_indextup(LargeObjectDesc * obj_desc, HeapTuple htup);
+static void inv_indextup(LargeObjectDesc *obj_desc, HeapTuple htup);
static int _inv_getsize(Relation hreln, TupleDesc hdesc, Relation ireln);
/*
* Closes an existing large object descriptor.
*/
void
-inv_close(LargeObjectDesc * obj_desc)
+inv_close(LargeObjectDesc *obj_desc)
{
Assert(PointerIsValid(obj_desc));
*/
#ifdef NOT_USED
int
-inv_stat(LargeObjectDesc * obj_desc, struct pgstat * stbuf)
+inv_stat(LargeObjectDesc *obj_desc, struct pgstat * stbuf)
{
Assert(PointerIsValid(obj_desc));
Assert(stbuf != NULL);
#endif
int
-inv_seek(LargeObjectDesc * obj_desc, int offset, int whence)
+inv_seek(LargeObjectDesc *obj_desc, int offset, int whence)
{
int oldOffset;
Datum d;
}
int
-inv_tell(LargeObjectDesc * obj_desc)
+inv_tell(LargeObjectDesc *obj_desc)
{
Assert(PointerIsValid(obj_desc));
}
int
-inv_read(LargeObjectDesc * obj_desc, char *buf, int nbytes)
+inv_read(LargeObjectDesc *obj_desc, char *buf, int nbytes)
{
HeapTuple htup;
Buffer b;
}
int
-inv_write(LargeObjectDesc * obj_desc, char *buf, int nbytes)
+inv_write(LargeObjectDesc *obj_desc, char *buf, int nbytes)
{
HeapTuple htup;
Buffer b;
* such tuple exists.
*/
static HeapTuple
-inv_fetchtup(LargeObjectDesc * obj_desc, Buffer *bufP)
+inv_fetchtup(LargeObjectDesc *obj_desc, Buffer *bufP)
{
HeapTuple htup;
RetrieveIndexResult res;
* number of bytes actually written to the new tuple.
*/
static int
-inv_wrnew(LargeObjectDesc * obj_desc, char *buf, int nbytes)
+inv_wrnew(LargeObjectDesc *obj_desc, char *buf, int nbytes)
{
Relation hr;
HeapTuple ntup;
}
static int
-inv_wrold(LargeObjectDesc * obj_desc,
+inv_wrold(LargeObjectDesc *obj_desc,
char *dbuf,
int nbytes,
HeapTuple htup,
}
static HeapTuple
-inv_newtuple(LargeObjectDesc * obj_desc,
+inv_newtuple(LargeObjectDesc *obj_desc,
Buffer buffer,
Page page,
char *dbuf,
}
static void
-inv_indextup(LargeObjectDesc * obj_desc, HeapTuple htup)
+inv_indextup(LargeObjectDesc *obj_desc, HeapTuple htup)
{
InsertIndexResult res;
Datum v[1];
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.7 1997/09/08 02:29:10 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.8 1997/09/08 21:47:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "storage/bufmgr.h"
#include "access/transam.h" /* for AmiTransactionId */
-static void LRelIdAssign(LRelId * lRelId, Oid dbId, Oid relId);
+static void LRelIdAssign(LRelId *lRelId, Oid dbId, Oid relId);
/* ----------------
*
DatabaseIdIsMyDatabaseId(Oid databaseId)
{
return (bool)
- (!OidIsValid(databaseId) || databaseId == MyDatabaseId);
+ (!OidIsValid(databaseId) || databaseId == MyDatabaseId);
}
#endif
LRelIdContainsMyDatabaseId(LRelId lRelId)
{
return (bool)
- (!OidIsValid(lRelId.dbId) || lRelId.dbId == MyDatabaseId);
+ (!OidIsValid(lRelId.dbId) || lRelId.dbId == MyDatabaseId);
}
#endif
* Create an LRelid --- Why not just pass in a pointer to the storage?
*/
static void
-LRelIdAssign(LRelId * lRelId, Oid dbId, Oid relId)
+LRelIdAssign(LRelId *lRelId, Oid dbId, Oid relId)
{
lRelId->dbId = dbId;
lRelId->relId = relId;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.13 1997/09/08 02:29:15 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.14 1997/09/08 21:47:26 momjian Exp $
*
* NOTES
* Outside modules can create a lock table and acquire/release
#include "access/transam.h"
static int
-WaitOnLock(LOCKTAB * ltable, LockTableId tableId, LOCK * lock,
+WaitOnLock(LOCKTAB *ltable, LockTableId tableId, LOCK *lock,
LOCKT lockt);
/*#define LOCK_MGR_DEBUG*/
* Notes: just copying. Should only be called once.
*/
static void
-LockTypeInit(LOCKTAB * ltable,
- MASK * conflictsP,
+LockTypeInit(LOCKTAB *ltable,
+ MASK *conflictsP,
int *prioP,
int ntypes)
{
*/
LockTableId
LockTabInit(char *tabName,
- MASK * conflictsP,
+ MASK *conflictsP,
int *prioP,
int ntypes)
{
#endif
*/
bool
-LockAcquire(LockTableId tableId, LOCKTAG * lockName, LOCKT lockt)
+LockAcquire(LockTableId tableId, LOCKTAG *lockName, LOCKT lockt)
{
XIDLookupEnt *result,
item;
}
#endif
- result = (XIDLookupEnt *) hash_search(xidTable, (Pointer) & item, HASH_ENTER, &found);
+ result = (XIDLookupEnt *) hash_search(xidTable, (Pointer) &item, HASH_ENTER, &found);
if (!result)
{
elog(NOTICE, "LockAcquire: xid table corrupted");
if (!result->nHolding)
{
SHMQueueDelete(&result->queue);
- hash_search(xidTable, (Pointer) & item, HASH_REMOVE, &found);
+ hash_search(xidTable, (Pointer) &item, HASH_REMOVE, &found);
}
lock->nHolding--;
lock->holders[lockt]--;
* ----------------------------
*/
int
-LockResolveConflicts(LOCKTAB * ltable,
- LOCK * lock,
+LockResolveConflicts(LOCKTAB *ltable,
+ LOCK *lock,
LOCKT lockt,
TransactionId xid)
{
#endif
if (!(result = (XIDLookupEnt *)
- hash_search(xidTable, (Pointer) & item, HASH_ENTER, &found)))
+ hash_search(xidTable, (Pointer) &item, HASH_ENTER, &found)))
{
elog(NOTICE, "LockResolveConflicts: xid table corrupted");
return (STATUS_ERROR);
}
static int
-WaitOnLock(LOCKTAB * ltable, LockTableId tableId, LOCK * lock, LOCKT lockt)
+WaitOnLock(LOCKTAB *ltable, LockTableId tableId, LOCK *lock, LOCKT lockt)
{
PROC_QUEUE *waitQueue = &(lock->waitProcs);
* come along and request the lock).
*/
bool
-LockRelease(LockTableId tableId, LOCKTAG * lockName, LOCKT lockt)
+LockRelease(LockTableId tableId, LOCKTAG *lockName, LOCKT lockt)
{
LOCK *lock = NULL;
SPINLOCK masterLock;
*/
Assert(ltable->lockHash->hash == tag_hash);
lock = (LOCK *) hash_search(ltable->lockHash,
- (Pointer) & (lock->tag),
+ (Pointer) &(lock->tag),
HASH_REMOVE_SAVED,
&found);
Assert(lock && found);
#endif
if (!(result = (XIDLookupEnt *) hash_search(xidTable,
- (Pointer) & item,
+ (Pointer) &item,
HASH_FIND_SAVE,
&found))
|| !found)
if (result->queue.next != INVALID_OFFSET)
SHMQueueDelete(&result->queue);
if (!(result = (XIDLookupEnt *)
- hash_search(xidTable, (Pointer) & item, HASH_REMOVE_SAVED, &found)) ||
+ hash_search(xidTable, (Pointer) &item, HASH_REMOVE_SAVED, &found)) ||
!found)
{
SpinRelease(masterLock);
*/
Assert(ltable->lockHash->hash == tag_hash);
lock = (LOCK *) hash_search(ltable->lockHash,
- (Pointer) & (lock->tag),
+ (Pointer) &(lock->tag),
HASH_REMOVE,
&found);
Assert(lock && found);
* the new lock holder.
*/
void
-GrantLock(LOCK * lock, LOCKT lockt)
+GrantLock(LOCK *lock, LOCKT lockt)
{
lock->nActive++;
lock->activeHolders[lockt]++;
*/
#endif
bool
-LockReleaseAll(LockTableId tableId, SHM_QUEUE * lockQueue)
+LockReleaseAll(LockTableId tableId, SHM_QUEUE *lockQueue)
{
PROC_QUEUE *waitQueue;
int done;
#ifdef USER_LOCKS
SpinAcquire(masterLock);
#endif
- SHMQueueFirst(lockQueue, (Pointer *) & xidLook, &xidLook->queue);
+ SHMQueueFirst(lockQueue, (Pointer *) &xidLook, &xidLook->queue);
XID_PRINT("LockReleaseAll", xidLook);
Assert(ltable->lockHash->hash == tag_hash);
lock = (LOCK *)
- hash_search(ltable->lockHash, (Pointer) & (lock->tag), HASH_REMOVE, &found);
+ hash_search(ltable->lockHash, (Pointer) &(lock->tag), HASH_REMOVE, &found);
if ((!lock) || (!found))
{
SpinRelease(masterLock);
#endif
if (done)
break;
- SHMQueueFirst(&xidLook->queue, (Pointer *) & tmp, &tmp->queue);
+ SHMQueueFirst(&xidLook->queue, (Pointer *) &tmp, &tmp->queue);
xidLook = tmp;
}
SpinRelease(masterLock);
if (SHMQueueEmpty(lockQueue))
return;
- SHMQueueFirst(lockQueue, (Pointer *) & xidLook, &xidLook->queue);
+ SHMQueueFirst(lockQueue, (Pointer *) &xidLook, &xidLook->queue);
end = MAKE_OFFSET(lockQueue);
LOCK_DUMP("DumpLocks", MyProc->waitLock, 0);
if (done)
break;
- SHMQueueFirst(&xidLook->queue, (Pointer *) & tmp, &tmp->queue);
+ SHMQueueFirst(&xidLook->queue, (Pointer *) &tmp, &tmp->queue);
xidLook = tmp;
}
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Attic/multi.c,v 1.6 1997/09/08 02:29:16 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/Attic/multi.c,v 1.7 1997/09/08 21:47:29 momjian Exp $
*
* NOTES:
* (1) The lock.c module assumes that the caller here is doing
#include "miscadmin.h" /* MyDatabaseId */
static bool
-MultiAcquire(LockTableId tableId, LOCKTAG * tag, LOCKT lockt,
+MultiAcquire(LockTableId tableId, LOCKTAG *tag, LOCKT lockt,
LOCK_LEVEL level);
static bool
-MultiRelease(LockTableId tableId, LOCKTAG * tag, LOCKT lockt,
+MultiRelease(LockTableId tableId, LOCKTAG *tag, LOCKT lockt,
LOCK_LEVEL level);
/*
*/
static bool
MultiAcquire(LockTableId tableId,
- LOCKTAG * tag,
+ LOCKTAG *tag,
LOCKT lockt,
LOCK_LEVEL level)
{
*/
static bool
MultiRelease(LockTableId tableId,
- LOCKTAG * tag,
+ LOCKTAG *tag,
LOCKT lockt,
LOCK_LEVEL level)
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.20 1997/09/08 02:29:17 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.21 1997/09/08 21:47:30 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* This is so that we can support more backends. (system-wide semaphore
* sets run out pretty fast.) -ay 4/95
*
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.20 1997/09/08 02:29:17 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.21 1997/09/08 21:47:30 momjian Exp $
*/
#include <sys/time.h>
#include <unistd.h>
#include "storage/proc.h"
static void HandleDeadLock(int sig);
-static PROC *ProcWakeup(PROC * proc, int errType);
+static PROC *ProcWakeup(PROC *proc, int errType);
/*
* timeout (in seconds) for resolving possible deadlock
PROC *MyProc = NULL;
static void ProcKill(int exitStatus, int pid);
-static void ProcGetNewSemKeyAndNum(IPCKey * key, int *semNum);
+static void ProcGetNewSemKeyAndNum(IPCKey *key, int *semNum);
static void ProcFreeSem(IpcSemaphoreKey semKey, int semNum);
/*
* ProcQueueInit -- initialize a shared memory process queue
*/
void
-ProcQueueInit(PROC_QUEUE * queue)
+ProcQueueInit(PROC_QUEUE *queue)
{
SHMQueueInit(&(queue->links));
queue->size = 0;
* NOTES: The process queue is now a priority queue for locking.
*/
int
-ProcSleep(PROC_QUEUE * queue,
+ProcSleep(PROC_QUEUE *queue,
SPINLOCK spinlock,
int token,
int prio,
- LOCK * lock)
+ LOCK *lock)
{
int i;
PROC *proc;
* RETURN: the next process in the wait queue.
*/
static PROC *
-ProcWakeup(PROC * proc, int errType)
+ProcWakeup(PROC *proc, int errType)
{
PROC *retProc;
* released.
*/
int
-ProcLockWakeup(PROC_QUEUE * queue, char *ltable, char *lock)
+ProcLockWakeup(PROC_QUEUE *queue, char *ltable, char *lock)
{
PROC *proc;
int count;
}
void
-ProcAddLock(SHM_QUEUE * elem)
+ProcAddLock(SHM_QUEUE *elem)
{
SHMQueueInsertTL(&MyProc->lockQueue, elem);
}
}
void
-ProcReleaseSpins(PROC * proc)
+ProcReleaseSpins(PROC *proc)
{
int i;
* semaphore set.)
*/
static void
-ProcGetNewSemKeyAndNum(IPCKey * key, int *semNum)
+ProcGetNewSemKeyAndNum(IPCKey *key, int *semNum)
{
int i;
int32 *freeSemMap = ProcGlobal->freeSemMap;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.20 1997/09/08 02:29:28 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.21 1997/09/08 21:47:32 momjian Exp $
*
*-------------------------------------------------------------------------
*/
int mdfd_lstbcnt; /* most recent block count */
int mdfd_nextFree; /* next free vector */
struct _MdfdVec *mdfd_chain;/* for large relations */
-} MdfdVec;
+} MdfdVec;
static int Nfds = 100;
static MdfdVec *Md_fdvec = (MdfdVec *) NULL;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.10 1997/09/08 02:29:36 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.11 1997/09/08 21:47:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
int (*smgr_truncate) ();
int (*smgr_commit) (); /* may be NULL */
int (*smgr_abort) (); /* may be NULL */
-} f_smgr;
+} f_smgr;
/*
* The weird placement of commas in this init block is to keep the compiler
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgrtype.c,v 1.4 1997/09/08 02:29:37 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgrtype.c,v 1.5 1997/09/08 21:47:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
typedef struct smgrid
{
char *smgr_name;
-} smgrid;
+} smgrid;
/*
* StorageManager[] -- List of defined storage managers.
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/Attic/aclchk.c,v 1.16 1997/09/08 20:56:53 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/Attic/aclchk.c,v 1.17 1997/09/08 21:47:48 momjian Exp $
*
* NOTES
* See acl.h.
pg_func_ownercheck(char *usename,
char *funcname,
int nargs,
- Oid * arglist)
+ Oid *arglist)
{
HeapTuple htp;
AclId user_id,
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.44 1997/09/08 02:29:48 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.45 1997/09/08 21:47:51 momjian Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
FILE *fn_Pfout; /* the output fd */
bool fn_done; /* set after the frontend closes its
* connection */
-} FrontEnd;
+} FrontEnd;
static Dllist *frontendList;
List *
pg_plan(char *query_string, /* string to execute */
- Oid * typev, /* argument types */
+ Oid *typev, /* argument types */
int nargs, /* number of arguments */
- QueryTreeList ** queryListP, /* pointer to the parse trees */
+ QueryTreeList **queryListP, /* pointer to the parse trees */
CommandDest dest) /* where results should go */
{
QueryTreeList *querytree_list;
*/
void
-pg_eval(char *query_string, char **argv, Oid * typev, int nargs)
+pg_eval(char *query_string, char **argv, Oid *typev, int nargs)
{
pg_eval_dest(query_string, argv, typev, nargs, whereToSendOutput);
}
void
pg_eval_dest(char *query_string,/* string to execute */
char **argv, /* arguments */
- Oid * typev, /* argument types */
+ Oid *typev, /* argument types */
int nargs, /* number of arguments */
CommandDest dest) /* where results should go */
{
if (IsUnderPostmaster == false)
{
puts("\nPOSTGRES backend interactive interface");
- puts("$Revision: 1.44 $ $Date: 1997/09/08 02:29:48 $");
+ puts("$Revision: 1.45 $ $Date: 1997/09/08 21:47:51 $");
}
/* ----------------
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.9 1997/09/08 02:29:49 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/pquery.c,v 1.10 1997/09/08 21:47:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "commands/command.h"
static char *CreateOperationTag(int operationType);
-static void ProcessQueryDesc(QueryDesc * queryDesc);
+static void ProcessQueryDesc(QueryDesc *queryDesc);
/* ----------------------------------------------------------------
* ----------------------------------------------------------------
*/
QueryDesc *
-CreateQueryDesc(Query * parsetree,
- Plan * plantree,
+CreateQueryDesc(Query *parsetree,
+ Plan *plantree,
CommandDest dest)
{
QueryDesc *qd = (QueryDesc *) palloc(sizeof(QueryDesc));
void
ProcessPortal(char *portalName,
- Query * parseTree,
- Plan * plan,
- EState * state,
+ Query *parseTree,
+ Plan *plan,
+ EState *state,
TupleDesc attinfo,
CommandDest dest)
{
* ----------------------------------------------------------------
*/
static void
-ProcessQueryDesc(QueryDesc * queryDesc)
+ProcessQueryDesc(QueryDesc *queryDesc)
{
Query *parseTree;
Plan *plan;
*/
void
-ProcessQuery(Query * parsetree,
- Plan * plan,
+ProcessQuery(Query *parsetree,
+ Plan *plan,
char *argv[],
- Oid * typev,
+ Oid *typev,
int nargs,
CommandDest dest)
{
QueryDesc *queryDesc;
extern int dontExecute; /* from postgres.c */
- extern void print_plan(Plan * p, Query * parsetree); /* from print.c */
+ extern void print_plan(Plan *p, Query *parsetree); /* from print.c */
queryDesc = CreateQueryDesc(parsetree, plan, dest);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.23 1997/09/08 02:29:50 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.24 1997/09/08 21:47:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* ----------------
*/
void
-ProcessUtility(Node * parsetree,
+ProcessUtility(Node *parsetree,
CommandDest dest)
{
char *commandTag = NULL;
CHECK_IF_ABORTED();
aip = stmt->aclitem;
+
modechg = stmt->modechg;
#ifndef NO_SECURITY
foreach(i, stmt->relNames)
* Routines for handling of 'SET var TO', 'SHOW var' and 'RESET var'
* statements.
*
- * $Id: variable.c,v 1.15 1997/09/08 02:29:52 momjian Exp $
+ * $Id: variable.c,v 1.16 1997/09/08 21:47:59 momjian Exp $
*
*/
struct VariableParsers
{
const char *name;
- bool(*parser) (const char *);
- bool(*show) ();
- bool(*reset) ();
+ bool (*parser) (const char *);
+ bool (*show) ();
+ bool (*reset) ();
} VariableParsers[] =
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tioga/Attic/tgRecipe.c,v 1.5 1997/09/08 02:30:08 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tioga/Attic/tgRecipe.c,v 1.6 1997/09/08 21:48:01 momjian Exp $
*
*-------------------------------------------------------------------------
*/
"select * from Edge e where e.belongsTo = '%s'"
/* static functions only used here */
-static void fillTgElement(TgElement * elem, PortalBuffer * pbuf, int tupno);
-static void fillTgNode(TgRecipe * r, TgNode * node, PortalBuffer * pbuf, int tupno);
-static TgRecipe *fillTgRecipe(PortalBuffer * pbuf, int tupno);
+static void fillTgElement(TgElement * elem, PortalBuffer *pbuf, int tupno);
+static void fillTgNode(TgRecipe * r, TgNode * node, PortalBuffer *pbuf, int tupno);
+static TgRecipe *fillTgRecipe(PortalBuffer *pbuf, int tupno);
static void lookupEdges(TgRecipe * r, char *name);
static void fillAllNodes(TgRecipe * r, char *name);
static void fillAllElements(TgRecipe * r, char *name);
-------------------------------------- */
void
-fillTgNode(TgRecipe * r, TgNode * node, PortalBuffer * pbuf, int tupno)
+fillTgNode(TgRecipe * r, TgNode * node, PortalBuffer *pbuf, int tupno)
{
char *nodeType;
char *nodeElem;
------------------------------------ */
void
-fillTgElement(TgElement * elem, PortalBuffer * pbuf, int tupno)
+fillTgElement(TgElement * elem, PortalBuffer *pbuf, int tupno)
{
char *srcLang,
*elemType;
and converts it to a C TgRecipe strcture
------------------------------------ */
TgRecipe *
-fillTgRecipe(PortalBuffer * pbuf, int tupno)
+fillTgRecipe(PortalBuffer *pbuf, int tupno)
{
TgRecipe *r;
int i,
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: tgRecipe.h,v 1.4 1997/09/08 20:57:05 momjian Exp $
+ * $Id: tgRecipe.h,v 1.5 1997/09/08 21:48:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
double x,
y;
-} Point; /* this should match whatever is in
+} Point; /* this should match whatever is in
+ *
*
*
* geo-decls.h */
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.16 1997/09/08 20:57:16 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.17 1997/09/08 21:48:05 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*/
ChangeACLStmt *
-makeAclStmt(char *privileges, List * rel_list, char *grantee,
+makeAclStmt(char *privileges, List *rel_list, char *grantee,
char grant_or_revoke)
{
ChangeACLStmt *n = makeNode(ChangeACLStmt);
char str[MAX_PARSE_BUFFER];
n->aclitem = (AclItem *) palloc(sizeof(AclItem));
+
/* the grantee string is "G <group_name>", "U <user_name>", or "ALL" */
if (grantee[0] == 'G') /* group permissions */
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.18 1997/09/08 20:57:21 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.19 1997/09/08 21:48:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifdef LOARRAY
static char *
-_ReadLOArray(char *str, int *nbytes, int *fd, bool * chunkFlag,
+_ReadLOArray(char *str, int *nbytes, int *fd, bool *chunkFlag,
int ndim, int dim[], int baseSize);
#endif
char typalign, bool typbyval);
static void
system_cache_lookup(Oid element_type, bool input, int *typlen,
- bool * typbyval, char *typdelim, Oid * typelem, Oid * proc,
+ bool *typbyval, char *typdelim, Oid *typelem, Oid *proc,
char *typalign);
static Datum _ArrayCast(char *value, bool byval, int len);
static int _ArrayClipCount(int stI[], int endpI[], ArrayType *array);
static void
_LOArrayRange(int st[], int endp[], int bsize, int srcfd,
- int destfd, ArrayType *array, int isSrcLO, bool * isNull);
+ int destfd, ArrayType *array, int isSrcLO, bool *isNull);
static void
_ReadArray(int st[], int endp[], int bsize, int srcfd, int destfd,
- ArrayType *array, int isDestLO, bool * isNull);
+ ArrayType *array, int isDestLO, bool *isNull);
static ArrayCastAndSet(char *src, bool typbyval, int typlen, char *dest);
static SanityCheckInput(int ndim, int n, int dim[], int lb[], int indx[]);
static int array_read(char *destptr, int eltsize, int nitems, char *srcptr);
_ReadLOArray(char *str,
int *nbytes,
int *fd,
- bool * chunkFlag,
+ bool *chunkFlag,
int ndim,
int dim[],
int baseSize)
*----------------------------------------------------------------------------
*/
char *
-array_dims(ArrayType *v, bool * isNull)
+array_dims(ArrayType *v, bool *isNull)
{
char *p,
*save_p;
int reftype,
int elmlen,
int arraylen,
- bool * isNull)
+ bool *isNull)
{
int i,
ndim,
int lowerIndx[],
int reftype,
int len,
- bool * isNull)
+ bool *isNull)
{
int i,
ndim,
int reftype,
int elmlen,
int arraylen,
- bool * isNull)
+ bool *isNull)
{
int ndim,
*dim,
ArrayType *newArr,
int reftype,
int len,
- bool * isNull)
+ bool *isNull)
{
int i,
ndim,
system_cache_lookup(Oid element_type,
bool input,
int *typlen,
- bool * typbyval,
+ bool *typbyval,
char *typdelim,
- Oid * typelem,
- Oid * proc,
+ Oid *typelem,
+ Oid *proc,
char *typalign)
{
HeapTuple typeTuple;
switch (len)
{
case 1:
- return ((Datum) * value);
+ return ((Datum) *value);
case 2:
- return ((Datum) * (int16 *) value);
+ return ((Datum) *(int16 *) value);
case 3:
case 4:
- return ((Datum) * (int32 *) value);
+ return ((Datum) *(int32 *) value);
default:
elog(WARN, "array_ref: byval and elt len > 4!");
break;
int destfd,
ArrayType *array,
int isSrcLO,
- bool * isNull)
+ bool *isNull)
{
int n,
*dim,
int destfd,
ArrayType *array,
int isDestLO,
- bool * isNull)
+ bool *isNull)
{
int n,
*dim,
* workings can be found in the book "Software Solutions in C" by
* Dale Schumacher, Academic Press, ISBN: 0-12-632360-7.
*
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.11 1997/09/08 02:30:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.12 1997/09/08 21:48:13 momjian Exp $
*/
#include <stdio.h>
* positive-valued amounts. - tgl 97/04/14
*/
const char *
-cash_out(Cash * value)
+cash_out(Cash *value)
{
char *result;
char buf[CASH_BUFSZ];
bool
-cash_eq(Cash * c1, Cash * c2)
+cash_eq(Cash *c1, Cash *c2)
{
if (!PointerIsValid(c1) || !PointerIsValid(c2))
return (FALSE);
} /* cash_eq() */
bool
-cash_ne(Cash * c1, Cash * c2)
+cash_ne(Cash *c1, Cash *c2)
{
if (!PointerIsValid(c1) || !PointerIsValid(c2))
return (FALSE);
} /* cash_ne() */
bool
-cash_lt(Cash * c1, Cash * c2)
+cash_lt(Cash *c1, Cash *c2)
{
if (!PointerIsValid(c1) || !PointerIsValid(c2))
return (FALSE);
} /* cash_lt() */
bool
-cash_le(Cash * c1, Cash * c2)
+cash_le(Cash *c1, Cash *c2)
{
if (!PointerIsValid(c1) || !PointerIsValid(c2))
return (FALSE);
} /* cash_le() */
bool
-cash_gt(Cash * c1, Cash * c2)
+cash_gt(Cash *c1, Cash *c2)
{
if (!PointerIsValid(c1) || !PointerIsValid(c2))
return (FALSE);
} /* cash_gt() */
bool
-cash_ge(Cash * c1, Cash * c2)
+cash_ge(Cash *c1, Cash *c2)
{
if (!PointerIsValid(c1) || !PointerIsValid(c2))
return (FALSE);
* Add two cash values.
*/
Cash *
-cash_pl(Cash * c1, Cash * c2)
+cash_pl(Cash *c1, Cash *c2)
{
Cash *result;
* Subtract two cash values.
*/
Cash *
-cash_mi(Cash * c1, Cash * c2)
+cash_mi(Cash *c1, Cash *c2)
{
Cash *result;
* Multiply cash by floating point number.
*/
Cash *
-cash_mul(Cash * c, float8 * f)
+cash_mul(Cash *c, float8 *f)
{
Cash *result;
* Round for now. - tgl 97/04/15
*/
Cash *
-cash_div(Cash * c, float8 * f)
+cash_div(Cash *c, float8 *f)
{
Cash *result;
* Return larger of two cash values.
*/
Cash *
-cashlarger(Cash * c1, Cash * c2)
+cashlarger(Cash *c1, Cash *c2)
{
Cash *result;
* Return smaller of two cash values.
*/
Cash *
-cashsmaller(Cash * c1, Cash * c2)
+cashsmaller(Cash *c1, Cash *c2)
{
Cash *result;
* Obviously way North American centric - sorry
*/
const char *
-cash_words_out(Cash * value)
+cash_words_out(Cash *value)
{
static char buf[128];
char *p = buf;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/char.c,v 1.10 1997/09/08 20:57:22 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/char.c,v 1.11 1997/09/08 21:48:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
if (ch == NULL)
return ((int32) NULL);
- return ((int32) * ch);
+ return ((int32) *ch);
}
/*
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/chunk.c,v 1.9 1997/09/08 20:57:24 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/chunk.c,v 1.10 1997/09/08 21:48:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
_FindBestChunk(int size, int dmax[], int dbest[], int dim,
int A[MAXPAT][MAXDIM + 1], int N);
static int get_next(int d[], int k, int C, int dmax[]);
-static void initialize_info(CHUNK_INFO * A, int ndim, int dim[], int chunk[]);
+static void initialize_info(CHUNK_INFO *A, int ndim, int dim[], int chunk[]);
#ifdef LOARRAY
static void
#endif
static int
-GetChunkSize(FILE * fd, int ndim, int dim[MAXDIM], int baseSize,
+GetChunkSize(FILE *fd, int ndim, int dim[MAXDIM], int baseSize,
int d[MAXDIM]);
/*------------------------------------------------------------------------
*/
char *
_ChunkArray(int fd,
- FILE * afd,
+ FILE *afd,
int ndim,
int dim[],
int baseSize,
*-----------------------------------------------------------------------
*/
static int
-GetChunkSize(FILE * fd,
+GetChunkSize(FILE *fd,
int ndim,
int dim[MAXDIM],
int baseSize,
#endif
static void
-initialize_info(CHUNK_INFO * A, int ndim, int dim[], int chunk[])
+initialize_info(CHUNK_INFO *A, int ndim, int dim[], int chunk[])
{
int i;
char *destfp,
ArrayType *array,
int isDestLO,
- bool * isNull)
+ bool *isNull)
{
int i,
j,
int bsize,
int fp,
ArrayType *array,
- bool * isNull)
+ bool *isNull)
{
int i,
j,
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.17 1997/09/08 20:57:26 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.18 1997/09/08 21:48:21 momjian Exp $
*
* NOTES
* This code is actually (almost) unused.
*****************************************************************************/
RelativeTime
-timespan_reltime(TimeSpan * timespan)
+timespan_reltime(TimeSpan *timespan)
{
RelativeTime time;
int year,
gettimeofday(&tp, &tpz);
strftime(templ, sizeof(templ), "%a %b %d %H:%M:%S.%%d %Y %Z",
- localtime((time_t *) & tp.tv_sec));
+ localtime((time_t *) &tp.tv_sec));
sprintf(buf, templ, tp.tv_usec);
len = VARHDRSZ + strlen(buf);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.15 1997/09/08 02:30:34 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.16 1997/09/08 21:48:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* Convert datetime to date data type.
*/
DateADT
-datetime_date(DateTime * datetime)
+datetime_date(DateTime *datetime)
{
DateADT result;
struct tm tt,
char *
-time_out(TimeADT * time)
+time_out(TimeADT *time)
{
char *result;
struct tm tt,
bool
-time_eq(TimeADT * time1, TimeADT * time2)
+time_eq(TimeADT *time1, TimeADT *time2)
{
if (!PointerIsValid(time1) || !PointerIsValid(time2))
return (FALSE);
} /* time_eq() */
bool
-time_ne(TimeADT * time1, TimeADT * time2)
+time_ne(TimeADT *time1, TimeADT *time2)
{
if (!PointerIsValid(time1) || !PointerIsValid(time2))
return (FALSE);
} /* time_eq() */
bool
-time_lt(TimeADT * time1, TimeADT * time2)
+time_lt(TimeADT *time1, TimeADT *time2)
{
if (!PointerIsValid(time1) || !PointerIsValid(time2))
return (FALSE);
} /* time_eq() */
bool
-time_le(TimeADT * time1, TimeADT * time2)
+time_le(TimeADT *time1, TimeADT *time2)
{
if (!PointerIsValid(time1) || !PointerIsValid(time2))
return (FALSE);
} /* time_eq() */
bool
-time_gt(TimeADT * time1, TimeADT * time2)
+time_gt(TimeADT *time1, TimeADT *time2)
{
if (!PointerIsValid(time1) || !PointerIsValid(time2))
return (FALSE);
} /* time_eq() */
bool
-time_ge(TimeADT * time1, TimeADT * time2)
+time_ge(TimeADT *time1, TimeADT *time2)
{
if (!PointerIsValid(time1) || !PointerIsValid(time2))
return (FALSE);
} /* time_eq() */
int
-time_cmp(TimeADT * time1, TimeADT * time2)
+time_cmp(TimeADT *time1, TimeADT *time2)
{
return ((*time1 < *time2) ? -1 : (((*time1 > *time2) ? 1 : 0)));
} /* time_cmp() */
* Convert date and time to datetime data type.
*/
DateTime *
-datetime_datetime(DateADT date, TimeADT * time)
+datetime_datetime(DateADT date, TimeADT *time)
{
DateTime *result;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.39 1997/09/08 02:30:37 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.40 1997/09/08 21:48:23 momjian Exp $
*
*-------------------------------------------------------------------------
*/
static int DecodeTimezone(char *str, int *tzp);
static int DecodeUnits(int field, char *lowtoken, int *val);
static int EncodeSpecialDateTime(DateTime dt, char *str);
-static datetkn *datebsearch(char *key, datetkn * base, unsigned int nel);
+static datetkn *datebsearch(char *key, datetkn *base, unsigned int nel);
static DateTime dt2local(DateTime dt, int timezone);
static void dt2time(DateTime dt, int *hour, int *min, double *sec);
static int j2day(int jd);
-static int timespan2tm(TimeSpan span, struct tm * tm, float8 * fsec);
-static int tm2timespan(struct tm * tm, double fsec, TimeSpan * span);
+static int timespan2tm(TimeSpan span, struct tm * tm, float8 *fsec);
+static int tm2timespan(struct tm * tm, double fsec, TimeSpan *span);
#define USE_DATE_CACHE 1
#define ROUND_ALL 0
* Convert a datetime to external form.
*/
char *
-datetime_out(DateTime * dt)
+datetime_out(DateTime *dt)
{
char *result;
int tz;
* Convert a time span to external form.
*/
char *
-timespan_out(TimeSpan * span)
+timespan_out(TimeSpan *span)
{
char *result;
bool
-datetime_finite(DateTime * datetime)
+datetime_finite(DateTime *datetime)
{
if (!PointerIsValid(datetime))
return FALSE;
#ifdef NOT_USED
bool
-timespan_finite(TimeSpan * timespan)
+timespan_finite(TimeSpan *timespan)
{
if (!PointerIsValid(timespan))
return FALSE;
/* datetime_relop - is datetime1 relop datetime2
*/
bool
-datetime_eq(DateTime * datetime1, DateTime * datetime2)
+datetime_eq(DateTime *datetime1, DateTime *datetime2)
{
DateTime dt1,
dt2;
} /* datetime_eq() */
bool
-datetime_ne(DateTime * datetime1, DateTime * datetime2)
+datetime_ne(DateTime *datetime1, DateTime *datetime2)
{
DateTime dt1,
dt2;
} /* datetime_ne() */
bool
-datetime_lt(DateTime * datetime1, DateTime * datetime2)
+datetime_lt(DateTime *datetime1, DateTime *datetime2)
{
DateTime dt1,
dt2;
} /* datetime_lt() */
bool
-datetime_gt(DateTime * datetime1, DateTime * datetime2)
+datetime_gt(DateTime *datetime1, DateTime *datetime2)
{
DateTime dt1,
dt2;
} /* datetime_gt() */
bool
-datetime_le(DateTime * datetime1, DateTime * datetime2)
+datetime_le(DateTime *datetime1, DateTime *datetime2)
{
DateTime dt1,
dt2;
} /* datetime_le() */
bool
-datetime_ge(DateTime * datetime1, DateTime * datetime2)
+datetime_ge(DateTime *datetime1, DateTime *datetime2)
{
DateTime dt1,
dt2;
* collate invalid datetime at the end
*/
int
-datetime_cmp(DateTime * datetime1, DateTime * datetime2)
+datetime_cmp(DateTime *datetime1, DateTime *datetime2)
{
DateTime dt1,
dt2;
/* timespan_relop - is timespan1 relop timespan2
*/
bool
-timespan_eq(TimeSpan * timespan1, TimeSpan * timespan2)
+timespan_eq(TimeSpan *timespan1, TimeSpan *timespan2)
{
if (!PointerIsValid(timespan1) || !PointerIsValid(timespan2))
return FALSE;
} /* timespan_eq() */
bool
-timespan_ne(TimeSpan * timespan1, TimeSpan * timespan2)
+timespan_ne(TimeSpan *timespan1, TimeSpan *timespan2)
{
if (!PointerIsValid(timespan1) || !PointerIsValid(timespan2))
return FALSE;
} /* timespan_ne() */
bool
-timespan_lt(TimeSpan * timespan1, TimeSpan * timespan2)
+timespan_lt(TimeSpan *timespan1, TimeSpan *timespan2)
{
double span1,
span2;
} /* timespan_lt() */
bool
-timespan_gt(TimeSpan * timespan1, TimeSpan * timespan2)
+timespan_gt(TimeSpan *timespan1, TimeSpan *timespan2)
{
double span1,
span2;
} /* timespan_gt() */
bool
-timespan_le(TimeSpan * timespan1, TimeSpan * timespan2)
+timespan_le(TimeSpan *timespan1, TimeSpan *timespan2)
{
double span1,
span2;
} /* timespan_le() */
bool
-timespan_ge(TimeSpan * timespan1, TimeSpan * timespan2)
+timespan_ge(TimeSpan *timespan1, TimeSpan *timespan2)
{
double span1,
span2;
/* timespan_cmp - 3-state comparison for timespan
*/
int
-timespan_cmp(TimeSpan * timespan1, TimeSpan * timespan2)
+timespan_cmp(TimeSpan *timespan1, TimeSpan *timespan2)
{
double span1,
span2;
*---------------------------------------------------------*/
DateTime *
-datetime_smaller(DateTime * datetime1, DateTime * datetime2)
+datetime_smaller(DateTime *datetime1, DateTime *datetime2)
{
DateTime *result;
} /* datetime_smaller() */
DateTime *
-datetime_larger(DateTime * datetime1, DateTime * datetime2)
+datetime_larger(DateTime *datetime1, DateTime *datetime2)
{
DateTime *result;
TimeSpan *
-datetime_mi(DateTime * datetime1, DateTime * datetime2)
+datetime_mi(DateTime *datetime1, DateTime *datetime2)
{
TimeSpan *result;
* to the last day of month.
*/
DateTime *
-datetime_pl_span(DateTime * datetime, TimeSpan * span)
+datetime_pl_span(DateTime *datetime, TimeSpan *span)
{
DateTime *result;
DateTime dt;
} /* datetime_pl_span() */
DateTime *
-datetime_mi_span(DateTime * datetime, TimeSpan * span)
+datetime_mi_span(DateTime *datetime, TimeSpan *span)
{
DateTime *result;
TimeSpan tspan;
TimeSpan *
-timespan_um(TimeSpan * timespan)
+timespan_um(TimeSpan *timespan)
{
TimeSpan *result;
TimeSpan *
-timespan_smaller(TimeSpan * timespan1, TimeSpan * timespan2)
+timespan_smaller(TimeSpan *timespan1, TimeSpan *timespan2)
{
TimeSpan *result;
} /* timespan_smaller() */
TimeSpan *
-timespan_larger(TimeSpan * timespan1, TimeSpan * timespan2)
+timespan_larger(TimeSpan *timespan1, TimeSpan *timespan2)
{
TimeSpan *result;
TimeSpan *
-timespan_pl(TimeSpan * span1, TimeSpan * span2)
+timespan_pl(TimeSpan *span1, TimeSpan *span2)
{
TimeSpan *result;
} /* timespan_pl() */
TimeSpan *
-timespan_mi(TimeSpan * span1, TimeSpan * span2)
+timespan_mi(TimeSpan *span1, TimeSpan *span2)
{
TimeSpan *result;
} /* timespan_mi() */
TimeSpan *
-timespan_div(TimeSpan * span1, float8 * arg2)
+timespan_div(TimeSpan *span1, float8 *arg2)
{
TimeSpan *result;
* is done.
*/
TimeSpan *
-datetime_age(DateTime * datetime1, DateTime * datetime2)
+datetime_age(DateTime *datetime1, DateTime *datetime2)
{
TimeSpan *result;
* Convert datetime to text data type.
*/
text *
-datetime_text(DateTime * datetime)
+datetime_text(DateTime *datetime)
{
text *result;
char *str;
* then call the standard input routine.
*/
DateTime *
-text_datetime(text * str)
+text_datetime(text *str)
{
DateTime *result;
int i;
* Convert timespan to text data type.
*/
text *
-timespan_text(TimeSpan * timespan)
+timespan_text(TimeSpan *timespan)
{
text *result;
char *str;
*/
#ifdef NOT_USED
TimeSpan *
-text_timespan(text * str)
+text_timespan(text *str)
{
TimeSpan *result;
int i;
* Extract specified field from datetime.
*/
DateTime *
-datetime_trunc(text * units, DateTime * datetime)
+datetime_trunc(text *units, DateTime *datetime)
{
DateTime *result;
* Extract specified field from timespan.
*/
TimeSpan *
-timespan_trunc(text * units, TimeSpan * timespan)
+timespan_trunc(text *units, TimeSpan *timespan)
{
TimeSpan *result;
* Extract specified field from datetime.
*/
float64
-datetime_part(text * units, DateTime * datetime)
+datetime_part(text *units, DateTime *datetime)
{
float64 result;
* Extract specified field from timespan.
*/
float64
-timespan_part(text * units, TimeSpan * timespan)
+timespan_part(text *units, TimeSpan *timespan)
{
float64 result;
* Encode datetime type with specified time zone.
*/
text *
-datetime_zone(text * zone, DateTime * datetime)
+datetime_zone(text *zone, DateTime *datetime)
{
text *result;
* Also, month is one-based, _not_ zero-based.
*/
int
-tm2datetime(struct tm * tm, double fsec, int *tzp, DateTime * result)
+tm2datetime(struct tm * tm, double fsec, int *tzp, DateTime *result)
{
double date,
* Convert a timespan data type to a tm structure.
*/
static int
-timespan2tm(TimeSpan span, struct tm * tm, float8 * fsec)
+timespan2tm(TimeSpan span, struct tm * tm, float8 *fsec)
{
double time;
} /* timespan2tm() */
static int
-tm2timespan(struct tm * tm, double fsec, TimeSpan * span)
+tm2timespan(struct tm * tm, double fsec, TimeSpan *span)
{
span->month = ((tm->tm_year * 12) + tm->tm_mon);
span->time = ((((((tm->tm_mday * 24) + tm->tm_hour) * 60) + tm->tm_min) * 60) + tm->tm_sec);
* is WAY faster than the generic bsearch().
*/
static datetkn *
-datebsearch(char *key, datetkn * base, unsigned int nel)
+datebsearch(char *key, datetkn *base, unsigned int nel)
{
register datetkn *last = base + nel - 1,
*position;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.19 1997/09/08 02:30:41 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.20 1997/09/08 21:48:25 momjian Exp $
*
*-------------------------------------------------------------------------
*/
if (*arg1 >= 0)
*result = (float64data) floor(tmp);
else
- *result = (float64data) - (floor(-tmp));
+ *result = (float64data) -(floor(-tmp));
return (result);
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.22 1997/09/08 20:57:29 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.23 1997/09/08 21:48:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define PI 3.1415926536
#endif
-static int point_inside(Point * p, int npts, Point plist[]);
+static int point_inside(Point *p, int npts, Point plist[]);
static int lseg_crossing(double x, double y, double px, double py);
static BOX *box_construct(double x1, double x2, double y1, double y2);
static BOX *box_copy(BOX *box);
static BOX *box_fill(BOX *result, double x1, double x2, double y1, double y2);
static double box_ht(BOX *box);
static double box_wd(BOX *box);
-static double circle_ar(CIRCLE * circle);
-static CIRCLE *circle_copy(CIRCLE * circle);
-static LINE *line_construct_pm(Point * pt, double m);
-static bool line_horizontal(LINE * line);
-static Point *line_interpt(LINE * l1, LINE * l2);
-static bool line_intersect(LINE * l1, LINE * l2);
-static bool line_parallel(LINE * l1, LINE * l2);
-static bool line_vertical(LINE * line);
-static double lseg_dt(LSEG * l1, LSEG * l2);
-static void make_bound_box(POLYGON * poly);
-static PATH *path_copy(PATH * path);
+static double circle_ar(CIRCLE *circle);
+static CIRCLE *circle_copy(CIRCLE *circle);
+static LINE *line_construct_pm(Point *pt, double m);
+static bool line_horizontal(LINE *line);
+static Point *line_interpt(LINE *l1, LINE *l2);
+static bool line_intersect(LINE *l1, LINE *l2);
+static bool line_parallel(LINE *l1, LINE *l2);
+static bool line_vertical(LINE *line);
+static double lseg_dt(LSEG *l1, LSEG *l2);
+static void make_bound_box(POLYGON *poly);
+static PATH *path_copy(PATH *path);
static bool plist_same(int npts, Point p1[], Point p2[]);
static Point *point_construct(double x, double y);
-static Point *point_copy(Point * pt);
-static int single_decode(char *str, float8 * x, char **ss);
+static Point *point_copy(Point *pt);
+static int single_decode(char *str, float8 *x, char **ss);
static int single_encode(float8 x, char *str);
-static int pair_decode(char *str, float8 * x, float8 * y, char **s);
+static int pair_decode(char *str, float8 *x, float8 *y, char **s);
static int pair_encode(float8 x, float8 y, char *str);
static int pair_count(char *s, char delim);
-static int path_decode(int opentype, int npts, char *str, int *isopen, char **ss, Point * p);
-static char *path_encode(bool closed, int npts, Point * pt);
-static void statlseg_construct(LSEG * lseg, Point * pt1, Point * pt2);
+static int path_decode(int opentype, int npts, char *str, int *isopen, char **ss, Point *p);
+static char *path_encode(bool closed, int npts, Point *pt);
+static void statlseg_construct(LSEG *lseg, Point *pt1, Point *pt2);
static double box_ar(BOX *box);
-static Point *interpt_sl(LSEG * lseg, LINE * line);
-static LINE *line_construct_pp(Point * pt1, Point * pt2);
+static Point *interpt_sl(LSEG *lseg, LINE *line);
+static LINE *line_construct_pp(Point *pt1, Point *pt2);
/*
*/
static int
-single_decode(char *str, float8 * x, char **s)
+single_decode(char *str, float8 *x, char **s)
{
char *cp;
} /* single_encode() */
static int
-pair_decode(char *str, float8 * x, float8 * y, char **s)
+pair_decode(char *str, float8 *x, float8 *y, char **s)
{
int has_delim;
char *cp;
}
static int
-path_decode(int opentype, int npts, char *str, int *isopen, char **ss, Point * p)
+path_decode(int opentype, int npts, char *str, int *isopen, char **ss, Point *p)
{
int depth = 0;
char *s,
} /* path_decode() */
static char *
-path_encode(bool closed, int npts, Point * pt)
+path_encode(bool closed, int npts, Point *pt)
{
char *result = PALLOC(npts * (P_MAXLEN + 3) + 2);
if (!PointerIsValid(box))
return (NULL);
- return (path_encode(-1, 2, (Point *) & (box->high)));
+ return (path_encode(-1, 2, (Point *) &(box->high)));
} /* box_out() */
*---------------------------------------------------------*/
static LINE * /* point-slope */
-line_construct_pm(Point * pt, double m)
+line_construct_pm(Point *pt, double m)
{
LINE *result = PALLOCTYPE(LINE);
static LINE * /* two points */
-line_construct_pp(Point * pt1, Point * pt2)
+line_construct_pp(Point *pt1, Point *pt2)
{
LINE *result = PALLOCTYPE(LINE);
*---------------------------------------------------------*/
static bool
-line_intersect(LINE * l1, LINE * l2)
+line_intersect(LINE *l1, LINE *l2)
{
return (!line_parallel(l1, l2));
}
static bool
-line_parallel(LINE * l1, LINE * l2)
+line_parallel(LINE *l1, LINE *l2)
{
#if FALSE
return (FPeq(l1->m, l2->m));
#ifdef NOT_USED
bool
-line_perp(LINE * l1, LINE * l2)
+line_perp(LINE *l1, LINE *l2)
{
#if FALSE
if (l1->m)
#endif
static bool
-line_vertical(LINE * line)
+line_vertical(LINE *line)
{
#if FALSE
return (FPeq(line->A, -1.0) && FPzero(line->B));
} /* line_vertical() */
static bool
-line_horizontal(LINE * line)
+line_horizontal(LINE *line)
{
#if FALSE
return (FPzero(line->m));
#ifdef NOT_USED
bool
-line_eq(LINE * l1, LINE * l2)
+line_eq(LINE *l1, LINE *l2)
{
double k;
*---------------------------------------------------------*/
double * /* distance between l1, l2 */
-line_distance(LINE * l1, LINE * l2)
+line_distance(LINE *l1, LINE *l2)
{
double *result = PALLOCTYPE(double);
Point *tmp;
* Point where two lines l1, l2 intersect (if any)
*/
static Point *
-line_interpt(LINE * l1, LINE * l2)
+line_interpt(LINE *l1, LINE *l2)
{
Point *result;
double x,
depth++;
}
- size = offsetof(PATH, p[0]) + (sizeof(path->p[0]) * npts);
+ size = offsetof(PATH, p[0]) +(sizeof(path->p[0]) * npts);
path = PALLOC(size);
path->size = size;
char *
-path_out(PATH * path)
+path_out(PATH *path)
{
if (!PointerIsValid(path))
return NULL;
- return (path_encode(path->closed, path->npts, (Point *) & (path->p[0])));
+ return (path_encode(path->closed, path->npts, (Point *) &(path->p[0])));
} /* path_out() */
*---------------------------------------------------------*/
bool
-path_n_lt(PATH * p1, PATH * p2)
+path_n_lt(PATH *p1, PATH *p2)
{
return ((p1->npts < p2->npts));
}
bool
-path_n_gt(PATH * p1, PATH * p2)
+path_n_gt(PATH *p1, PATH *p2)
{
return ((p1->npts > p2->npts));
}
bool
-path_n_eq(PATH * p1, PATH * p2)
+path_n_eq(PATH *p1, PATH *p2)
{
return ((p1->npts == p2->npts));
}
bool
-path_n_le(PATH * p1, PATH * p2)
+path_n_le(PATH *p1, PATH *p2)
{
return ((p1->npts <= p2->npts));
}
bool
-path_n_ge(PATH * p1, PATH * p2)
+path_n_ge(PATH *p1, PATH *p2)
{
return ((p1->npts >= p2->npts));
}
*---------------------------------------------------------*/
bool
-path_isclosed(PATH * path)
+path_isclosed(PATH *path)
{
if (!PointerIsValid(path))
return FALSE;
} /* path_isclosed() */
bool
-path_isopen(PATH * path)
+path_isopen(PATH *path)
{
if (!PointerIsValid(path))
return FALSE;
int4
-path_npoints(PATH * path)
+path_npoints(PATH *path)
{
if (!PointerIsValid(path))
return 0;
} /* path_npoints() */
PATH *
-path_close(PATH * path)
+path_close(PATH *path)
{
PATH *result;
PATH *
-path_open(PATH * path)
+path_open(PATH *path)
{
PATH *result;
PATH *
-path_copy(PATH * path)
+path_copy(PATH *path)
{
PATH *result;
int size;
- size = offsetof(PATH, p[0]) + (sizeof(path->p[0]) * path->npts);
+ size = offsetof(PATH, p[0]) +(sizeof(path->p[0]) * path->npts);
result = PALLOC(size);
memmove((char *) result, (char *) path, size);
* O(n^2) iterative edge check.
*/
bool
-path_inter(PATH * p1, PATH * p2)
+path_inter(PATH *p1, PATH *p2)
{
BOX b1,
b2;
/* this essentially does a cartesian product of the lsegs in the
two paths, and finds the min distance between any two lsegs */
double *
-path_distance(PATH * p1, PATH * p2)
+path_distance(PATH *p1, PATH *p2)
{
double *min = NULL,
*tmp;
*---------------------------------------------------------*/
double *
-path_length(PATH * path)
+path_length(PATH *path)
{
double *result;
int i;
#ifdef NOT_USED
double
-path_ln(PATH * path)
+path_ln(PATH *path)
{
double result;
int i;
} /* point_in() */
char *
-point_out(Point * pt)
+point_out(Point *pt)
{
if (!PointerIsValid(pt))
return (NULL);
static Point *
-point_copy(Point * pt)
+point_copy(Point *pt)
{
Point *result;
*---------------------------------------------------------*/
bool
-point_left(Point * pt1, Point * pt2)
+point_left(Point *pt1, Point *pt2)
{
return (FPlt(pt1->x, pt2->x));
}
bool
-point_right(Point * pt1, Point * pt2)
+point_right(Point *pt1, Point *pt2)
{
return (FPgt(pt1->x, pt2->x));
}
bool
-point_above(Point * pt1, Point * pt2)
+point_above(Point *pt1, Point *pt2)
{
return (FPgt(pt1->y, pt2->y));
}
bool
-point_below(Point * pt1, Point * pt2)
+point_below(Point *pt1, Point *pt2)
{
return (FPlt(pt1->y, pt2->y));
}
bool
-point_vert(Point * pt1, Point * pt2)
+point_vert(Point *pt1, Point *pt2)
{
return (FPeq(pt1->x, pt2->x));
}
bool
-point_horiz(Point * pt1, Point * pt2)
+point_horiz(Point *pt1, Point *pt2)
{
return (FPeq(pt1->y, pt2->y));
}
bool
-point_eq(Point * pt1, Point * pt2)
+point_eq(Point *pt1, Point *pt2)
{
return (point_horiz(pt1, pt2) && point_vert(pt1, pt2));
}
*---------------------------------------------------------*/
int32
-pointdist(Point * p1, Point * p2)
+pointdist(Point *p1, Point *p2)
{
int32 result;
}
double *
-point_distance(Point * pt1, Point * pt2)
+point_distance(Point *pt1, Point *pt2)
{
double *result = PALLOCTYPE(double);
double
-point_dt(Point * pt1, Point * pt2)
+point_dt(Point *pt1, Point *pt2)
{
return (HYPOT(pt1->x - pt2->x, pt1->y - pt2->y));
}
double *
-point_slope(Point * pt1, Point * pt2)
+point_slope(Point *pt1, Point *pt2)
{
double *result = PALLOCTYPE(double);
double
-point_sl(Point * pt1, Point * pt2)
+point_sl(Point *pt1, Point *pt2)
{
return (point_vert(pt1, pt2)
? (double) DBL_MAX
char *
-lseg_out(LSEG * ls)
+lseg_out(LSEG *ls)
{
if (!PointerIsValid(ls))
return (NULL);
- return (path_encode(FALSE, 2, (Point *) & (ls->p[0])));
+ return (path_encode(FALSE, 2, (Point *) &(ls->p[0])));
} /* lseg_out() */
* form a LSEG from two Points.
*/
LSEG *
-lseg_construct(Point * pt1, Point * pt2)
+lseg_construct(Point *pt1, Point *pt2)
{
LSEG *result = PALLOCTYPE(LSEG);
/* like lseg_construct, but assume space already allocated */
static void
-statlseg_construct(LSEG * lseg, Point * pt1, Point * pt2)
+statlseg_construct(LSEG *lseg, Point *pt1, Point *pt2)
{
lseg->p[0].x = pt1->x;
lseg->p[0].y = pt1->y;
** both segments.
*/
bool
-lseg_intersect(LSEG * l1, LSEG * l2)
+lseg_intersect(LSEG *l1, LSEG *l2)
{
LINE *ln;
Point *interpt;
}
bool
-lseg_parallel(LSEG * l1, LSEG * l2)
+lseg_parallel(LSEG *l1, LSEG *l2)
{
#if FALSE
return (FPeq(l1->m, l2->m));
} /* lseg_parallel() */
bool
-lseg_perp(LSEG * l1, LSEG * l2)
+lseg_perp(LSEG *l1, LSEG *l2)
{
double m1,
m2;
} /* lseg_perp() */
bool
-lseg_vertical(LSEG * lseg)
+lseg_vertical(LSEG *lseg)
{
return (FPeq(lseg->p[0].x, lseg->p[1].x));
}
bool
-lseg_horizontal(LSEG * lseg)
+lseg_horizontal(LSEG *lseg)
{
return (FPeq(lseg->p[0].y, lseg->p[1].y));
}
bool
-lseg_eq(LSEG * l1, LSEG * l2)
+lseg_eq(LSEG *l1, LSEG *l2)
{
return (FPeq(l1->p[0].x, l2->p[0].x) &&
FPeq(l1->p[1].y, l2->p[1].y) &&
* segment.
*/
double *
-lseg_distance(LSEG * l1, LSEG * l2)
+lseg_distance(LSEG *l1, LSEG *l2)
{
double *result = PALLOCTYPE(double);
/* distance between l1, l2 */
static double
-lseg_dt(LSEG * l1, LSEG * l2)
+lseg_dt(LSEG *l1, LSEG *l2)
{
double *d,
result;
Point *
-lseg_center(LSEG * lseg)
+lseg_center(LSEG *lseg)
{
Point *result;
* lsb residue. - tgl 1997-07-09
*/
Point *
-lseg_interpt(LSEG * l1, LSEG * l2)
+lseg_interpt(LSEG *l1, LSEG *l2)
{
Point *result;
LINE *tmp1,
*-------------------------------------------------------------------*/
double *
-dist_pl(Point * pt, LINE * line)
+dist_pl(Point *pt, LINE *line)
{
double *result = PALLOCTYPE(double);
}
double *
-dist_ps(Point * pt, LSEG * lseg)
+dist_ps(Point *pt, LSEG *lseg)
{
double m; /* slope of perp. */
LINE *ln;
** Distance from a point to a path
*/
double *
-dist_ppath(Point * pt, PATH * path)
+dist_ppath(Point *pt, PATH *path)
{
double *result;
double *tmp;
}
double *
-dist_pb(Point * pt, BOX *box)
+dist_pb(Point *pt, BOX *box)
{
Point *tmp;
double *result;
double *
-dist_sl(LSEG * lseg, LINE * line)
+dist_sl(LSEG *lseg, LINE *line)
{
double *result,
*d2;
double *
-dist_sb(LSEG * lseg, BOX *box)
+dist_sb(LSEG *lseg, BOX *box)
{
Point *tmp;
double *result;
double *
-dist_lb(LINE * line, BOX *box)
+dist_lb(LINE *line, BOX *box)
{
Point *tmp;
double *result;
double *
-dist_cpoly(CIRCLE * circle, POLYGON * poly)
+dist_cpoly(CIRCLE *circle, POLYGON *poly)
{
double *result;
int i;
*-------------------------------------------------------------------*/
static Point *
-interpt_sl(LSEG * lseg, LINE * line)
+interpt_sl(LSEG *lseg, LINE *line)
{
LINE *tmp;
Point *p;
* through the point.
*/
Point *
-close_pl(Point * pt, LINE * line)
+close_pl(Point *pt, LINE *line)
{
Point *result;
LINE *tmp;
* point of the segment and its perpendicular through the point.
*/
Point *
-close_ps(Point * pt, LSEG * lseg)
+close_ps(Point *pt, LSEG *lseg)
{
Point *result;
LINE *tmp;
} /* close_ps() */
Point *
-close_pb(Point * pt, BOX *box)
+close_pb(Point *pt, BOX *box)
{
/* think about this one for a while */
elog(WARN, "close_pb not implemented", NULL);
}
Point *
-close_sl(LSEG * lseg, LINE * line)
+close_sl(LSEG *lseg, LINE *line)
{
Point *result;
double *d1,
}
Point *
-close_sb(LSEG * lseg, BOX *box)
+close_sb(LSEG *lseg, BOX *box)
{
/* think about this one for a while */
elog(WARN, "close_sb not implemented", NULL);
}
Point *
-close_lb(LINE * line, BOX *box)
+close_lb(LINE *line, BOX *box)
{
/* think about this one for a while */
elog(WARN, "close_lb not implemented", NULL);
* Does the point satisfy the equation?
*/
bool
-on_pl(Point * pt, LINE * line)
+on_pl(Point *pt, LINE *line)
{
if (!PointerIsValid(pt) || !PointerIsValid(line))
return (FALSE);
* This algorithm seems to behave nicely even with lsb residues - tgl 1997-07-09
*/
bool
-on_ps(Point * pt, LSEG * lseg)
+on_ps(Point *pt, LSEG *lseg)
{
if (!PointerIsValid(pt) || !PointerIsValid(lseg))
return (FALSE);
}
bool
-on_pb(Point * pt, BOX *box)
+on_pb(Point *pt, BOX *box)
{
if (!PointerIsValid(pt) || !PointerIsValid(box))
return (FALSE);
#define NEXT(A) ((A+1) % path->npts) /* cyclic "i+1" */
bool
-on_ppath(Point * pt, PATH * path)
+on_ppath(Point *pt, PATH *path)
{
#if FALSE
int above,
bool
-on_sl(LSEG * lseg, LINE * line)
+on_sl(LSEG *lseg, LINE *line)
{
if (!PointerIsValid(lseg) || !PointerIsValid(line))
return (FALSE);
} /* on_sl() */
bool
-on_sb(LSEG * lseg, BOX *box)
+on_sb(LSEG *lseg, BOX *box)
{
if (!PointerIsValid(lseg) || !PointerIsValid(box))
return (FALSE);
*-------------------------------------------------------------------*/
bool
-inter_sl(LSEG * lseg, LINE * line)
+inter_sl(LSEG *lseg, LINE *line)
{
Point *tmp;
/* XXX segment and box should be able to intersect; tgl - 97/01/09 */
bool
-inter_sb(LSEG * lseg, BOX *box)
+inter_sb(LSEG *lseg, BOX *box)
{
return (0);
}
/* XXX line and box should be able to intersect; tgl - 97/01/09 */
bool
-inter_lb(LINE * line, BOX *box)
+inter_lb(LINE *line, BOX *box)
{
return (0);
}
* Make the smallest bounding box for the given polygon.
*---------------------------------------------------------------------*/
static void
-make_bound_box(POLYGON * poly)
+make_bound_box(POLYGON *poly)
{
int i;
double x1,
if ((npts = pair_count(str, ',')) <= 0)
elog(WARN, "Bad polygon external representation '%s'", str);
- size = offsetof(POLYGON, p[0]) + (sizeof(poly->p[0]) * npts);
+ size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * npts);
poly = PALLOC(size);
memset((char *) poly, 0, size); /* zero any holes */
* also support old format "(f8,f8,...,f8,f8)"
*---------------------------------------------------------------*/
char *
-poly_out(POLYGON * poly)
+poly_out(POLYGON *poly)
{
if (!PointerIsValid(poly))
return NULL;
* of B?
*-------------------------------------------------------*/
bool
-poly_left(POLYGON * polya, POLYGON * polyb)
+poly_left(POLYGON *polya, POLYGON *polyb)
{
return (polya->boundbox.high.x < polyb->boundbox.low.x);
}
* of B?
*-------------------------------------------------------*/
bool
-poly_overleft(POLYGON * polya, POLYGON * polyb)
+poly_overleft(POLYGON *polya, POLYGON *polyb)
{
return (polya->boundbox.low.x <= polyb->boundbox.high.x);
}
* of B?
*-------------------------------------------------------*/
bool
-poly_right(POLYGON * polya, POLYGON * polyb)
+poly_right(POLYGON *polya, POLYGON *polyb)
{
return (polya->boundbox.low.x > polyb->boundbox.high.x);
}
* of B?
*-------------------------------------------------------*/
bool
-poly_overright(POLYGON * polya, POLYGON * polyb)
+poly_overright(POLYGON *polya, POLYGON *polyb)
{
return (polya->boundbox.high.x > polyb->boundbox.low.x);
}
* closed shapes.
*-------------------------------------------------------*/
bool
-poly_same(POLYGON * polya, POLYGON * polyb)
+poly_same(POLYGON *polya, POLYGON *polyb)
{
if (!PointerIsValid(polya) || !PointerIsValid(polyb))
return FALSE;
* their bounding boxes overlap.
*-----------------------------------------------------------------*/
bool
-poly_overlap(POLYGON * polya, POLYGON * polyb)
+poly_overlap(POLYGON *polya, POLYGON *polyb)
{
return box_overlap(&(polya->boundbox), &(polyb->boundbox));
}
*-----------------------------------------------------------------*/
#if FALSE
bool
-poly_contain(POLYGON * polya, POLYGON * polyb)
+poly_contain(POLYGON *polya, POLYGON *polyb)
{
return box_contain(&(polya->boundbox), &(polyb->boundbox));
}
#endif
bool
-poly_contain(POLYGON * polya, POLYGON * polyb)
+poly_contain(POLYGON *polya, POLYGON *polyb)
{
int i;
*-----------------------------------------------------------------*/
#if FALSE
bool
-poly_contained(POLYGON * polya, POLYGON * polyb)
+poly_contained(POLYGON *polya, POLYGON *polyb)
{
return (box_contained(&(polya->boundbox), &(polyb->boundbox)));
}
#endif
bool
-poly_contained(POLYGON * polya, POLYGON * polyb)
+poly_contained(POLYGON *polya, POLYGON *polyb)
{
return (poly_contain(polyb, polya));
} /* poly_contained() */
*/
bool
-poly_contain_pt(POLYGON * poly, Point * p)
+poly_contain_pt(POLYGON *poly, Point *p)
{
if (!PointerIsValid(poly) || !PointerIsValid(p))
return (FALSE);
} /* poly_contain_pt() */
bool
-pt_contained_poly(Point * p, POLYGON * poly)
+pt_contained_poly(Point *p, POLYGON *poly)
{
if (!PointerIsValid(p) || !PointerIsValid(poly))
return (FALSE);
double *
-poly_distance(POLYGON * polya, POLYGON * polyb)
+poly_distance(POLYGON *polya, POLYGON *polyb)
{
double *result;
***********************************************************************/
Point *
-point(float8 * x, float8 * y)
+point(float8 *x, float8 *y)
{
if (!(PointerIsValid(x) && PointerIsValid(y)))
return (NULL);
Point *
-point_add(Point * p1, Point * p2)
+point_add(Point *p1, Point *p2)
{
Point *result;
} /* point_add() */
Point *
-point_sub(Point * p1, Point * p2)
+point_sub(Point *p1, Point *p2)
{
Point *result;
} /* point_sub() */
Point *
-point_mul(Point * p1, Point * p2)
+point_mul(Point *p1, Point *p2)
{
Point *result;
} /* point_mul() */
Point *
-point_div(Point * p1, Point * p2)
+point_div(Point *p1, Point *p2)
{
Point *result;
double div;
***********************************************************************/
BOX *
-box(Point * p1, Point * p2)
+box(Point *p1, Point *p2)
{
BOX *result;
} /* box() */
BOX *
-box_add(BOX *box, Point * p)
+box_add(BOX *box, Point *p)
{
BOX *result;
} /* box_add() */
BOX *
-box_sub(BOX *box, Point * p)
+box_sub(BOX *box, Point *p)
{
BOX *result;
} /* box_sub() */
BOX *
-box_mul(BOX *box, Point * p)
+box_mul(BOX *box, Point *p)
{
BOX *result;
Point *high,
} /* box_mul() */
BOX *
-box_div(BOX *box, Point * p)
+box_div(BOX *box, Point *p)
{
BOX *result;
Point *high,
* Concatenate two paths (only if they are both open).
*/
PATH *
-path_add(PATH * p1, PATH * p2)
+path_add(PATH *p1, PATH *p2)
{
PATH *result;
int size;
|| p1->closed || p2->closed)
return (NULL);
- size = offsetof(PATH, p[0]) + (sizeof(p1->p[0]) * (p1->npts + p2->npts));
+ size = offsetof(PATH, p[0]) +(sizeof(p1->p[0]) * (p1->npts + p2->npts));
result = PALLOC(size);
result->size = size;
* Translation operator.
*/
PATH *
-path_add_pt(PATH * path, Point * point)
+path_add_pt(PATH *path, Point *point)
{
PATH *result;
int i;
} /* path_add_pt() */
PATH *
-path_sub_pt(PATH * path, Point * point)
+path_sub_pt(PATH *path, Point *point)
{
PATH *result;
int i;
* Rotation and scaling operators.
*/
PATH *
-path_mul_pt(PATH * path, Point * point)
+path_mul_pt(PATH *path, Point *point)
{
PATH *result;
Point *p;
} /* path_mul_pt() */
PATH *
-path_div_pt(PATH * path, Point * point)
+path_div_pt(PATH *path, Point *point)
{
PATH *result;
Point *p;
bool
-path_contain_pt(PATH * path, Point * p)
+path_contain_pt(PATH *path, Point *p)
{
if (!PointerIsValid(path) || !PointerIsValid(p))
return (FALSE);
} /* path_contain_pt() */
bool
-pt_contained_path(Point * p, PATH * path)
+pt_contained_path(Point *p, PATH *path)
{
if (!PointerIsValid(p) || !PointerIsValid(path))
return (FALSE);
Point *
-path_center(PATH * path)
+path_center(PATH *path)
{
Point *result;
} /* path_center() */
POLYGON *
-path_poly(PATH * path)
+path_poly(PATH *path)
{
POLYGON *poly;
int size;
if (!path->closed)
elog(WARN, "Open path cannot be converted to polygon", NULL);
- size = offsetof(POLYGON, p[0]) + (sizeof(poly->p[0]) * path->npts);
+ size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * path->npts);
poly = PALLOC(size);
poly->size = size;
* '[(x1,y1),...]' for open path
*/
PATH
-* upgradepath(PATH * path)
+ *
+upgradepath(PATH *path)
{
PATH *result;
int size,
elog(WARN, "upgradepath: path already upgraded?", NULL);
npts = (path->npts - 1);
- size = offsetof(PATH, p[0]) + (sizeof(path->p[0]) * npts);
+ size = offsetof(PATH, p[0]) +(sizeof(path->p[0]) * npts);
result = PALLOC(size);
memset((char *) result, 0, size);
} /* upgradepath() */
bool
-isoldpath(PATH * path)
+isoldpath(PATH *path)
{
if (!PointerIsValid(path) || (path->npts < 2))
return (FALSE);
***********************************************************************/
int4
-poly_npoints(POLYGON * poly)
+poly_npoints(POLYGON *poly)
{
if (!PointerIsValid(poly))
return (0);
Point *
-poly_center(POLYGON * poly)
+poly_center(POLYGON *poly)
{
Point *result;
CIRCLE *circle;
BOX *
-poly_box(POLYGON * poly)
+poly_box(POLYGON *poly)
{
BOX *box;
return (NULL);
/* map four corners of the box to a polygon */
- size = offsetof(POLYGON, p[0]) + (sizeof(poly->p[0]) * 4);
+ size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * 4);
poly = PALLOC(size);
poly->size = size;
PATH *
-poly_path(POLYGON * poly)
+poly_path(POLYGON *poly)
{
PATH *path;
int size;
if (!PointerIsValid(poly) || (poly->npts < 0))
return (NULL);
- size = offsetof(PATH, p[0]) + (sizeof(path->p[0]) * poly->npts);
+ size = offsetof(PATH, p[0]) +(sizeof(path->p[0]) * poly->npts);
path = PALLOC(size);
path->size = size;
* New-style: '(x1,y1,x2,y2,...)'
*/
POLYGON
-* upgradepoly(POLYGON * poly)
+ *
+upgradepoly(POLYGON *poly)
{
POLYGON *result;
int size;
if (!PointerIsValid(poly) || (poly->npts < 1))
return (NULL);
- size = offsetof(POLYGON, p[0]) + (sizeof(poly->p[0]) * poly->npts);
+ size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * poly->npts);
result = PALLOC(size);
memset((char *) result, 0, size);
* Reverse effect of upgradepoly().
*/
POLYGON
-* revertpoly(POLYGON * poly)
+ *
+revertpoly(POLYGON *poly)
{
POLYGON *result;
int size;
if (!PointerIsValid(poly) || (poly->npts < 1))
return (NULL);
- size = offsetof(POLYGON, p[0]) + (sizeof(poly->p[0]) * poly->npts);
+ size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * poly->npts);
result = PALLOC(size);
memset((char *) result, 0, size);
/* circle_out - convert a circle to external form.
*/
char *
-circle_out(CIRCLE * circle)
+circle_out(CIRCLE *circle)
{
char *result;
char *cp;
/* circles identical?
*/
bool
-circle_same(CIRCLE * circle1, CIRCLE * circle2)
+circle_same(CIRCLE *circle1, CIRCLE *circle2)
{
return (FPeq(circle1->radius, circle2->radius)
&& FPeq(circle1->center.x, circle2->center.x)
/* circle_overlap - does circle1 overlap circle2?
*/
bool
-circle_overlap(CIRCLE * circle1, CIRCLE * circle2)
+circle_overlap(CIRCLE *circle1, CIRCLE *circle2)
{
return (FPle(point_dt(&circle1->center, &circle2->center), (circle1->radius + circle2->radius)));
}
* the right edge of circle2?
*/
bool
-circle_overleft(CIRCLE * circle1, CIRCLE * circle2)
+circle_overleft(CIRCLE *circle1, CIRCLE *circle2)
{
return (FPle((circle1->center.x + circle1->radius), (circle2->center.x + circle2->radius)));
}
/* circle_left - is circle1 strictly left of circle2?
*/
bool
-circle_left(CIRCLE * circle1, CIRCLE * circle2)
+circle_left(CIRCLE *circle1, CIRCLE *circle2)
{
return (FPle((circle1->center.x + circle1->radius), (circle2->center.x - circle2->radius)));
}
/* circle_right - is circle1 strictly right of circle2?
*/
bool
-circle_right(CIRCLE * circle1, CIRCLE * circle2)
+circle_right(CIRCLE *circle1, CIRCLE *circle2)
{
return (FPge((circle1->center.x - circle1->radius), (circle2->center.x + circle2->radius)));
}
* the left edge of circle2?
*/
bool
-circle_overright(CIRCLE * circle1, CIRCLE * circle2)
+circle_overright(CIRCLE *circle1, CIRCLE *circle2)
{
return (FPge((circle1->center.x - circle1->radius), (circle2->center.x - circle2->radius)));
}
/* circle_contained - is circle1 contained by circle2?
*/
bool
-circle_contained(CIRCLE * circle1, CIRCLE * circle2)
+circle_contained(CIRCLE *circle1, CIRCLE *circle2)
{
return (FPle((point_dt(&circle1->center, &circle2->center) + circle1->radius), circle2->radius));
}
/* circle_contain - does circle1 contain circle2?
*/
bool
-circle_contain(CIRCLE * circle1, CIRCLE * circle2)
+circle_contain(CIRCLE *circle1, CIRCLE *circle2)
{
return (FPle((point_dt(&circle1->center, &circle2->center) + circle2->radius), circle1->radius));
}
* is circle1 entirely {above,below} circle2?
*/
bool
-circle_below(CIRCLE * circle1, CIRCLE * circle2)
+circle_below(CIRCLE *circle1, CIRCLE *circle2)
{
return (FPle((circle1->center.y + circle1->radius), (circle2->center.y - circle2->radius)));
}
bool
-circle_above(CIRCLE * circle1, CIRCLE * circle2)
+circle_above(CIRCLE *circle1, CIRCLE *circle2)
{
return (FPge((circle1->center.y - circle1->radius), (circle2->center.y + circle2->radius)));
}
* our accuracy constraint?
*/
bool
-circle_eq(CIRCLE * circle1, CIRCLE * circle2)
+circle_eq(CIRCLE *circle1, CIRCLE *circle2)
{
return (FPeq(circle_ar(circle1), circle_ar(circle2)));
} /* circle_eq() */
bool
-circle_ne(CIRCLE * circle1, CIRCLE * circle2)
+circle_ne(CIRCLE *circle1, CIRCLE *circle2)
{
return (!circle_eq(circle1, circle2));
} /* circle_ne() */
bool
-circle_lt(CIRCLE * circle1, CIRCLE * circle2)
+circle_lt(CIRCLE *circle1, CIRCLE *circle2)
{
return (FPlt(circle_ar(circle1), circle_ar(circle2)));
} /* circle_lt() */
bool
-circle_gt(CIRCLE * circle1, CIRCLE * circle2)
+circle_gt(CIRCLE *circle1, CIRCLE *circle2)
{
return (FPgt(circle_ar(circle1), circle_ar(circle2)));
} /* circle_gt() */
bool
-circle_le(CIRCLE * circle1, CIRCLE * circle2)
+circle_le(CIRCLE *circle1, CIRCLE *circle2)
{
return (FPle(circle_ar(circle1), circle_ar(circle2)));
} /* circle_le() */
bool
-circle_ge(CIRCLE * circle1, CIRCLE * circle2)
+circle_ge(CIRCLE *circle1, CIRCLE *circle2)
{
return (FPge(circle_ar(circle1), circle_ar(circle2)));
} /* circle_ge() */
*---------------------------------------------------------*/
static CIRCLE *
-circle_copy(CIRCLE * circle)
+circle_copy(CIRCLE *circle)
{
CIRCLE *result;
* Translation operator.
*/
CIRCLE *
-circle_add_pt(CIRCLE * circle, Point * point)
+circle_add_pt(CIRCLE *circle, Point *point)
{
CIRCLE *result;
} /* circle_add_pt() */
CIRCLE *
-circle_sub_pt(CIRCLE * circle, Point * point)
+circle_sub_pt(CIRCLE *circle, Point *point)
{
CIRCLE *result;
* Rotation and scaling operators.
*/
CIRCLE *
-circle_mul_pt(CIRCLE * circle, Point * point)
+circle_mul_pt(CIRCLE *circle, Point *point)
{
CIRCLE *result;
Point *p;
} /* circle_mul_pt() */
CIRCLE *
-circle_div_pt(CIRCLE * circle, Point * point)
+circle_div_pt(CIRCLE *circle, Point *point)
{
CIRCLE *result;
Point *p;
/* circle_area - returns the area of the circle.
*/
double *
-circle_area(CIRCLE * circle)
+circle_area(CIRCLE *circle)
{
double *result;
/* circle_diameter - returns the diameter of the circle.
*/
double *
-circle_diameter(CIRCLE * circle)
+circle_diameter(CIRCLE *circle)
{
double *result;
/* circle_radius - returns the radius of the circle.
*/
double *
-circle_radius(CIRCLE * circle)
+circle_radius(CIRCLE *circle)
{
double *result;
* two circles.
*/
double *
-circle_distance(CIRCLE * circle1, CIRCLE * circle2)
+circle_distance(CIRCLE *circle1, CIRCLE *circle2)
{
double *result;
bool
-circle_contain_pt(CIRCLE * circle, Point * point)
+circle_contain_pt(CIRCLE *circle, Point *point)
{
bool within;
double *d;
bool
-pt_contained_circle(Point * point, CIRCLE * circle)
+pt_contained_circle(Point *point, CIRCLE *circle)
{
return (circle_contain_pt(circle, point));
} /* circle_contain_pt() */
* a point and a circle.
*/
double *
-dist_pc(Point * point, CIRCLE * circle)
+dist_pc(Point *point, CIRCLE *circle)
{
double *result;
/* circle_center - returns the center point of the circle.
*/
Point *
-circle_center(CIRCLE * circle)
+circle_center(CIRCLE *circle)
{
Point *result;
/* circle_ar - returns the area of the circle.
*/
static double
-circle_ar(CIRCLE * circle)
+circle_ar(CIRCLE *circle)
{
return (PI * (circle->radius * circle->radius));
}
*/
#ifdef NOT_USED
double
-circle_dt(CIRCLE * circle1, CIRCLE * circle2)
+circle_dt(CIRCLE *circle1, CIRCLE *circle2)
{
double result;
*---------------------------------------------------------*/
CIRCLE *
-circle(Point * center, float8 * radius)
+circle(Point *center, float8 *radius)
{
CIRCLE *result;
BOX *
-circle_box(CIRCLE * circle)
+circle_box(CIRCLE *circle)
{
BOX *box;
double delta;
POLYGON *
-circle_poly(int npts, CIRCLE * circle)
+circle_poly(int npts, CIRCLE *circle)
{
POLYGON *poly;
int size;
if (FPzero(circle->radius) || (npts < 2))
elog(WARN, "Unable to convert circle to polygon", NULL);
- size = offsetof(POLYGON, p[0]) + (sizeof(poly->p[0]) * npts);
+ size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * npts);
poly = PALLOC(size);
memset((char *) poly, 0, size); /* zero any holes */
* rather than straight average values of points - tgl 97/01/21.
*/
CIRCLE *
-poly_circle(POLYGON * poly)
+poly_circle(POLYGON *poly)
{
CIRCLE *circle;
int i;
#define HIT_IT INT_MAX
static int
-point_inside(Point * p, int npts, Point plist[])
+point_inside(Point *p, int npts, Point plist[])
{
double x0,
y0;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.7 1997/09/08 20:57:32 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.8 1997/09/08 21:48:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
int16 *
int28in(char *shs)
{
- register int16(*result)[];
+ register int16 (*result)[];
int nums;
if (shs == NULL)
return (NULL);
- result = (int16(*)[]) palloc(sizeof(int16[8]));
+ result = (int16 (*)[]) palloc(sizeof(int16[8]));
if ((nums = sscanf(shs, "%hd%hd%hd%hd%hd%hd%hd%hd",
*result,
*result + 1,
* int28out - converts internal form to "num num ..."
*/
char *
-int28out(int16(*shs)[])
+int28out(int16 (*shs)[])
{
register int num;
register int16 *sp;
bool
-keyfirsteq(int16 * arg1, int16 arg2)
+keyfirsteq(int16 *arg1, int16 arg2)
{
return (*arg1 == arg2);
}
}
bool
-namelike(NameData * n, struct varlena * p)
+namelike(NameData *n, struct varlena * p)
{
if (!n)
return FALSE;
}
bool
-namenlike(NameData * s, struct varlena * p)
+namenlike(NameData *s, struct varlena * p)
{
return (!namelike(s, p));
}
}
-/* $Revision: 1.8 $
+/* $Revision: 1.9 $
** "like.c" A first attempt at a LIKE operator for Postgres95.
**
** Originally written by Rich $alz, mirror!rs, Wed Nov 26 19:03:17 EST 1986.
{
register int matched;
- for (; *p; text++, p++)
+ for (; *p; text ++, p++)
{
if (*text == '\0' && *p != '%')
return LIKE_ABORT;
p++;
/* FALLTHROUGH */
default:
- if (*text != *p)
+ if (*text !=*p)
return LIKE_FALSE;
continue;
case '_':
/* Trailing percent matches everything. */
return LIKE_TRUE;
while (*text)
- if ((matched = DoMatch(text++, p)) != LIKE_FALSE)
+ if ((matched = DoMatch(text ++, p)) != LIKE_FALSE)
return matched;
return LIKE_ABORT;
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/misc.c,v 1.9 1997/09/08 02:30:48 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/misc.c,v 1.10 1997/09/08 21:48:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* Check if data is Null
*/
bool
-nullvalue(Datum value, bool * isNull)
+nullvalue(Datum value, bool *isNull)
{
if (*isNull)
{
* check if data is not Null *
*--------------------------------------------------------------------- */
bool
-nonnullvalue(Datum value, bool * isNull)
+nonnullvalue(Datum value, bool *isNull)
{
if (*isNull)
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.33 1997/09/08 02:30:49 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.34 1997/09/08 21:48:32 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifdef USE_POSIX_TIME
if (tzp != NULL)
{
- tx = localtime((time_t *) & time);
+ tx = localtime((time_t *) &time);
}
else
{
- tx = gmtime((time_t *) & time);
+ tx = gmtime((time_t *) &time);
};
#else
#endif
* Convert datetime to abstime.
*/
AbsoluteTime
-datetime_abstime(DateTime * datetime)
+datetime_abstime(DateTime *datetime)
{
AbsoluteTime result;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/name.c,v 1.8 1997/09/08 02:30:50 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/name.c,v 1.9 1997/09/08 21:48:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* nameout - converts internal reprsentation to "..."
*/
char *
-nameout(NameData * s)
+nameout(NameData *s)
{
if (s == NULL)
return "-";
*
*/
bool
-nameeq(NameData * arg1, NameData * arg2)
+nameeq(NameData *arg1, NameData *arg2)
{
if (!arg1 || !arg2)
return 0;
}
bool
-namene(NameData * arg1, NameData * arg2)
+namene(NameData *arg1, NameData *arg2)
{
if (arg1 == NULL || arg2 == NULL)
return ((bool) 0);
}
bool
-namelt(NameData * arg1, NameData * arg2)
+namelt(NameData *arg1, NameData *arg2)
{
if (arg1 == NULL || arg2 == NULL)
return ((bool) 0);
}
bool
-namele(NameData * arg1, NameData * arg2)
+namele(NameData *arg1, NameData *arg2)
{
if (arg1 == NULL || arg2 == NULL)
return ((bool) 0);
}
bool
-namegt(NameData * arg1, NameData * arg2)
+namegt(NameData *arg1, NameData *arg2)
{
if (arg1 == NULL || arg2 == NULL)
return ((bool) 0);
}
bool
-namege(NameData * arg1, NameData * arg2)
+namege(NameData *arg1, NameData *arg2)
{
if (arg1 == NULL || arg2 == NULL)
return ((bool) 0);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.10 1997/09/08 02:30:54 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.11 1997/09/08 21:48:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
Oid *
oid8in(char *oidString)
{
- register Oid(*result)[];
+ register Oid (*result)[];
int nums;
if (oidString == NULL)
return (NULL);
- result = (Oid(*)[]) palloc(sizeof(Oid[8]));
+ result = (Oid (*)[]) palloc(sizeof(Oid[8]));
if ((nums = sscanf(oidString, "%d%d%d%d%d%d%d%d",
&(*result)[0],
&(*result)[1],
* oid8out - converts internal form to "num num ..."
*/
char *
-oid8out(Oid(*oidArray)[])
+oid8out(Oid (*oidArray)[])
{
register int num;
register Oid *sp;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidint2.c,v 1.3 1997/09/08 02:30:54 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidint2.c,v 1.4 1997/09/08 21:48:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
oidint2lt(OidInt2 o1, OidInt2 o2)
{
return
- ((bool) (o1->oi_oid < o2->oi_oid ||
- (o1->oi_oid == o2->oi_oid && o1->oi_int2 < o2->oi_int2)));
+ ((bool) (o1->oi_oid < o2->oi_oid ||
+ (o1->oi_oid == o2->oi_oid && o1->oi_int2 < o2->oi_int2)));
}
bool
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidint4.c,v 1.3 1997/09/08 02:30:55 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidint4.c,v 1.4 1997/09/08 21:48:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
oidint4lt(OidInt4 o1, OidInt4 o2)
{
return
- ((bool) (o1->oi_oid < o2->oi_oid ||
- (o1->oi_oid == o2->oi_oid && o1->oi_int4 < o2->oi_int4)));
+ ((bool) (o1->oi_oid < o2->oi_oid ||
+ (o1->oi_oid == o2->oi_oid && o1->oi_int4 < o2->oi_int4)));
}
bool
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidname.c,v 1.6 1997/09/08 02:30:56 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/oidname.c,v 1.7 1997/09/08 21:48:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
oidnamelt(OidName o1, OidName o2)
{
return (bool)
- (o1->id < o2->id ||
- (o1->id == o2->id && namecmp(&o1->name, &o2->name) < 0));
+ (o1->id < o2->id ||
+ (o1->id == o2->id && namecmp(&o1->name, &o2->name) < 0));
}
bool
oidnamele(OidName o1, OidName o2)
{
return (bool)
- (o1->id < o2->id ||
- (o1->id == o2->id && namecmp(&o1->name, &o2->name) <= 0));
+ (o1->id < o2->id ||
+ (o1->id == o2->id && namecmp(&o1->name, &o2->name) <= 0));
}
bool
oidnameeq(OidName o1, OidName o2)
{
return (bool)
- (o1->id == o2->id &&
- (namecmp(&o1->name, &o2->name) == 0));
+ (o1->id == o2->id &&
+ (namecmp(&o1->name, &o2->name) == 0));
}
bool
oidnamene(OidName o1, OidName o2)
{
return (bool)
- (o1->id != o2->id ||
- (namecmp(&o1->name, &o2->name) != 0));
+ (o1->id != o2->id ||
+ (namecmp(&o1->name, &o2->name) != 0));
}
bool
/*
* Edmund Mergl <E.Mergl@bawue.de>
*
- * $Id: oracle_compat.c,v 1.9 1997/09/08 02:30:57 momjian Exp $
+ * $Id: oracle_compat.c,v 1.10 1997/09/08 21:48:39 momjian Exp $
*
*/
#include "postgres.h"
-text *lower(text * string);
-text *upper(text * string);
-text *initcap(text * string);
-text *lpad(text * string1, int4 len, text * string2);
-text *rpad(text * string1, int4 len, text * string2);
-text *btrim(text * string, text * set);
-text *ltrim(text * string, text * set);
-text *rtrim(text * string, text * set);
-text *substr(text * string, int4 m, int4 n);
-text *translate(text * string, char from, char to);
+text *lower(text *string);
+text *upper(text *string);
+text *initcap(text *string);
+text *lpad(text *string1, int4 len, text *string2);
+text *rpad(text *string1, int4 len, text *string2);
+text *btrim(text *string, text *set);
+text *ltrim(text *string, text *set);
+text *rtrim(text *string, text *set);
+text *substr(text *string, int4 m, int4 n);
+text *translate(text *string, char from, char to);
/********************************************************************
********************************************************************/
text *
-lower(text * string)
+lower(text *string)
{
text *ret;
char *ptr,
********************************************************************/
text *
-upper(text * string)
+upper(text *string)
{
text *ret;
char *ptr,
********************************************************************/
text *
-initcap(text * string)
+initcap(text *string)
{
text *ret;
char *ptr,
********************************************************************/
text *
-lpad(text * string1, int4 len, text * string2)
+lpad(text *string1, int4 len, text *string2)
{
text *ret;
char *ptr1,
********************************************************************/
text *
-rpad(text * string1, int4 len, text * string2)
+rpad(text *string1, int4 len, text *string2)
{
text *ret;
char *ptr1,
********************************************************************/
text *
-btrim(text * string, text * set)
+btrim(text *string, text *set)
{
text *ret;
char *ptr,
********************************************************************/
text *
-ltrim(text * string, text * set)
+ltrim(text *string, text *set)
{
text *ret;
char *ptr,
********************************************************************/
text *
-rtrim(text * string, text * set)
+rtrim(text *string, text *set)
{
text *ret;
char *ptr,
********************************************************************/
text *
-substr(text * string, int4 m, int4 n)
+substr(text *string, int4 m, int4 n)
{
text *ret;
char *ptr,
********************************************************************/
text *
-translate(text * string, char from, char to)
+translate(text *string, char from, char to)
{
text *ret;
char *ptr,
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/regexp.c,v 1.9 1997/09/08 02:30:58 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/regexp.c,v 1.10 1997/09/08 21:48:40 momjian Exp $
*
* Alistair Crooks added the code for the regex caching
* agc - cached the regular expressions used - there's a good chance
}
bool
-nameregexeq(NameData * n, struct varlena * p)
+nameregexeq(NameData *n, struct varlena * p)
{
if (!n)
return FALSE;
}
bool
-nameregexne(NameData * s, struct varlena * p)
+nameregexne(NameData *s, struct varlena * p)
{
return (!nameregexeq(s, p));
}
}
bool
-nameicregexeq(NameData * n, struct varlena * p)
+nameicregexeq(NameData *n, struct varlena * p)
{
if (!n)
return FALSE;
}
bool
-nameicregexne(NameData * s, struct varlena * p)
+nameicregexne(NameData *s, struct varlena * p)
{
return (!nameicregexeq(s, p));
}
if (!PointerIsValid(result = PALLOCTYPE(DateTime)))
elog(WARN, "Memory allocation failed, can't convert timestamp to datetime", NULL);
- tm = localtime((time_t *) & timestamp);
+ tm = localtime((time_t *) ×tamp);
tm->tm_year += 1900;
tm->tm_mon += 1;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.20 1997/09/08 02:31:06 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.21 1997/09/08 21:48:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*/
#ifdef NOT_USED
int
-textlen(text * t)
+textlen(text *t)
{
int i = 0;
int max = VARSIZE(t) - VARHDRSZ;
*/
text *
-textcat(text * t1, text * t2)
+textcat(text *t1, text *t2)
{
int len1,
len2,
*/
int32
-textpos(text * t1, text * t2)
+textpos(text *t1, text *t2)
{
int pos;
int px,
bool
textne(struct varlena * arg1, struct varlena * arg2)
{
- return ((bool) ! texteq(arg1, arg2));
+ return ((bool) !texteq(arg1, arg2));
}
/* text_lt()
bool
text_gt(struct varlena * arg1, struct varlena * arg2)
{
- return ((bool) ! text_le(arg1, arg2));
+ return ((bool) !text_le(arg1, arg2));
}
bool
text_ge(struct varlena * arg1, struct varlena * arg2)
{
- return ((bool) ! text_lt(arg1, arg2));
+ return ((bool) !text_lt(arg1, arg2));
}
/*-------------------------------------------------------------
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.12 1997/09/08 02:31:09 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.13 1997/09/08 21:48:45 momjian Exp $
*
* Notes:
* XXX This needs to use exception.h to handle recovery when
#include "catalog/pg_type.h" /* for OID of int28 type */
#include "lib/dllist.h"
-static void CatCacheRemoveCTup(CatCache * cache, Dlelem * e);
+static void CatCacheRemoveCTup(CatCache *cache, Dlelem *e);
static Index CatalogCacheComputeHashIndex(struct catcache * cacheInP);
static Index
CatalogCacheComputeTupleHashIndex(struct catcache * cacheInOutP,
EQPROC(tupdesc->attrs[cache->cc_key[i] - 1]->atttypid);
fmgr_info(cache->cc_skey[i].sk_procedure,
- (func_ptr *) & cache->cc_skey[i].sk_func,
+ (func_ptr *) &cache->cc_skey[i].sk_func,
(int *) &cache->cc_skey[i].sk_nargs);
CACHE5_elog(DEBUG, "CatalogCacheInit %16s %d %d %x",
*/
#ifdef NOT_USED
void
-CatalogCacheSetId(CatCache * cacheInOutP, int id)
+CatalogCacheSetId(CatCache *cacheInOutP, int id)
{
Assert(id == InvalidCatalogCacheId || id >= 0);
cacheInOutP->id = id;
* --------------------------------
*/
static void
-CatCacheRemoveCTup(CatCache * cache, Dlelem * elt)
+CatCacheRemoveCTup(CatCache *cache, Dlelem *elt)
{
CatCTup *ct;
CatCTup *other_ct;
int id,
int nkeys,
int key[],
- HeapTuple(*iScanfuncP) ())
+ HeapTuple (*iScanfuncP) ())
{
CatCache *cp;
register int i;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.6 1997/09/08 02:31:11 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.7 1997/09/08 21:48:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include <string.h>
#endif
-static Oid GetDynamicFuncArgType(Var * arg, ExprContext * econtext);
+static Oid GetDynamicFuncArgType(Var *arg, ExprContext *econtext);
static FunctionCachePtr
init_fcache(Oid foid,
bool use_syscache,
- List * argList,
- ExprContext * econtext);
+ List *argList,
+ ExprContext *econtext);
/*-----------------------------------------------------------------
*
(IsA(arg,Var) && ((Var*)arg)->varattno == InvalidAttrNumber)
static Oid
-GetDynamicFuncArgType(Var * arg, ExprContext * econtext)
+GetDynamicFuncArgType(Var *arg, ExprContext *econtext)
{
char *relname;
int rtid;
static FunctionCachePtr
init_fcache(Oid foid,
bool use_syscache,
- List * argList,
- ExprContext * econtext)
+ List *argList,
+ ExprContext *econtext)
{
HeapTuple procedureTuple;
HeapTuple typeTuple;
}
void
-setFcache(Node * node, Oid foid, List * argList, ExprContext * econtext)
+setFcache(Node *node, Oid foid, List *argList, ExprContext *econtext)
{
Func *fnode;
Oper *onode;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.7 1997/09/08 20:57:39 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.8 1997/09/08 21:48:50 momjian Exp $
*
* Note - this code is real crufty...
*
Index cacheId;
Index hashIndex;
ItemPointerData pointerData;
-} CatalogInvalidationData;
+} CatalogInvalidationData;
typedef struct RelationInvalidationData
{
Oid relationId;
Oid objectId;
-} RelationInvalidationData;
+} RelationInvalidationData;
typedef union AnyInvalidation
{
{
char kind;
AnyInvalidation any;
-} InvalidationMessageData;
+} InvalidationMessageData;
typedef InvalidationMessageData *InvalidationMessage;
entryDataP = (InvalidationEntryData *)
malloc(sizeof(char *) + size); /* XXX alignment */
entryDataP->nextP = NULL;
- return ((Pointer) & entryDataP->userData);
+ return ((Pointer) &entryDataP->userData);
}
/* --------------------------------
while (PointerIsValid(invalid))
{
entryDataP = (InvalidationEntryData *)
- & ((InvalidationUserData *) invalid)->dataP[-1];
+ &((InvalidationUserData *) invalid)->dataP[-1];
if (PointerIsValid(function))
{
- (*function) ((Pointer) & entryDataP->userData);
+ (*function) ((Pointer) &entryDataP->userData);
}
invalid = (Pointer) entryDataP->nextP;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.5 1997/09/08 02:31:14 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.6 1997/09/08 21:48:51 momjian Exp $
*
* NOTES
* Eventually, the index information should go through here, too.
*
*/
bool
-op_mergesortable(Oid opno, Oid ltype, Oid rtype, Oid * leftOp, Oid * rightOp)
+op_mergesortable(Oid opno, Oid ltype, Oid rtype, Oid *leftOp, Oid *rightOp)
{
FormData_pg_operator optup;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/rel.c,v 1.2 1997/09/07 04:53:07 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/rel.c,v 1.3 1997/09/08 21:48:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
void
RelationSetIndexSupport(Relation relation,
IndexStrategy strategy,
- RegProcedure * support)
+ RegProcedure *support)
{
Assert(PointerIsValid(relation));
Assert(IndexStrategyIsValid(strategy));
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.22 1997/09/08 02:31:16 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.23 1997/09/08 21:48:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "fmgr.h"
static void
-RelationFlushRelation(Relation * relationPtr,
+RelationFlushRelation(Relation *relationPtr,
bool onlyFlushReferenceCountZero);
static Relation RelationNameCacheGetRelation(char *relationName);
static void init_irels(void);
Oid info_id; /* relation object id */
char *info_name; /* relation name */
} i;
-} RelationBuildDescInfo;
+} RelationBuildDescInfo;
typedef struct relidcacheent
{
Oid reloid;
Relation reldesc;
-} RelIdCacheEnt;
+} RelIdCacheEnt;
typedef struct relnamecacheent
{
NameData relname;
Relation reldesc;
-} RelNameCacheEnt;
+} RelNameCacheEnt;
/* -----------------
* macros to manipulate name cache and id cache
FormData_pg_attribute att[]);
#if 0 /* See comments at line 1304 */
-static void RelationFlushIndexes(Relation * r, Oid accessMethodId);
+static void RelationFlushIndexes(Relation *r, Oid accessMethodId);
#endif
* --------------------------------
*/
static void
-RelationFlushRelation(Relation * relationPtr,
+RelationFlushRelation(Relation *relationPtr,
bool onlyFlushReferenceCountZero)
{
MemoryContext oldcxt;
* --------------------------------
*/
static void
-RelationFlushIndexes(Relation * r,
+RelationFlushIndexes(Relation *r,
Oid accessMethodId)
{
Relation relation = *r;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.6 1997/09/08 02:31:21 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.7 1997/09/08 21:48:56 momjian Exp $
*
* NOTES
* These routines allow the parser/planner/executor to perform
#include "utils/syscache.h"
#include "catalog/indexing.h"
-typedef HeapTuple(*ScanFunc) ();
+typedef HeapTuple (*ScanFunc) ();
/* ----------------
* Warning: cacheinfo[] below is changed, then be sure and
0,
0,
0},
- offsetof(TypeTupleFormData, typalign) + sizeof(char),
+ offsetof(TypeTupleFormData, typalign) +sizeof(char),
TypeNameIndex,
TypeNameIndexScan},
{TypeRelationName, /* TYPOID */
* XXX The tuple that is returned is NOT supposed to be pfree'd!
*/
HeapTuple
-SearchSysCacheTuple(int cacheId, /* cache selection code */
+SearchSysCacheTuple(int cacheId,/* cache selection code */
Datum key1,
Datum key2,
Datum key3,
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/error/assert.c,v 1.6 1997/09/08 02:31:25 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/error/assert.c,v 1.7 1997/09/08 21:48:58 momjian Exp $
*
* NOTE
* This should eventually work with elog(), dlog(), etc.
int
ExceptionalCondition(char *conditionName,
- Exception * exceptionP,
+ Exception *exceptionP,
char *detail,
char *fileName,
int lineNumber)
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/exc.c,v 1.17 1997/09/08 02:31:29 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/exc.c,v 1.18 1997/09/08 21:49:00 momjian Exp $
*
* NOTE
* XXX this code needs improvement--check for state violations and
#include "storage/ipc.h"
static void
-ExcUnCaught(Exception * excP, ExcDetail detail, ExcData data,
+ExcUnCaught(Exception *excP, ExcDetail detail, ExcData data,
ExcMessage message);
static void
-ExcPrint(Exception * excP, ExcDetail detail, ExcData data,
+ExcPrint(Exception *excP, ExcDetail detail, ExcData data,
ExcMessage message);
/*
}
static void
-ExcPrint(Exception * excP,
+ExcPrint(Exception *excP,
ExcDetail detail,
ExcData data,
ExcMessage message)
#ifdef NOT_USED
ExcProc *
-ExcSetUnCaught(ExcProc * newP)
+ExcSetUnCaught(ExcProc *newP)
{
ExcProc *oldP = ExcUnCaughtP;
#endif
static void
-ExcUnCaught(Exception * excP,
+ExcUnCaught(Exception *excP,
ExcDetail detail,
ExcData data,
ExcMessage message)
}
void
-ExcRaise(Exception * excP,
+ExcRaise(Exception *excP,
ExcDetail detail,
ExcData data,
ExcMessage message)
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/excabort.c,v 1.3 1997/09/07 04:53:18 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/excabort.c,v 1.4 1997/09/08 21:49:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "utils/exc.h" /* where function declarations go */
void
-ExcAbort(const Exception * excP,
+ExcAbort(const Exception *excP,
ExcDetail detail,
ExcData data,
ExcMessage message)
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.5 1997/09/08 02:31:37 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.6 1997/09/08 21:49:07 momjian Exp $
*
*-------------------------------------------------------------------------
*/
fmgr_c(func_ptr user_fn,
Oid func_id,
int n_arguments,
- FmgrValues * values,
- bool * isNull)
+ FmgrValues *values,
+ bool *isNull)
{
char *returnValue = (char *) NULL;
}
void
-fmgr_info(Oid procedureId, func_ptr * function, int *nargs)
+fmgr_info(Oid procedureId, func_ptr *function, int *nargs)
{
func_ptr user_fn = NULL;
FmgrCall *fcp;
* to fmgr_c().
*/
char *
-fmgr_array_args(Oid procedureId, int nargs, char *args[], bool * isNull)
+fmgr_array_args(Oid procedureId, int nargs, char *args[], bool *isNull)
{
func_ptr user_fn;
int true_arguments;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.9 1997/09/08 02:31:41 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/hash/dynahash.c,v 1.10 1997/09/08 21:49:13 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*/
static long *DynaHashAlloc(unsigned int size);
static void DynaHashFree(Pointer ptr);
-static uint32 call_hash(HTAB * hashp, char *k, int len);
-static SEG_OFFSET seg_alloc(HTAB * hashp);
-static int bucket_alloc(HTAB * hashp);
-static int dir_realloc(HTAB * hashp);
+static uint32 call_hash(HTAB *hashp, char *k, int len);
+static SEG_OFFSET seg_alloc(HTAB *hashp);
+static int bucket_alloc(HTAB *hashp);
+static int dir_realloc(HTAB *hashp);
typedef long *((*dhalloc_ptr) ());
* ----------------
*/
-static int expand_table(HTAB * hashp);
-static int hdefault(HTAB * hashp);
-static int init_htab(HTAB * hashp, int nelem);
+static int expand_table(HTAB *hashp);
+static int hdefault(HTAB *hashp);
+static int init_htab(HTAB *hashp, int nelem);
/*
/************************** CREATE ROUTINES **********************/
HTAB *
-hash_create(int nelem, HASHCTL * info, int flags)
+hash_create(int nelem, HASHCTL *info, int flags)
{
register HHDR *hctl;
HTAB *hashp;
Allocate and initialize an HTAB structure
*/
static int
-hdefault(HTAB * hashp)
+hdefault(HTAB *hashp)
{
HHDR *hctl;
static int
-init_htab(HTAB * hashp, int nelem)
+init_htab(HTAB *hashp, int nelem)
{
register SEG_OFFSET *segp;
register int nbuckets;
/********************** DESTROY ROUTINES ************************/
void
-hash_destroy(HTAB * hashp)
+hash_destroy(HTAB *hashp)
{
/* cannot destroy a shared memory hash table */
Assert(!hashp->segbase);
}
void
-hash_stats(char *where, HTAB * hashp)
+hash_stats(char *where, HTAB *hashp)
{
#if HASH_STATISTICS
/*******************************SEARCH ROUTINES *****************************/
static uint32
-call_hash(HTAB * hashp, char *k, int len)
+call_hash(HTAB *hashp, char *k, int len)
{
long hash_val,
bucket;
* (FALSE if we entered one).
*/
long *
-hash_search(HTAB * hashp,
+hash_search(HTAB *hashp,
char *keyPtr,
HASHACTION action, /* HASH_FIND / HASH_ENTER / HASH_REMOVE
* HASH_FIND_SAVE / HASH_REMOVE_SAVED */
- bool * foundPtr)
+ bool *foundPtr)
{
uint32 bucket;
long segment_num;
*
*/
long *
-hash_seq(HTAB * hashp)
+hash_seq(HTAB *hashp)
{
static uint32 curBucket = 0;
static BUCKET_INDEX curIndex;
/********************************* UTILITIES ************************/
static int
-expand_table(HTAB * hashp)
+expand_table(HTAB *hashp)
{
HHDR *hctl;
SEGMENT old_seg,
static int
-dir_realloc(HTAB * hashp)
+dir_realloc(HTAB *hashp)
{
register char *p;
char **p_ptr;
static SEG_OFFSET
-seg_alloc(HTAB * hashp)
+seg_alloc(HTAB *hashp)
{
SEGMENT segp;
SEG_OFFSET segOffset;
* allocate some new buckets and link them into the free list
*/
static int
-bucket_alloc(HTAB * hashp)
+bucket_alloc(HTAB *hashp)
{
int i;
ELEMENT *tmpBucket;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.5 1997/09/08 02:32:10 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.6 1997/09/08 21:49:26 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* allocate something here, you are expected to clean it up when
* appropriate.
*/
-MemoryContext TopMemoryContext = (MemoryContext) & TopGlobalMemoryData;
+MemoryContext TopMemoryContext = (MemoryContext) &TopGlobalMemoryData;
* BadArg if name is invalid.
*/
GlobalMemory
-CreateGlobalMemory(char *name) /* XXX MemoryContextName */
+CreateGlobalMemory(char *name) /* XXX MemoryContextName */
{
GlobalMemory context;
MemoryContext savecxt;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Attic/oset.c,v 1.5 1997/09/08 02:32:14 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Attic/oset.c,v 1.6 1997/09/08 21:49:29 momjian Exp $
*
* NOTE
* XXX This is a preliminary implementation which lacks fail-fast
void
OrderedSetInit(OrderedSet set, Offset offset)
{
- set->head = (OrderedElem) & set->dummy;
+ set->head = (OrderedElem) &set->dummy;
set->dummy = NULL;
- set->tail = (OrderedElem) & set->head;
+ set->tail = (OrderedElem) &set->head;
set->offset = offset;
}
OrderedElemPushHead(OrderedElem elem)
{
elem->next = elem->set->head;
- elem->prev = (OrderedElem) & elem->set->head;
+ elem->prev = (OrderedElem) &elem->set->head;
elem->next->prev = elem;
elem->prev->next = elem;
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.7 1997/09/08 02:32:19 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.8 1997/09/08 21:49:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "utils/portal.h"
-static void CollectNamedPortals(Portal * portalP, int destroy);
+static void CollectNamedPortals(Portal *portalP, int destroy);
static Portal PortalHeapMemoryGetPortal(PortalHeapMemory context);
static PortalVariableMemory PortalHeapMemoryGetVariableMemory(PortalHeapMemory context);
static void PortalResetHeapMemory(Portal portal);
{
char portalname[MAX_PORTALNAME_LEN];
Portal portal;
-} PortalHashEnt;
+} PortalHashEnt;
#define PortalManagerEnabled (PortalManagerEnableCount >= 1)
{
AllocSetData setData;
FixedItemData itemData;
-} HeapMemoryBlockData;
+} HeapMemoryBlockData;
typedef HeapMemoryBlockData *HeapMemoryBlock;
/*
* initialize portal variable context
*/
- NodeSetTag((Node *) & portal->variable, T_PortalVariableMemory);
+ NodeSetTag((Node *) &portal->variable, T_PortalVariableMemory);
AllocSetInit(&portal->variable.setData, DynamicAllocMode, (Size) 0);
portal->variable.method = &PortalVariableContextMethodsData;
/*
* initialize portal heap context
*/
- NodeSetTag((Node *) & portal->heap, T_PortalHeapMemory);
+ NodeSetTag((Node *) &portal->heap, T_PortalHeapMemory);
portal->heap.block = NULL;
FixedStackInit(&portal->heap.stackData,
offsetof(HeapMemoryBlockData, itemData));
* and screws up the sequential walk of the table). -mer 17 Aug 1992
*/
static void
-CollectNamedPortals(Portal * portalP, int destroy)
+CollectNamedPortals(Portal *portalP, int destroy)
{
static Portal *portalList = (Portal *) NULL;
static int listIndex = 0;
*/
#ifdef NOT_USED
static void
-PortalDump(Portal * thisP)
+PortalDump(Portal *thisP)
{
/* XXX state/argument checking here */
*/
length = 1 + strlen(name);
portal->name = (char *)
- MemoryContextAlloc((MemoryContext) & portal->variable, length);
+ MemoryContextAlloc((MemoryContext) &portal->variable, length);
strncpy(portal->name, name, length);
*/
void
PortalSetQuery(Portal portal,
- QueryDesc * queryDesc,
+ QueryDesc *queryDesc,
TupleDesc attinfo,
- EState * state,
+ EState *state,
void (*cleanup) (Portal portal))
{
AssertState(PortalManagerEnabled);
MemoryContextAlloc((MemoryContext) PortalMemory, sizeof *portal);
/* initialize portal variable context */
- NodeSetTag((Node *) & portal->variable, T_PortalVariableMemory);
+ NodeSetTag((Node *) &portal->variable, T_PortalVariableMemory);
AllocSetInit(&portal->variable.setData, DynamicAllocMode, (Size) 0);
portal->variable.method = &PortalVariableContextMethodsData;
/* initialize portal heap context */
- NodeSetTag((Node *) & portal->heap, T_PortalHeapMemory);
+ NodeSetTag((Node *) &portal->heap, T_PortalHeapMemory);
portal->heap.block = NULL;
FixedStackInit(&portal->heap.stackData,
offsetof(HeapMemoryBlockData, itemData));
/* initialize portal name */
length = 1 + strlen(name);
portal->name = (char *)
- MemoryContextAlloc((MemoryContext) & portal->variable, length);
+ MemoryContextAlloc((MemoryContext) &portal->variable, length);
strncpy(portal->name, name, length);
/* initialize portal query */
* BadArg if portal is invalid.
*/
void
-PortalDestroy(Portal * portalP)
+PortalDestroy(Portal *portalP)
{
Portal portal = *portalP;
(*portal->cleanup) (portal);
PortalResetHeapMemory(portal);
- MemoryContextFree((MemoryContext) & portal->variable,
+ MemoryContextFree((MemoryContext) &portal->variable,
(Pointer) portal->name);
AllocSetReset(&portal->variable.setData); /* XXX log */
{
return ((PortalHeapMemory) ((char *) context
- offsetof(PortalD, variable)
- + offsetof(PortalD, heap)));
+ +offsetof(PortalD, heap)));
}
#endif
{
return ((PortalVariableMemory) ((char *) context
- offsetof(PortalD, heap)
- + offsetof(PortalD, variable)));
+ +offsetof(PortalD, variable)));
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.20 1997/09/08 02:32:29 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.21 1997/09/08 21:49:33 momjian Exp $
*
* NOTES
* Sorts the first relation into the second relation.
#include "miscadmin.h"
#include "storage/fd.h"
-static bool createrun(Sort * node, FILE * file, bool * empty);
-static void destroytape(FILE * file);
-static void dumptuples(FILE * file, Sort * node);
+static bool createrun(Sort *node, FILE *file, bool *empty);
+static void destroytape(FILE *file);
+static void dumptuples(FILE *file, Sort *node);
static FILE *gettape(void);
-static void initialrun(Sort * node, bool * empty);
-static void inittapes(Sort * node);
-static void merge(Sort * node, struct tape * dest);
-static FILE *mergeruns(Sort * node);
+static void initialrun(Sort *node, bool *empty);
+static void inittapes(Sort *node);
+static void merge(Sort *node, struct tape * dest);
+static FILE *mergeruns(Sort *node);
static HeapTuple tuplecopy(HeapTuple tup);
* Allocates and initializes sort node's psort state.
*/
bool
-psort_begin(Sort * node, int nkeys, ScanKey key)
+psort_begin(Sort *node, int nkeys, ScanKey key)
{
bool empty; /* to answer: is child node empty? */
* number of allocated tapes
*/
static void
-inittapes(Sort * node)
+inittapes(Sort *node)
{
register int i;
register struct tape *tp;
* Also, perhaps allocate tapes when needed. Split into 2 funcs.
*/
static void
-initialrun(Sort * node, bool * empty)
+initialrun(Sort *node, bool *empty)
{
/* register struct tuple *tup; */
register struct tape *tp;
* Tuples contains the tuples for the following run upon exit
*/
static bool
-createrun(Sort * node, FILE * file, bool * empty)
+createrun(Sort *node, FILE *file, bool *empty)
{
register HeapTuple lasttuple;
register HeapTuple tup;
/* if we did not see any tuples, mark empty */
*empty = (cr_tuples > 0) ? false : true;
- return ((bool) ! foundeor); /* XXX - works iff bool is {0,1} */
+ return ((bool) !foundeor); /* XXX - works iff bool is {0,1} */
}
/*
* file of tuples in order
*/
static FILE *
-mergeruns(Sort * node)
+mergeruns(Sort *node)
{
register struct tape *tp;
* (polyphase merge Alg.D(D5)--Knuth, Vol.3, p271)
*/
static void
-merge(Sort * node, struct tape * dest)
+merge(Sort *node, struct tape * dest)
{
register HeapTuple tup;
register struct tape *lasttp; /* (TAPE[P]) */
* dumptuples - stores all the tuples in tree into file
*/
static void
-dumptuples(FILE * file, Sort * node)
+dumptuples(FILE *file, Sort *node)
{
register struct leftist *tp;
register struct leftist *newp;
* a NULL indicating the last tuple has been processed.
*/
HeapTuple
-psort_grabtuple(Sort * node)
+psort_grabtuple(Sort *node)
{
register HeapTuple tup;
long tuplen;
* psort_markpos - saves current position in the merged sort file
*/
void
-psort_markpos(Sort * node)
+psort_markpos(Sort *node)
{
Assert(node != (Sort *) NULL);
Assert(PS(node) != (Psortstate *) NULL);
* last saved position
*/
void
-psort_restorepos(Sort * node)
+psort_restorepos(Sort *node)
{
Assert(node != (Sort *) NULL);
Assert(PS(node) != (Psortstate *) NULL);
* called unless psort_grabtuple has returned a NULL.
*/
void
-psort_end(Sort * node)
+psort_end(Sort *node)
{
register struct tape *tp;
*/
#ifdef NOT_USED
static void
-resettape(FILE * file)
+resettape(FILE *file)
{
register struct tapelst *tp;
register int fd;
* Exits instead of returning status, if given invalid tape.
*/
static void
-destroytape(FILE * file)
+destroytape(FILE *file)
{
register struct tapelst *tp,
*tq;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.6 1997/09/08 02:32:32 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.7 1997/09/08 21:49:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
AbsoluteTime start;
AbsoluteTime end;
TimeQualMode mode;
-} TimeQualData;
+} TimeQualData;
typedef TimeQualData *InternalTimeQual;
static TimeQualData SelfTimeQualData;
-TimeQual SelfTimeQual = (Pointer) & SelfTimeQualData;
+TimeQual SelfTimeQual = (Pointer) &SelfTimeQualData;
extern bool PostgresIsInitialized;
}
if (hasStartTime)
{
- return ((bool) ! AbsoluteTimeIsBefore(
+ return ((bool) !AbsoluteTimeIsBefore(
((InternalTimeQual) qual)->end,
((InternalTimeQual) qual)->start));
}
return (false);
}
- return ((bool) ! !(((InternalTimeQual) qual)->mode & TimeQualAt));
+ return ((bool) !!(((InternalTimeQual) qual)->mode & TimeQualAt));
}
/*
return (false);
}
- return ((bool) ! (((InternalTimeQual) qual)->mode & TimeQualAt));
+ return ((bool) !(((InternalTimeQual) qual)->mode & TimeQualAt));
}
/*
Assert(TransactionIdIsCurrentTransactionId((TransactionId) tuple->t_xmax));
- return ((bool) ! CommandIdGEScanCommandId(tuple->t_cmax));
+ return ((bool) !CommandIdGEScanCommandId(tuple->t_cmax));
}
if (!TransactionIdDidCommit((TransactionId) tuple->t_xmin))
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.15 1997/09/08 02:32:37 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.16 1997/09/08 21:49:50 momjian Exp $
*
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
*
#include "pg_dump.h"
static char **
-findParentsByOid(TableInfo * tbinfo, int numTables,
- InhInfo * inhinfo, int numInherits,
+findParentsByOid(TableInfo *tbinfo, int numTables,
+ InhInfo *inhinfo, int numInherits,
const char *oid,
int *numParents);
-static int findTableByOid(TableInfo * tbinfo, int numTables, const char *oid);
+static int findTableByOid(TableInfo *tbinfo, int numTables, const char *oid);
static void
-flagInhAttrs(TableInfo * tbinfo, int numTables,
- InhInfo * inhinfo, int numInherits);
+flagInhAttrs(TableInfo *tbinfo, int numTables,
+ InhInfo *inhinfo, int numInherits);
static int strInArray(const char *pattern, char **arr, int arr_size);
/*
*/
char *
-findTypeByOid(TypeInfo * tinfo, int numTypes, const char *oid)
+findTypeByOid(TypeInfo *tinfo, int numTypes, const char *oid)
{
int i;
*
*/
char *
-findOprByOid(OprInfo * oprinfo, int numOprs, const char *oid)
+findOprByOid(OprInfo *oprinfo, int numOprs, const char *oid)
{
int i;
*/
static char **
-findParentsByOid(TableInfo * tblinfo, int numTables,
- InhInfo * inhinfo, int numInherits, const char *oid,
+findParentsByOid(TableInfo *tblinfo, int numTables,
+ InhInfo *inhinfo, int numInherits, const char *oid,
int *numParentsPtr)
{
int i,
*/
TableInfo *
-dumpSchema(FILE * fout,
+dumpSchema(FILE *fout,
int *numTablesPtr,
const char *tablename,
const bool acls)
*/
extern void
-dumpSchemaIdx(FILE * fout, int *numTablesPtr, const char *tablename,
- TableInfo * tblinfo, int numTables)
+dumpSchemaIdx(FILE *fout, int *numTablesPtr, const char *tablename,
+ TableInfo *tblinfo, int numTables)
{
int numIndices;
IndInfo *indinfo;
*
*/
static void
-flagInhAttrs(TableInfo * tblinfo, int numTables,
- InhInfo * inhinfo, int numInherits)
+flagInhAttrs(TableInfo *tblinfo, int numTables,
+ InhInfo *inhinfo, int numInherits)
{
int i,
j,
*/
int
-findTableByName(TableInfo * tblinfo, int numTables, const char *relname)
+findTableByName(TableInfo *tblinfo, int numTables, const char *relname)
{
int i;
*/
static int
-findTableByOid(TableInfo * tblinfo, int numTables, const char *oid)
+findTableByOid(TableInfo *tblinfo, int numTables, const char *oid)
{
int i;
*/
int
-findFuncByName(FuncInfo * finfo, int numFuncs, const char *name)
+findFuncByName(FuncInfo *finfo, int numFuncs, const char *name)
{
int i;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.43 1997/09/08 20:57:50 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.44 1997/09/08 21:49:57 momjian Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
#include "pg_dump.h"
-static void dumpSequence(FILE * fout, TableInfo tbinfo);
+static void dumpSequence(FILE *fout, TableInfo tbinfo);
static char *checkForQuote(const char *s);
static void clearTableInfo(TableInfo *, int);
static void
-dumpOneFunc(FILE * fout, FuncInfo * finfo, int i,
- TypeInfo * tinfo, int numTypes);
+dumpOneFunc(FILE *fout, FuncInfo *finfo, int i,
+ TypeInfo *tinfo, int numTypes);
static int findLastBuiltinOid(void);
static bool isViewRule(char *relname);
-static void setMaxOid(FILE * fout);
+static void setMaxOid(FILE *fout);
extern char *optarg;
extern int optind,
}
static void
-exit_nicely(PGconn * conn)
+exit_nicely(PGconn *conn)
{
PQfinish(conn);
exit(1);
static void
-dumpClasses_nodumpData(FILE * fout, const char *classname, const bool oids)
+dumpClasses_nodumpData(FILE *fout, const char *classname, const bool oids)
{
PGresult *res;
static void
-dumpClasses_dumpData(FILE * fout, const char *classname,
+dumpClasses_dumpData(FILE *fout, const char *classname,
const TableInfo tblinfo, bool oids)
{
* dump the contents of all the classes.
*/
static void
-dumpClasses(const TableInfo tblinfo[], const int numTables, FILE * fout,
+dumpClasses(const TableInfo tblinfo[], const int numTables, FILE *fout,
const char *onlytable, const bool oids)
{
}
void
-clearTypeInfo(TypeInfo * tp, int numTypes)
+clearTypeInfo(TypeInfo *tp, int numTypes)
{
int i;
}
void
-clearFuncInfo(FuncInfo * fun, int numFuncs)
+clearFuncInfo(FuncInfo *fun, int numFuncs)
{
int i,
a;
}
static void
-clearTableInfo(TableInfo * tblinfo, int numTables)
+clearTableInfo(TableInfo *tblinfo, int numTables)
{
int i,
j;
}
void
-clearInhInfo(InhInfo * inh, int numInherits)
+clearInhInfo(InhInfo *inh, int numInherits)
{
int i;
}
void
-clearOprInfo(OprInfo * opr, int numOprs)
+clearOprInfo(OprInfo *opr, int numOprs)
{
int i;
}
void
-clearIndInfo(IndInfo * ind, int numIndices)
+clearIndInfo(IndInfo *ind, int numIndices)
{
int i,
a;
* modifies tblinfo
*/
void
-getTableAttrs(TableInfo * tblinfo, int numTables)
+getTableAttrs(TableInfo *tblinfo, int numTables)
{
int i,
j;
*
*/
void
-dumpTypes(FILE * fout, FuncInfo * finfo, int numFuncs,
- TypeInfo * tinfo, int numTypes)
+dumpTypes(FILE *fout, FuncInfo *finfo, int numFuncs,
+ TypeInfo *tinfo, int numTypes)
{
int i;
char q[MAXQUERYLEN];
*
*/
void
-dumpFuncs(FILE * fout, FuncInfo * finfo, int numFuncs,
- TypeInfo * tinfo, int numTypes)
+dumpFuncs(FILE *fout, FuncInfo *finfo, int numFuncs,
+ TypeInfo *tinfo, int numTypes)
{
int i;
*/
static void
-dumpOneFunc(FILE * fout, FuncInfo * finfo, int i,
- TypeInfo * tinfo, int numTypes)
+dumpOneFunc(FILE *fout, FuncInfo *finfo, int i,
+ TypeInfo *tinfo, int numTypes)
{
char q[MAXQUERYLEN];
int j;
*
*/
void
-dumpOprs(FILE * fout, OprInfo * oprinfo, int numOperators,
- TypeInfo * tinfo, int numTypes)
+dumpOprs(FILE *fout, OprInfo *oprinfo, int numOperators,
+ TypeInfo *tinfo, int numTypes)
{
int i;
char q[MAXQUERYLEN];
*
*/
void
-dumpAggs(FILE * fout, AggInfo *agginfo, int numAggs,
- TypeInfo * tinfo, int numTypes)
+dumpAggs(FILE *fout, AggInfo *agginfo, int numAggs,
+ TypeInfo *tinfo, int numTypes)
{
int i;
char q[MAXQUERYLEN];
*/
void
-dumpTables(FILE * fout, TableInfo * tblinfo, int numTables,
- InhInfo * inhinfo, int numInherits,
- TypeInfo * tinfo, int numTypes, const char *tablename,
+dumpTables(FILE *fout, TableInfo *tblinfo, int numTables,
+ InhInfo *inhinfo, int numInherits,
+ TypeInfo *tinfo, int numTypes, const char *tablename,
const bool acls)
{
int i,
* write out to fout all the user-define indices
*/
void
-dumpIndices(FILE * fout, IndInfo * indinfo, int numIndices,
- TableInfo * tblinfo, int numTables, const char *tablename)
+dumpIndices(FILE *fout, IndInfo *indinfo, int numIndices,
+ TableInfo *tblinfo, int numTables, const char *tablename)
{
int i,
k;
*/
#ifdef NOT_USED
void
-dumpTuples(PGresult * res, FILE * fout, int *attrmap)
+dumpTuples(PGresult *res, FILE *fout, int *attrmap)
{
int j,
k;
*/
static void
-setMaxOid(FILE * fout)
+setMaxOid(FILE *fout)
{
PGresult *res;
Oid max_oid;
static void
-dumpSequence(FILE * fout, TableInfo tbinfo)
+dumpSequence(FILE *fout, TableInfo tbinfo)
{
PGresult *res;
int4 last,
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_dump.h,v 1.22 1997/09/08 20:57:56 momjian Exp $
+ * $Id: pg_dump.h,v 1.23 1997/09/08 21:49:59 momjian Exp $
*
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
*
char *usename;
int passedbyvalue;
int isArray;
-} TypeInfo;
+} TypeInfo;
typedef struct _funcInfo
{
char *probin;
char *usename;
int dumped; /* 1 if already dumped */
-} FuncInfo;
+} FuncInfo;
typedef struct _tableInfo
{
int *attlen; /* attribute lengths */
char *usename;
-} TableInfo;
+} TableInfo;
typedef struct _inhInfo
{
char *inhrel;
char *inhparent;
-} InhInfo;
+} InhInfo;
typedef struct _indInfo
{
* attributes */
char *indclass[INDEX_MAX_KEYS]; /* opclass of the keys */
char *indisunique; /* is this index unique? */
-} IndInfo;
+} IndInfo;
typedef struct _aggInfo
{
* operators */
char *oprrsortop;
char *usename;
-} OprInfo;
+} OprInfo;
/* global decls */
*/
extern TableInfo *
-dumpSchema(FILE * fout,
+dumpSchema(FILE *fout,
int *numTablesPtr,
const char *tablename,
const bool acls);
extern void
-dumpSchemaIdx(FILE * fout,
+dumpSchemaIdx(FILE *fout,
int *numTablesPtr,
const char *tablename,
- TableInfo * tblinfo,
+ TableInfo *tblinfo,
int numTables);
-extern char *findTypeByOid(TypeInfo * tinfo, int numTypes, const char *oid);
-extern char *findOprByOid(OprInfo * oprinfo, int numOprs, const char *oid);
-extern int findFuncByName(FuncInfo * finfo, int numFuncs, const char *name);
-extern int findTableByName(TableInfo * tbinfo, int numTables, const char *relname);
+extern char *findTypeByOid(TypeInfo *tinfo, int numTypes, const char *oid);
+extern char *findOprByOid(OprInfo *oprinfo, int numOprs, const char *oid);
+extern int findFuncByName(FuncInfo *finfo, int numFuncs, const char *name);
+extern int findTableByName(TableInfo *tbinfo, int numTables, const char *relname);
extern void check_conn_and_db(void);
extern void parseArgTypes(char **argtypes, const char *str);
extern OprInfo *getOperators(int *numOperators);
extern TableInfo *getTables(int *numTables);
extern InhInfo *getInherits(int *numInherits);
-extern void getTableAttrs(TableInfo * tbinfo, int numTables);
+extern void getTableAttrs(TableInfo *tbinfo, int numTables);
extern IndInfo *getIndices(int *numIndices);
extern void
-dumpTypes(FILE * fout, FuncInfo * finfo, int numFuncs,
- TypeInfo * tinfo, int numTypes);
+dumpTypes(FILE *fout, FuncInfo *finfo, int numFuncs,
+ TypeInfo *tinfo, int numTypes);
extern void
-dumpFuncs(FILE * fout, FuncInfo * finfo, int numFuncs,
- TypeInfo * tinfo, int numTypes);
+dumpFuncs(FILE *fout, FuncInfo *finfo, int numFuncs,
+ TypeInfo *tinfo, int numTypes);
extern void
-dumpAggs(FILE * fout, AggInfo *agginfo, int numAggregates,
- TypeInfo * tinfo, int numTypes);
+dumpAggs(FILE *fout, AggInfo *agginfo, int numAggregates,
+ TypeInfo *tinfo, int numTypes);
extern void
-dumpOprs(FILE * fout, OprInfo * agginfo, int numOperators,
- TypeInfo * tinfo, int numTypes);
+dumpOprs(FILE *fout, OprInfo *agginfo, int numOperators,
+ TypeInfo *tinfo, int numTypes);
extern void
-dumpTables(FILE * fout, TableInfo * tbinfo, int numTables,
- InhInfo * inhinfo, int numInherits,
- TypeInfo * tinfo, int numTypes, const char *tablename,
+dumpTables(FILE *fout, TableInfo *tbinfo, int numTables,
+ InhInfo *inhinfo, int numInherits,
+ TypeInfo *tinfo, int numTypes, const char *tablename,
const bool acls);
extern void
-dumpIndices(FILE * fout, IndInfo * indinfo, int numIndices,
- TableInfo * tbinfo, int numTables, const char *tablename);
+dumpIndices(FILE *fout, IndInfo *indinfo, int numIndices,
+ TableInfo *tbinfo, int numTables, const char *tablename);
/* largest query string size */
#define MAXQUERYLEN 5000
#endif
char *comname;
-void usage(FILE * stream);
+void usage(FILE *stream);
void read_pwd_file(char *filename);
void write_pwd_file(char *filename, char *bkname);
void encrypt_pwd(char key[9], char salt[3], char passwd[14]);
void prompt_for_password(char *prompt, char *password);
void
-usage(FILE * stream)
+usage(FILE *stream)
{
fprintf(stream, "Usage: %s <password file>\n", comname);
}
char *uname;
char *pwd;
char *rest;
-} pg_pwd;
+} pg_pwd;
#define MAXPWDS 1024
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.92 1997/09/08 02:33:36 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.93 1997/09/08 21:50:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
bool useReadline; /* use libreadline routines */
bool getPassword; /* prompt the user for a username and
* password */
-} PsqlSettings;
+} PsqlSettings;
/* declarations for functions in this file */
static void usage(char *progname);
static void slashUsage();
-static void handleCopyOut(PGresult * res, bool quiet, FILE * copystream);
+static void handleCopyOut(PGresult *res, bool quiet, FILE *copystream);
static void
-handleCopyIn(PGresult * res, const bool mustprompt,
- FILE * copystream);
-static int tableList(PsqlSettings * ps, bool deep_tablelist, char info_type);
-static int tableDesc(PsqlSettings * ps, char *table);
-static int rightsList(PsqlSettings * ps);
+handleCopyIn(PGresult *res, const bool mustprompt,
+ FILE *copystream);
+static int tableList(PsqlSettings *ps, bool deep_tablelist, char info_type);
+static int tableDesc(PsqlSettings *ps, char *table);
+static int rightsList(PsqlSettings *ps);
static void prompt_for_password(char *username, char *password);
static char *
make_connect_string(char *host, char *port, char *dbname,
char *username, char *password);
-static char *gets_noreadline(char *prompt, FILE * source);
-static char *gets_readline(char *prompt, FILE * source);
-static char *gets_fromFile(char *prompt, FILE * source);
-static int listAllDbs(PsqlSettings * settings);
+static char *gets_noreadline(char *prompt, FILE *source);
+static char *gets_readline(char *prompt, FILE *source);
+static char *gets_fromFile(char *prompt, FILE *source);
+static int listAllDbs(PsqlSettings *settings);
static void
-SendQuery(bool * success_p, PsqlSettings * settings, const char *query,
- const bool copy_in, const bool copy_out, FILE * copystream);
+SendQuery(bool *success_p, PsqlSettings *settings, const char *query,
+ const bool copy_in, const bool copy_out, FILE *copystream);
static int
-HandleSlashCmds(PsqlSettings * settings,
+HandleSlashCmds(PsqlSettings *settings,
char *line,
char *query);
-static int MainLoop(PsqlSettings * settings, FILE * source);
+static int MainLoop(PsqlSettings *settings, FILE *source);
/* probably should move this into libpq */
void
-PQprint(FILE * fp,
- PGresult * res,
- PQprintOpt * po
+PQprint(FILE *fp,
+ PGresult *res,
+ PQprintOpt *po
);
-static FILE *setFout(PsqlSettings * ps, char *fname);
+static FILE *setFout(PsqlSettings *ps, char *fname);
/*
* usage print out usage for command line arguments
}
static void
-slashUsage(PsqlSettings * ps)
+slashUsage(PsqlSettings *ps)
{
int usePipe = 0;
char *pagerenv;
}
static PGresult *
-PSQLexec(PsqlSettings * ps, char *query)
+PSQLexec(PsqlSettings *ps, char *query)
{
PGresult *res;
*/
static int
-listAllDbs(PsqlSettings * ps)
+listAllDbs(PsqlSettings *ps)
{
PGresult *results;
char *query = "select * from pg_database;";
*
*/
int
-tableList(PsqlSettings * ps, bool deep_tablelist, char info_type)
+tableList(PsqlSettings *ps, bool deep_tablelist, char info_type)
{
char listbuf[256];
int nColumns;
*
*/
int
-rightsList(PsqlSettings * ps)
+rightsList(PsqlSettings *ps)
{
char listbuf[256];
int nColumns;
*
*/
int
-tableDesc(PsqlSettings * ps, char *table)
+tableDesc(PsqlSettings *ps, char *table)
{
char descbuf[256];
int nColumns;
}
}
-typedef char *(*READ_ROUTINE) (char *prompt, FILE * source);
+typedef char *(*READ_ROUTINE) (char *prompt, FILE *source);
/*
* gets_noreadline prompt source gets a line of input without calling
* readline, the source is ignored
*/
static char *
-gets_noreadline(char *prompt, FILE * source)
+gets_noreadline(char *prompt, FILE *source)
{
fputs(prompt, stdout);
fflush(stdout);
* the source is ignored the prompt argument is used as the prompting string
*/
static char *
-gets_readline(char *prompt, FILE * source)
+gets_readline(char *prompt, FILE *source)
{
char *s;
* argument is a FILE *
*/
static char *
-gets_fromFile(char *prompt, FILE * source)
+gets_fromFile(char *prompt, FILE *source)
{
char *line;
int len;
* the query executed successfully returns *success_p = 0 otherwise
*/
static void
-SendQuery(bool * success_p, PsqlSettings * settings, const char *query,
- const bool copy_in, const bool copy_out, FILE * copystream)
+SendQuery(bool *success_p, PsqlSettings *settings, const char *query,
+ const bool copy_in, const bool copy_out, FILE *copystream)
{
PGresult *results;
}
static bool
-toggle(PsqlSettings * settings, bool * sw, char *msg)
+toggle(PsqlSettings *settings, bool *sw, char *msg)
{
*sw = !*sw;
if (!settings->quiet)
static void
parse_slash_copy(const char *args, char *table, const int table_len,
char *file, const int file_len,
- bool * from_p, bool * error_p)
+ bool *from_p, bool *error_p)
{
char work_args[200];
static void
-do_copy(const char *args, PsqlSettings * settings)
+do_copy(const char *args, PsqlSettings *settings)
{
/*---------------------------------------------------------------------------
Execute a \copy command (frontend copy). We have to open a file, then
static void
do_connect(const char *new_dbname,
const char *new_user,
- PsqlSettings * settings)
+ PsqlSettings *settings)
{
if (!new_dbname)
fprintf(stderr, "\\connect must be followed by a database name\n");
static void
-do_help(PsqlSettings * ps, const char *topic)
+do_help(PsqlSettings *ps, const char *topic)
{
if (!topic)
* 3 - new query supplied by edit
*/
static int
-HandleSlashCmds(PsqlSettings * settings,
+HandleSlashCmds(PsqlSettings *settings,
char *line,
char *query)
{
*/
static int
-MainLoop(PsqlSettings * settings, FILE * source)
+MainLoop(PsqlSettings *settings, FILE *source)
{
char *line; /* line of input */
char *xcomment; /* start of extended comment */
#define COPYBUFSIZ 8192
static void
-handleCopyOut(PGresult * res, bool quiet, FILE * copystream)
+handleCopyOut(PGresult *res, bool quiet, FILE *copystream)
{
bool copydone;
char copybuf[COPYBUFSIZ];
static void
-handleCopyIn(PGresult * res, const bool mustprompt, FILE * copystream)
+handleCopyIn(PGresult *res, const bool mustprompt, FILE *copystream)
{
bool copydone = false;
bool firstload;
*/
static FILE *
-setFout(PsqlSettings * ps, char *fname)
+setFout(PsqlSettings *ps, char *fname)
{
if (ps->queryFout && ps->queryFout != stdout)
{
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: funcindex.h,v 1.4 1997/09/08 02:34:03 momjian Exp $
+ * $Id: funcindex.h,v 1.5 1997/09/08 21:50:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
Oid arglist[8];
Oid procOid;
NameData funcName;
-} FuncIndexInfo;
+} FuncIndexInfo;
typedef FuncIndexInfo *FuncIndexInfoPtr;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: genam.h,v 1.9 1997/09/08 02:34:04 momjian Exp $
+ * $Id: genam.h,v 1.10 1997/09/08 21:50:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern Relation index_open(Oid relationId);
extern Relation index_openr(char *relationName);
extern void index_close(Relation relation);
-extern InsertIndexResult
+extern InsertIndexResult
index_insert(Relation relation,
- Datum * datum, char *nulls,
+ Datum *datum, char *nulls,
ItemPointer heap_t_ctid,
Relation heapRel);
extern void index_delete(Relation relation, ItemPointer indexItem);
-extern IndexScanDesc
+extern IndexScanDesc
index_beginscan(Relation relation, bool scanFromEnd,
uint16 numberOfKeys, ScanKey key);
extern void index_rescan(IndexScanDesc scan, bool scanFromEnd, ScanKey key);
extern void index_endscan(IndexScanDesc scan);
-extern RetrieveIndexResult
+extern RetrieveIndexResult
index_getnext(IndexScanDesc scan,
ScanDirection direction);
-extern RegProcedure
+extern RegProcedure
index_getprocid(Relation irel, AttrNumber attnum,
uint16 procnum);
-extern Datum
+extern Datum
GetIndexValue(HeapTuple tuple, TupleDesc hTupDesc,
- int attOff, AttrNumber attrNums[], FuncIndexInfo * fInfo,
- bool * attNull, Buffer buffer);
+ int attOff, AttrNumber attrNums[], FuncIndexInfo *fInfo,
+ bool *attNull, Buffer buffer);
/* in genam.c */
-extern IndexScanDesc
+extern IndexScanDesc
RelationGetIndexScan(Relation relation, bool scanFromEnd,
uint16 numberOfKeys, ScanKey key);
extern void IndexScanMarkPosition(IndexScanDesc scan);
typedef struct GISTPageOpaqueData
{
uint32 flags;
-} GISTPageOpaqueData;
+} GISTPageOpaqueData;
typedef GISTPageOpaqueData *GISTPageOpaque;
struct GISTSTACK *gs_parent;
OffsetNumber gs_child;
BlockNumber gs_blk;
-} GISTSTACK;
+} GISTSTACK;
typedef struct GISTSTATE
{
func_ptr equalFn;
bool haskeytype;
bool keytypbyval;
-} GISTSTATE;
+} GISTSTATE;
/*
struct GISTSTACK *s_markstk;
uint16 s_flags;
struct GISTSTATE *giststate;
-} GISTScanOpaqueData;
+} GISTScanOpaqueData;
typedef GISTScanOpaqueData *GISTScanOpaque;
OffsetNumber *spl_right; /* array of entries that go right */
int spl_nright; /* size of the array */
char *spl_rdatum; /* Union of keys in spl_right */
-} GIST_SPLITVEC;
+} GIST_SPLITVEC;
/*
** An entry on a GiST node. Contains the key (pred), as well as
OffsetNumber offset;
int bytes;
bool leafkey;
-} GISTENTRY;
+} GISTENTRY;
/*
** macro to initialize a GISTENTRY
int32 vl_len;
int32 flag;
char bytes[2];
-} TXTRANGE;
+} TXTRANGE;
typedef struct intrange
{
* upper is positive infinity. 0 means that both are numbers.
*/
int flag;
-} INTRANGE;
+} INTRANGE;
extern void
gistbuild(Relation heap,
Relation index, int natts,
AttrNumber *attnum, IndexStrategy istrat,
- uint16 pint, Datum * params,
- FuncIndexInfo * finfo,
- PredInfo * predInfo);
-extern InsertIndexResult
-gistinsert(Relation r, Datum * datum,
+ uint16 pint, Datum *params,
+ FuncIndexInfo *finfo,
+ PredInfo *predInfo);
+extern InsertIndexResult
+gistinsert(Relation r, Datum *datum,
char *nulls, ItemPointer ht_ctid, Relation heapRel);
extern void _gistdump(Relation r);
-extern void gistfreestack(GISTSTACK * s);
-extern void initGISTstate(GISTSTATE * giststate, Relation index);
+extern void gistfreestack(GISTSTACK *s);
+extern void initGISTstate(GISTSTATE *giststate, Relation index);
extern void
-gistdentryinit(GISTSTATE * giststate, GISTENTRY * e, char *pr,
+gistdentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr,
Relation r, Page pg, OffsetNumber o, int b, bool l);
extern StrategyNumber RelationGetGISTStrategy(Relation, AttrNumber, RegProcedure);
#include <storage/block.h>
#include <utils/rel.h>
-extern IndexScanDesc
+extern IndexScanDesc
gistbeginscan(Relation r, bool fromEnd,
uint16 nkeys, ScanKey key);
extern void gistrescan(IndexScanDesc s, bool fromEnd, ScanKey key);
#include <access/strat.h>
#include <utils/rel.h>
-extern StrategyNumber
+extern StrategyNumber
RelationGetGISTStrategy(Relation r,
AttrNumber attnum, RegProcedure proc);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: hash.h,v 1.10 1997/09/08 20:58:02 momjian Exp $
+ * $Id: hash.h,v 1.11 1997/09/08 21:50:44 momjian Exp $
*
* NOTES
* modeled after Margo Seltzer's hash implementation for unix.
OverflowPageAddress hasho_oaddr; /* ovfl address of this ovfl pg */
BlockNumber hasho_nextblkno;/* next ovfl blkno */
BlockNumber hasho_prevblkno;/* previous ovfl (or bucket) blkno */
-} HashPageOpaqueData;
+} HashPageOpaqueData;
typedef HashPageOpaqueData *HashPageOpaque;
{
Buffer hashso_curbuf;
Buffer hashso_mrkbuf;
-} HashScanOpaqueData;
+} HashScanOpaqueData;
typedef HashScanOpaqueData *HashScanOpaque;
* splitpoints */
BlockNumber hashm_mapp[NCACHED]; /* blknumbers of ovfl page maps */
RegProcedure hashm_procid; /* hash procedure id from pg_proc */
-} HashMetaPageData;
+} HashMetaPageData;
typedef HashMetaPageData *HashMetaPage;
typedef struct HashItemData
{
IndexTupleData hash_itup;
-} HashItemData;
+} HashItemData;
typedef HashItemData *HashItem;
extern void
hashbuild(Relation heap, Relation index, int natts,
AttrNumber *attnum, IndexStrategy istrat, uint16 pcount,
- Datum * params, FuncIndexInfo * finfo, PredInfo * predInfo);
-extern InsertIndexResult
-hashinsert(Relation rel, Datum * datum, char *nulls,
+ Datum *params, FuncIndexInfo *finfo, PredInfo *predInfo);
+extern InsertIndexResult
+hashinsert(Relation rel, Datum *datum, char *nulls,
ItemPointer ht_ctid, Relation heapRel);
extern char *hashgettuple(IndexScanDesc scan, ScanDirection dir);
extern char *
extern uint32 hashchar8(char *key);
extern uint32 hashchar16(char *key);
extern uint32 hashtext(struct varlena * key);
-extern uint32 hashname(NameData * n);
+extern uint32 hashname(NameData *n);
/* private routines */
/* hashovfl.c */
extern Buffer _hash_addovflpage(Relation rel, Buffer *metabufp, Buffer buf);
extern Buffer _hash_freeovflpage(Relation rel, Buffer ovflbuf);
-extern int32
+extern int32
_hash_initbitmap(Relation rel, HashMetaPage metap, int32 pnum,
int32 nbits, int32 ndx);
extern void
extern void _hash_relbuf(Relation rel, Buffer buf, int access);
extern void _hash_wrtbuf(Relation rel, Buffer buf);
extern void _hash_wrtnorelbuf(Relation rel, Buffer buf);
-extern Page
+extern Page
_hash_chgbufaccess(Relation rel, Buffer *bufp, int from_access,
int to_access);
extern void _hash_pageinit(Page page, Size size);
Buffer *bufP, HashMetaPage metap);
extern RetrieveIndexResult _hash_next(IndexScanDesc scan, ScanDirection dir);
extern RetrieveIndexResult _hash_first(IndexScanDesc scan, ScanDirection dir);
-extern bool
+extern bool
_hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir,
Buffer metabuf);
/* hashutil.c */
-extern ScanKey
+extern ScanKey
_hash_mkscankey(Relation rel, IndexTuple itup,
HashMetaPage metap);
extern void _hash_freeskey(ScanKey skey);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: heapam.h,v 1.14 1997/09/08 20:58:03 momjian Exp $
+ * $Id: heapam.h,v 1.15 1997/09/08 21:50:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
int local_heapgettup;
int local_RelationPutHeapTuple;
int local_RelationPutLongHeapTuple;
-} HeapAccessStatisticsData;
+} HeapAccessStatisticsData;
typedef HeapAccessStatisticsData *HeapAccessStatistics;
extern Relation heap_open(Oid relationId);
extern Relation heap_openr(char *relationName);
extern void heap_close(Relation relation);
-extern HeapScanDesc
+extern HeapScanDesc
heap_beginscan(Relation relation, int atend,
TimeQual timeQual, unsigned nkeys, ScanKey key);
extern void heap_rescan(HeapScanDesc sdesc, bool scanFromEnd, ScanKey key);
extern void heap_endscan(HeapScanDesc sdesc);
extern HeapTuple heap_getnext(HeapScanDesc scandesc, int backw, Buffer *b);
-extern HeapTuple
+extern HeapTuple
heap_fetch(Relation relation, TimeQual timeQual,
ItemPointer tid, Buffer *b);
extern Oid heap_insert(Relation relation, HeapTuple tup);
extern void
DataFill(char *data, TupleDesc tupleDesc,
Datum value[], char nulls[], char *infomask,
- bits8 * bit);
+ bits8 *bit);
extern int heap_attisnull(HeapTuple tup, int attnum);
extern int heap_sysattrlen(AttrNumber attno);
extern bool heap_sysattrbyval(AttrNumber attno);
extern char *heap_getsysattr(HeapTuple tup, Buffer b, int attnum);
extern char *
fastgetattr(HeapTuple tup, int attnum,
- TupleDesc att, bool * isnull);
+ TupleDesc att, bool *isnull);
extern HeapTuple heap_copytuple(HeapTuple tuple);
-extern HeapTuple
+extern HeapTuple
heap_formtuple(TupleDesc tupleDescriptor,
Datum value[], char nulls[]);
-extern HeapTuple
+extern HeapTuple
heap_modifytuple(HeapTuple tuple, Buffer buffer,
Relation relation, Datum replValue[], char replNull[], char repl[]);
HeapTuple heap_addheader(uint32 natts, int structlen, char *structure);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: htup.h,v 1.5 1997/09/08 02:34:12 momjian Exp $
+ * $Id: htup.h,v 1.6 1997/09/08 21:50:46 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* bit map of domains */
/* MORE DATA FOLLOWS AT END OF STRUCT */
-} HeapTupleData;
+} HeapTupleData;
typedef HeapTupleData *HeapTuple;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: ibit.h,v 1.6 1997/09/08 02:34:13 momjian Exp $
+ * $Id: ibit.h,v 1.7 1997/09/08 21:50:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
char bits[(MaxIndexAttributeNumber + MaxBitsPerByte - 1)
/ MaxBitsPerByte];
-} IndexAttributeBitMapData;
+} IndexAttributeBitMapData;
typedef IndexAttributeBitMapData *IndexAttributeBitMap;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: iqual.h,v 1.6 1997/09/08 02:34:14 momjian Exp $
+ * $Id: iqual.h,v 1.7 1997/09/08 21:50:48 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern int NIndexTupleProcessed;
-extern bool
+extern bool
index_keytest(IndexTuple tuple, TupleDesc tupdesc,
int scanKeySize, ScanKey key);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: istrat.h,v 1.7 1997/09/08 02:34:15 momjian Exp $
+ * $Id: istrat.h,v 1.8 1997/09/08 21:50:50 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*/
#define IndexStrategyIsValid(s) PointerIsValid(s)
-extern StrategyMap
+extern StrategyMap
IndexStrategyGetStrategyMap(IndexStrategy indexStrategy,
StrategyNumber maxStrategyNum, AttrNumber attrNum);
-extern Size
+extern Size
AttributeNumberGetIndexStrategySize(AttrNumber maxAttributeNumber,
StrategyNumber maxStrategyNumber);
-extern StrategyNumber
+extern StrategyNumber
RelationGetStrategy(Relation relation,
AttrNumber attributeNumber, StrategyEvaluation evaluation,
RegProcedure procedure);
-extern bool
+extern bool
RelationInvokeStrategy(Relation relation,
StrategyEvaluation evaluation, AttrNumber attributeNumber,
StrategyNumber strategy, Datum left, Datum right);
extern void
IndexSupportInitialize(IndexStrategy indexStrategy,
- RegProcedure * indexSupport, Oid indexObjectId,
+ RegProcedure *indexSupport, Oid indexObjectId,
Oid accessMethodObjectId, StrategyNumber maxStrategyNumber,
StrategyNumber maxSupportNumber, AttrNumber maxAttributeNumber);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: itup.h,v 1.7 1997/09/08 02:34:16 momjian Exp $
+ * $Id: itup.h,v 1.8 1997/09/08 21:50:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* IndexInfoFindDataOffset() for the reason.
*/
-} IndexTupleData; /* MORE DATA FOLLOWS AT END OF STRUCT */
+} IndexTupleData; /* MORE DATA FOLLOWS AT END OF STRUCT */
typedef IndexTupleData *IndexTuple;
typedef struct InsertIndexResultData
{
ItemPointerData pointerData;
-} InsertIndexResultData;
+} InsertIndexResultData;
typedef InsertIndexResultData *InsertIndexResult;
{
ItemPointerData index_iptr;
ItemPointerData heap_iptr;
-} RetrieveIndexResultData;
+} RetrieveIndexResultData;
typedef RetrieveIndexResultData *RetrieveIndexResult;
{
Node *pred;
Node *oldPred;
-} PredInfo;
+} PredInfo;
/* ----------------
/* indextuple.h */
-extern IndexTuple
+extern IndexTuple
index_formtuple(TupleDesc tupleDescriptor,
Datum value[], char null[]);
-extern Datum
+extern Datum
index_getattr(IndexTuple tuple, AttrNumber attNum,
- TupleDesc tupDesc, bool * isNullOutP);
-extern RetrieveIndexResult
+ TupleDesc tupDesc, bool *isNullOutP);
+extern RetrieveIndexResult
FormRetrieveIndexResult(ItemPointer indexItemPointer,
ItemPointer heapItemPointer);
-extern void CopyIndexTuple(IndexTuple source, IndexTuple * target);
+extern void CopyIndexTuple(IndexTuple source, IndexTuple *target);
#endif /* ITUP_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nbtree.h,v 1.17 1997/09/08 20:58:09 momjian Exp $
+ * $Id: nbtree.h,v 1.18 1997/09/08 21:50:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/*
* prototypes for functions in nbtinsert.c
*/
-extern InsertIndexResult
+extern InsertIndexResult
_bt_doinsert(Relation rel, BTItem btitem,
bool index_is_unique, Relation heapRel);
/* default is to allow duplicates */
-extern bool
+extern bool
_bt_itemcmp(Relation rel, Size keysz, BTItem item1, BTItem item2,
StrategyNumber strat);
extern void
btbuild(Relation heap, Relation index, int natts,
AttrNumber *attnum, IndexStrategy istrat, uint16 pcount,
- Datum * params, FuncIndexInfo * finfo, PredInfo * predInfo);
-extern InsertIndexResult
-btinsert(Relation rel, Datum * datum, char *nulls,
+ Datum *params, FuncIndexInfo *finfo, PredInfo *predInfo);
+extern InsertIndexResult
+btinsert(Relation rel, Datum *datum, char *nulls,
ItemPointer ht_ctid, Relation heapRel);
extern char *btgettuple(IndexScanDesc scan, ScanDirection dir);
extern char *
extern Buffer
_bt_moveright(Relation rel, Buffer buf, int keysz,
ScanKey scankey, int access);
-extern bool
+extern bool
_bt_skeycmp(Relation rel, Size keysz, ScanKey scankey,
Page page, ItemId itemid, StrategyNumber strat);
-extern OffsetNumber
+extern OffsetNumber
_bt_binsrch(Relation rel, Buffer buf, int keysz,
ScanKey scankey, int srchtype);
extern RetrieveIndexResult _bt_next(IndexScanDesc scan, ScanDirection dir);
/*
* prototypes for functions in nbtstrat.c
*/
-extern StrategyNumber
+extern StrategyNumber
_bt_getstrat(Relation rel, AttrNumber attno,
RegProcedure proc);
-extern bool
+extern bool
_bt_invokestrat(Relation rel, AttrNumber attno,
StrategyNumber strat, Datum left, Datum right);
extern void _bt_freeskey(ScanKey skey);
extern void _bt_freestack(BTStack stack);
extern void _bt_orderkeys(Relation relation, BTScanOpaque so);
-extern bool _bt_checkkeys(IndexScanDesc scan, IndexTuple tuple, Size * keysok);
+extern bool _bt_checkkeys(IndexScanDesc scan, IndexTuple tuple, Size *keysok);
extern BTItem _bt_formitem(IndexTuple itup);
/*
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: relscan.h,v 1.7 1997/09/08 02:34:22 momjian Exp $
+ * $Id: relscan.h,v 1.8 1997/09/08 21:50:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
uint16 rs_cdelta; /* current delta in chain */
uint16 rs_nkeys; /* number of attributes in keys */
ScanKey rs_key; /* key descriptors */
-} HeapScanDescData;
+} HeapScanDescData;
typedef HeapScanDescData *HeapScanDesc;
bool scanFromEnd; /* restart scan at end? */
uint16 numberOfKeys; /* number of key attributes */
ScanKey keyData; /* key descriptor */
-} IndexScanDescData;
+} IndexScanDescData;
typedef IndexScanDescData *IndexScanDesc;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: rtree.h,v 1.9 1997/09/08 20:58:11 momjian Exp $
+ * $Id: rtree.h,v 1.10 1997/09/08 21:50:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
typedef struct RTreePageOpaqueData
{
uint32 flags;
-} RTreePageOpaqueData;
+} RTreePageOpaqueData;
typedef RTreePageOpaqueData *RTreePageOpaque;
struct RTSTACK *rts_parent;
OffsetNumber rts_child;
BlockNumber rts_blk;
-} RTSTACK;
+} RTSTACK;
/*
* When we're doing a scan, we need to keep track of the parent stack
uint16 s_flags;
uint16 s_internalNKey;
ScanKey s_internalKey;
-} RTreeScanOpaqueData;
+} RTreeScanOpaqueData;
typedef RTreeScanOpaqueData *RTreeScanOpaque;
#define RTOP_SPLIT 1
/* defined in rtree.c */
-extern void freestack(RTSTACK * s);
+extern void freestack(RTSTACK *s);
/* rget.c */
extern RetrieveIndexResult rtgettuple(IndexScanDesc s, ScanDirection dir);
* RTree code.
* Defined in access/index-rtree/
*/
-extern InsertIndexResult
-rtinsert(Relation r, Datum * datum, char *nulls,
+extern InsertIndexResult
+rtinsert(Relation r, Datum *datum, char *nulls,
ItemPointer ht_ctid, Relation heapRel);
extern char *rtdelete(Relation r, ItemPointer tid);
extern RetrieveIndexResult rtgettuple(IndexScanDesc s, ScanDirection dir);
-extern IndexScanDesc
+extern IndexScanDesc
rtbeginscan(Relation r, bool fromEnd, uint16 nkeys,
ScanKey key);
extern void
rtbuild(Relation heap, Relation index, int natts,
AttrNumber *attnum, IndexStrategy istrat, uint16 pcount,
- Datum * params, FuncIndexInfo * finfo, PredInfo * predInfo);
+ Datum *params, FuncIndexInfo *finfo, PredInfo *predInfo);
extern void _rtdump(Relation r);
/* rtscan.c */
OffsetNumber offnum);
/* rtstrat.h */
-extern RegProcedure
+extern RegProcedure
RTMapOperator(Relation r, AttrNumber attnum,
RegProcedure proc);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: rtstrat.h,v 1.3 1997/09/08 02:34:25 momjian Exp $
+ * $Id: rtstrat.h,v 1.4 1997/09/08 21:50:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef RTSTRAT_H
-extern RegProcedure
+extern RegProcedure
RTMapOperator(Relation r, AttrNumber attnum,
RegProcedure proc);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: skey.h,v 1.5 1997/09/08 02:34:26 momjian Exp $
+ * $Id: skey.h,v 1.6 1997/09/08 21:51:01 momjian Exp $
*
*
* Note:
func_ptr sk_func;
int32 sk_nargs;
Datum sk_argument; /* data to compare */
-} ScanKeyData;
+} ScanKeyData;
typedef ScanKeyData *ScanKey;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: strat.h,v 1.7 1997/09/08 20:58:12 momjian Exp $
+ * $Id: strat.h,v 1.8 1997/09/08 21:51:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
typedef struct StrategyTransformMapData
{
StrategyNumber strategy[1]; /* VARIABLE LENGTH ARRAY */
-} StrategyTransformMapData; /* VARIABLE LENGTH
+} StrategyTransformMapData; /* VARIABLE LENGTH
- *
- *
- * STRUCTURE */
+ *
+ *
+ *
+ * STRUCTURE */
typedef StrategyTransformMapData *StrategyTransformMap;
{
StrategyNumber strategy;
bits16 flags; /* scan qualification flags h/skey.h */
-} StrategyOperatorData;
+} StrategyOperatorData;
typedef StrategyOperatorData *StrategyOperator;
{ /* conjunctive term */
uint16 degree;
StrategyOperatorData operatorData[1]; /* VARIABLE LENGTH */
-} StrategyTermData; /* VARIABLE LENGTH STRUCTURE */
+} StrategyTermData; /* VARIABLE LENGTH STRUCTURE */
typedef StrategyTermData *StrategyTerm;
typedef struct StrategyExpressionData
{ /* disjunctive normal form */
StrategyTerm term[1]; /* VARIABLE LENGTH ARRAY */
-} StrategyExpressionData; /* VARIABLE LENGTH STRUCTURE */
+} StrategyExpressionData; /* VARIABLE LENGTH STRUCTURE */
typedef StrategyExpressionData *StrategyExpression;
StrategyTransformMap commuteTransform;
StrategyTransformMap negateCommuteTransform;
StrategyExpression expression[12]; /* XXX VARIABLE LENGTH */
-} StrategyEvaluationData; /* VARIABLE LENGTH STRUCTURE */
+} StrategyEvaluationData; /* VARIABLE LENGTH STRUCTURE */
typedef StrategyEvaluationData *StrategyEvaluation;
typedef struct StrategyMapData
{
ScanKeyData entry[1]; /* VARIABLE LENGTH ARRAY */
-} StrategyMapData; /* VARIABLE LENGTH STRUCTURE */
+} StrategyMapData; /* VARIABLE LENGTH STRUCTURE */
typedef StrategyMapData *StrategyMap;
typedef struct IndexStrategyData
{
StrategyMapData strategyMapData[1]; /* VARIABLE LENGTH ARRAY */
-} IndexStrategyData; /* VARIABLE LENGTH STRUCTURE */
+} IndexStrategyData; /* VARIABLE LENGTH STRUCTURE */
typedef IndexStrategyData *IndexStrategy;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: transam.h,v 1.10 1997/09/08 20:58:12 momjian Exp $
+ * $Id: transam.h,v 1.11 1997/09/08 21:51:03 momjian Exp $
*
* NOTES
* Transaction System Version 101 now support proper oid
typedef struct LogRelationContentsData
{
int TransSystemVersion;
-} LogRelationContentsData;
+} LogRelationContentsData;
typedef LogRelationContentsData *LogRelationContents;
typedef struct TimeRelationContentsData
{
int TransSystemVersion;
-} TimeRelationContentsData;
+} TimeRelationContentsData;
typedef TimeRelationContentsData *TimeRelationContents;
TransactionId nextXidData;
TransactionId lastXidData;
Oid nextOid;
-} VariableRelationContentsData;
+} VariableRelationContentsData;
typedef VariableRelationContentsData *VariableRelationContents;
extern void
TransComputeBlockNumber(Relation relation,
TransactionId transactionId, BlockNumber *blockNumberOutP);
-extern XidStatus
+extern XidStatus
TransBlockNumberGetXidStatus(Relation relation,
- BlockNumber blockNumber, TransactionId xid, bool * failP);
+ BlockNumber blockNumber, TransactionId xid, bool *failP);
extern void
TransBlockNumberSetXidStatus(Relation relation,
BlockNumber blockNumber, TransactionId xid, XidStatus xstatus,
- bool * failP);
+ bool *failP);
extern AbsoluteTime
TransBlockNumberGetCommitTime(Relation relation,
- BlockNumber blockNumber, TransactionId xid, bool * failP);
+ BlockNumber blockNumber, TransactionId xid, bool *failP);
extern void
TransBlockNumberSetCommitTime(Relation relation,
BlockNumber blockNumber, TransactionId xid, AbsoluteTime xtime,
- bool * failP);
+ bool *failP);
/* in transam/varsup.c */
extern void VariableRelationPutNextXid(TransactionId xid);
-extern void GetNewTransactionId(TransactionId * xid);
+extern void GetNewTransactionId(TransactionId *xid);
extern void UpdateLastCommittedXid(TransactionId xid);
-extern void GetNewObjectId(Oid * oid_return);
+extern void GetNewObjectId(Oid *oid_return);
extern void CheckMaxObjectId(Oid assigned_oid);
/* ----------------
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: tupdesc.h,v 1.11 1997/09/08 20:58:13 momjian Exp $
+ * $Id: tupdesc.h,v 1.12 1997/09/08 21:51:04 momjian Exp $
*
*-------------------------------------------------------------------------
*/
char *ccname;
char *ccbin;
char *ccsrc;
-} ConstrCheck;
+} ConstrCheck;
/* This structure contains constraints of a tuple */
typedef struct tupleConstr
uint16 num_defval;
uint16 num_check;
bool has_not_null;
-} TupleConstr;
+} TupleConstr;
/*
* This structure contains all information (i.e. from Classes
extern void FreeTupleDesc(TupleDesc tupdesc);
-extern bool
+extern bool
TupleDescInitEntry(TupleDesc desc,
AttrNumber attributeNumber,
char *attributeName,
int attdim,
bool attisset);
-extern TupleDesc BuildDescForRelation(List * schema, char *relname);
+extern TupleDesc BuildDescForRelation(List *schema, char *relname);
#endif /* TUPDESC_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: valid.h,v 1.6 1997/09/08 02:34:32 momjian Exp $
+ * $Id: valid.h,v 1.7 1997/09/08 21:51:05 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* ----------------
*/
-extern bool
+extern bool
heap_keytest(HeapTuple t, TupleDesc tupdesc,
int nkeys, ScanKey keys);
-extern HeapTuple
+extern HeapTuple
heap_tuple_satisfies(ItemId itemId, Relation relation,
Buffer buffer, PageHeader disk_page,
TimeQual qual, int nKeys,
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: xact.h,v 1.8 1997/09/08 02:34:33 momjian Exp $
+ * $Id: xact.h,v 1.9 1997/09/08 21:51:06 momjian Exp $
*
*-------------------------------------------------------------------------
*/
AbsoluteTime startTime;
int state;
int blockState;
-} TransactionStateData;
+} TransactionStateData;
/* ----------------
* transaction states
extern char *xidout(TransactionId transactionId);
extern bool xideq(TransactionId xid1, TransactionId xid2);
extern bool TransactionIdIsValid(TransactionId transactionId);
-extern void StoreInvalidTransactionId(TransactionId * destination);
+extern void StoreInvalidTransactionId(TransactionId *destination);
extern void
TransactionIdStore(TransactionId transactionId,
- TransactionId * destination);
+ TransactionId *destination);
extern bool TransactionIdEquals(TransactionId id1, TransactionId id2);
extern bool TransactionIdIsLessThan(TransactionId id1, TransactionId id2);
-extern void TransactionIdAdd(TransactionId * xid, int value);
+extern void TransactionIdAdd(TransactionId *xid, int value);
#endif /* XACT_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: bootstrap.h,v 1.8 1997/09/08 20:58:15 momjian Exp $
+ * $Id: bootstrap.h,v 1.9 1997/09/08 21:51:08 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
int strnum; /* Index into string table */
struct hashnode *next;
-} hashnode;
+} hashnode;
#define EMITPROMPT printf("> ")
int natts,
AttrNumber *attnos,
uint16 nparams,
- Datum * params,
- FuncIndexInfo * finfo,
- PredInfo * predInfo);
+ Datum *params,
+ FuncIndexInfo *finfo,
+ PredInfo *predInfo);
extern void err_out(void);
extern void InsertOneTuple(Oid objectid);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: c.h,v 1.18 1997/09/08 02:33:49 momjian Exp $
+ * $Id: c.h,v 1.19 1997/09/08 21:50:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
typedef struct
{
int indx[MAXDIM];
-} IntArray;
+} IntArray;
/*
* Offset --
typedef struct Exception
{
ExcMessage message;
-} Exception;
+} Exception;
/*
* NO_ASSERT_CHECKING, if defined, turns off all the assertions.
/* in utils/error/assert.c */
extern int
ExceptionalCondition(char *conditionName,
- Exception * exceptionP, char *details,
+ Exception *exceptionP, char *details,
char *fileName, int lineNumber);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: heap.h,v 1.6 1997/09/08 02:34:50 momjian Exp $
+ * $Id: heap.h,v 1.7 1997/09/08 21:51:15 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern Relation heap_creatr(char *relname, unsigned smgr, TupleDesc att);
-extern Oid
+extern Oid
heap_create(char relname[],
char *typename,
int arch,
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: index.h,v 1.7 1997/09/08 02:34:52 momjian Exp $
+ * $Id: index.h,v 1.8 1997/09/08 21:51:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include <access/itup.h>
#include <access/funcindex.h>
-extern Form_pg_am
+extern Form_pg_am
AccessMethodObjectIdGetAccessMethodTupleForm(Oid accessMethodObjectId);
extern void
- UpdateIndexPredicate(Oid indexoid, Node * oldPred, Node * predicate);
+ UpdateIndexPredicate(Oid indexoid, Node *oldPred, Node *predicate);
extern void
InitIndexStrategy(int numatts,
extern void
index_create(char *heapRelationName,
char *indexRelationName,
- FuncIndexInfo * funcInfo,
- List * attributeList,
+ FuncIndexInfo *funcInfo,
+ List *attributeList,
Oid accessMethodObjectId,
int numatts,
AttrNumber attNums[],
Oid classObjectId[],
uint16 parameterCount,
- Datum * parameter,
- Node * predicate,
+ Datum *parameter,
+ Node *predicate,
bool islossy,
bool unique);
extern void
FormIndexDatum(int numberOfAttributes,
AttrNumber attributeNumber[], HeapTuple heapTuple,
- TupleDesc heapDescriptor, Buffer buffer, Datum * datum,
+ TupleDesc heapDescriptor, Buffer buffer, Datum *datum,
char *nullv, FuncIndexInfoPtr fInfo);
extern void UpdateStats(Oid relid, long reltuples, bool hasindex);
extern void
-FillDummyExprContext(ExprContext * econtext, TupleTableSlot * slot,
+FillDummyExprContext(ExprContext *econtext, TupleTableSlot *slot,
TupleDesc tupdesc, Buffer buffer);
extern void
index_build(Relation heapRelation, Relation indexRelation,
int numberOfAttributes, AttrNumber attributeNumber[],
- uint16 parameterCount, Datum * parameter, FuncIndexInfo * funcInfo,
- PredInfo * predInfo);
+ uint16 parameterCount, Datum *parameter, FuncIndexInfo *funcInfo,
+ PredInfo *predInfo);
extern bool IndexIsUnique(Oid indexId);
extern bool IndexIsUniqueNoCache(Oid indexId);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: indexing.h,v 1.6 1997/09/08 02:34:53 momjian Exp $
+ * $Id: indexing.h,v 1.7 1997/09/08 21:51:25 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* Functions for each index to perform the necessary scan on a cache miss.
*/
extern void CatalogOpenIndices(int nIndices, char *names[], Relation idescs[]);
-extern void CatalogCloseIndices(int nIndices, Relation * idescs);
+extern void CatalogCloseIndices(int nIndices, Relation *idescs);
extern void
-CatalogIndexInsert(Relation * idescs,
+CatalogIndexInsert(Relation *idescs,
int nIndices,
Relation heapRelation,
HeapTuple heapTuple);
extern bool CatalogHasIndex(char *catName, Oid catId);
-extern HeapTuple
+extern HeapTuple
AttributeNameIndexScan(Relation heapRelation,
Oid relid,
char *attname);
-extern HeapTuple
+extern HeapTuple
AttributeNumIndexScan(Relation heapRelation,
Oid relid,
AttrNumber attnum);
extern HeapTuple ProcedureOidIndexScan(Relation heapRelation, Oid procId);
-extern HeapTuple
+extern HeapTuple
ProcedureNameIndexScan(Relation heapRelation,
- char *procName, int nargs, Oid * argTypes);
-extern HeapTuple ProcedureSrcIndexScan(Relation heapRelation, text * procSrc);
+ char *procName, int nargs, Oid *argTypes);
+extern HeapTuple ProcedureSrcIndexScan(Relation heapRelation, text *procSrc);
extern HeapTuple TypeOidIndexScan(Relation heapRelation, Oid typeId);
extern HeapTuple TypeNameIndexScan(Relation heapRelation, char *typeName);
extern HeapTuple ClassNameIndexScan(Relation heapRelation, char *relName);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_aggregate.h,v 1.10 1997/09/08 02:34:54 momjian Exp $
+ * $Id: pg_aggregate.h,v 1.11 1997/09/08 21:51:27 momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
char *agginitval2);
extern char *
AggNameGetInitVal(char *aggName, Oid basetype,
- int xfuncno, bool * isNull);
+ int xfuncno, bool *isNull);
#endif /* PG_AGGREGATE_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_proc.h,v 1.29 1997/09/08 02:35:23 momjian Exp $
+ * $Id: pg_proc.h,v 1.30 1997/09/08 21:51:29 momjian Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
/*
* prototypes for functions pg_proc.c
*/
-extern Oid
+extern Oid
ProcedureCreate(char *procedureName,
bool returnsSet,
char *returnTypeName,
int32 perbyte_cpu,
int32 percall_cpu,
int32 outin_ratio,
- List * argList,
+ List *argList,
CommandDest dest);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_type.h,v 1.18 1997/09/08 02:35:32 momjian Exp $
+ * $Id: pg_type.h,v 1.19 1997/09/08 21:51:31 momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
/*
* prototypes for functions in pg_type.c
*/
-extern Oid TypeGet(char *typeName, bool * defined);
+extern Oid TypeGet(char *typeName, bool *defined);
extern Oid TypeShellMake(char *typeName);
-extern Oid
+extern Oid
TypeCreate(char *typeName,
Oid relationOid,
int16 internalSize,
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: command.h,v 1.6 1997/09/08 02:35:42 momjian Exp $
+ * $Id: command.h,v 1.7 1997/09/08 21:51:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*/
extern void
PerformAddAttribute(char *relationName, char *userName,
- bool inh, ColumnDef * colDef);
+ bool inh, ColumnDef *colDef);
#endif /* COMMAND_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: creatinh.h,v 1.3 1997/09/08 02:35:44 momjian Exp $
+ * $Id: creatinh.h,v 1.4 1997/09/08 21:51:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef CREATINH_H
#define CREATINH_H
-extern void DefineRelation(CreateStmt * stmt);
+extern void DefineRelation(CreateStmt *stmt);
extern void RemoveRelation(char *name);
extern char *MakeArchiveName(Oid relid);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: defrem.h,v 1.9 1997/09/08 02:35:47 momjian Exp $
+ * $Id: defrem.h,v 1.10 1997/09/08 21:51:36 momjian Exp $
*
*-------------------------------------------------------------------------
*/
DefineIndex(char *heapRelationName,
char *indexRelationName,
char *accessMethodName,
- List * attributeList,
- List * parameterList,
+ List *attributeList,
+ List *parameterList,
bool unique,
- Expr * predicate,
- List * rangetable);
+ Expr *predicate,
+ List *rangetable);
extern void
ExtendIndex(char *indexRelationName,
- Expr * predicate,
- List * rangetable);
+ Expr *predicate,
+ List *rangetable);
extern void RemoveIndex(char *name);
/*
* prototypes in define.c
*/
-extern void CreateFunction(ProcedureStmt * stmt, CommandDest dest);
-extern void DefineOperator(char *name, List * parameters);
-extern void DefineAggregate(char *name, List * parameters);
-extern void DefineType(char *name, List * parameters);
-extern void CreateFunction(ProcedureStmt * stmt, CommandDest dest);
+extern void CreateFunction(ProcedureStmt *stmt, CommandDest dest);
+extern void DefineOperator(char *name, List *parameters);
+extern void DefineAggregate(char *name, List *parameters);
+extern void DefineType(char *name, List *parameters);
+extern void CreateFunction(ProcedureStmt *stmt, CommandDest dest);
/*
* prototypes in remove.c
*/
-extern void RemoveFunction(char *functionName, int nargs, List * argNameList);
+extern void RemoveFunction(char *functionName, int nargs, List *argNameList);
extern void
RemoveOperator(char *operatorName,
char *typeName1, char *typeName2);
*
* Copyright (c) 1994-5, Regents of the University of California
*
- * $Id: explain.h,v 1.4 1997/09/08 02:35:52 momjian Exp $
+ * $Id: explain.h,v 1.5 1997/09/08 21:51:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef EXPLAIN_H
#define EXPLAIN_H
-extern void ExplainQuery(Query * query, bool verbose, CommandDest dest);
+extern void ExplainQuery(Query *query, bool verbose, CommandDest dest);
#endif /* EXPLAIN_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: purge.h,v 1.3 1997/09/08 02:35:53 momjian Exp $
+ * $Id: purge.h,v 1.4 1997/09/08 21:51:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef PURGE_H
#define PURGE_H
-extern int32
+extern int32
RelationPurge(char *relationName,
char *absoluteTimeString,
char *relativeTimeString);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: recipe.h,v 1.3 1997/09/08 02:35:56 momjian Exp $
+ * $Id: recipe.h,v 1.4 1997/09/08 21:51:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef RECIPE_H
#define RECIPE_H
-extern void beginRecipe(RecipeStmt * stmt);
+extern void beginRecipe(RecipeStmt *stmt);
#endif /* RECIPE_H */
#define SEQ_COL_FIRSTCOL SEQ_COL_NAME
#define SEQ_COL_LASTCOL SEQ_COL_CALLED
-extern void DefineSequence(CreateSeqStmt * stmt);
+extern void DefineSequence(CreateSeqStmt *stmt);
extern int4 nextval(struct varlena * seqname);
extern int4 currval(struct varlena * seqname);
extern void CloseSequences(void);
HeapTuple tg_trigtuple;
HeapTuple tg_newtuple;
Trigger *tg_trigger;
-} TriggerData;
+} TriggerData;
extern TriggerData *CurrentTriggerData;
(!TRIGGER_FIRED_BEFORE (event))
-extern void CreateTrigger(CreateTrigStmt * stmt);
-extern void DropTrigger(DropTrigStmt * stmt);
+extern void CreateTrigger(CreateTrigStmt *stmt);
+extern void DropTrigger(DropTrigStmt *stmt);
extern void RelationRemoveTriggers(Relation rel);
extern HeapTuple ExecBRInsertTriggers(Relation rel, HeapTuple tuple);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: vacuum.h,v 1.9 1997/09/08 02:36:05 momjian Exp $
+ * $Id: vacuum.h,v 1.10 1997/09/08 21:51:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
int val_dummy;
struct VAttListData *val_next;
-} VAttListData;
+} VAttListData;
typedef VAttListData *VAttList;
uint16 vpd_nusd; /* Number of OffNums used by vacuum */
uint16 vpd_noff; /* Number of OffNums free or to be free */
OffsetNumber vpd_voff[1]; /* Array of its OffNums */
-} VPageDescrData;
+} VPageDescrData;
typedef VPageDescrData *VPageDescr;
int vpl_nemend; /* Number of "empty" end-pages */
int vpl_npages; /* Number of pages in vpl_pgdesc */
VPageDescr *vpl_pgdesc; /* Descriptions of pages */
-} VPageListData;
+} VPageListData;
typedef VPageListData *VPageList;
FuncIndexInfo *finfoP;
IndexTupleForm tform;
int natts;
-} IndDesc;
+} IndDesc;
typedef struct
{
f_cmpgt;
regproc outfunc;
bool initialized;
-} VacAttrStats;
+} VacAttrStats;
typedef struct VRelListData
{
Oid vrl_relid;
struct VRelListData *vrl_next;
-} VRelListData;
+} VRelListData;
typedef VRelListData *VRelList;
bool hasindex;
int va_natts; /* number of attrs being analyzed */
VacAttrStats *vacattrstats;
-} VRelStats;
+} VRelStats;
extern bool VacuumRunning;
extern void vc_abort(void);
-extern void vacuum(char *vacrel, bool verbose, bool analyze, List * va_spec);
+extern void vacuum(char *vacrel, bool verbose, bool analyze, List *va_spec);
#define ATTNVALS_SCALE 1000000000 /* XXX so it can act as a float4 */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: view.h,v 1.3 1997/09/08 02:36:05 momjian Exp $
+ * $Id: view.h,v 1.4 1997/09/08 21:51:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define VIEW_H
extern char *MakeRetrieveViewRuleName(char *view_name);
-extern void DefineView(char *view_name, Query * view_parse);
+extern void DefineView(char *view_name, Query *view_parse);
extern void RemoveView(char *view_name);
#endif /* VIEW_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: execFlatten.h,v 1.4 1997/09/08 02:36:08 momjian Exp $
+ * $Id: execFlatten.h,v 1.5 1997/09/08 21:51:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef EXECFLATTEN_H
#define EXECFLATTEN_H
-extern Datum ExecEvalIter(Iter * iterNode, ExprContext * econtext, bool * resultIsNull, bool * iterIsDone);
+extern Datum ExecEvalIter(Iter *iterNode, ExprContext *econtext, bool *resultIsNull, bool *iterIsDone);
-extern void ExecEvalFjoin(TargetEntry * tlist, ExprContext * econtext, bool * isNullVect, bool * fj_isDone);
+extern void ExecEvalFjoin(TargetEntry *tlist, ExprContext *econtext, bool *isNullVect, bool *fj_isDone);
#endif /* EXECFLATTEN_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: execdesc.h,v 1.5 1997/09/08 02:36:16 momjian Exp $
+ * $Id: execdesc.h,v 1.6 1997/09/08 21:51:50 momjian Exp $
*
*-------------------------------------------------------------------------
*/
Query *parsetree;
Plan *plantree;
CommandDest dest; /* the destination output of the execution */
-} QueryDesc;
+} QueryDesc;
/* in pquery.c */
extern QueryDesc *
-CreateQueryDesc(Query * parsetree, Plan * plantree,
+CreateQueryDesc(Query *parsetree, Plan *plantree,
CommandDest dest);
#endif /* EXECDESC_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: executor.h,v 1.12 1997/09/08 02:36:17 momjian Exp $
+ * $Id: executor.h,v 1.13 1997/09/08 21:51:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern void
ExecOpenScanR(Oid relOid, int nkeys, ScanKey skeys, bool isindex,
ScanDirection dir, TimeQual timeRange,
- Relation * returnRelation, Pointer * returnScanDesc);
-extern void ExecCloseR(Plan * node);
-extern void ExecReScan(Plan * node, ExprContext * exprCtxt, Plan * parent);
-extern HeapScanDesc
+ Relation *returnRelation, Pointer *returnScanDesc);
+extern void ExecCloseR(Plan *node);
+extern void ExecReScan(Plan *node, ExprContext *exprCtxt, Plan *parent);
+extern HeapScanDesc
ExecReScanR(Relation relDesc, HeapScanDesc scanDesc,
ScanDirection direction, int nkeys, ScanKey skeys);
-extern void ExecMarkPos(Plan * node);
-extern void ExecRestrPos(Plan * node);
+extern void ExecMarkPos(Plan *node);
+extern void ExecRestrPos(Plan *node);
extern Relation ExecCreatR(TupleDesc tupType, Oid relationOid);
/*
* prototypes from functions in execJunk.c
*/
-extern JunkFilter *ExecInitJunkFilter(List * targetList);
-extern bool
-ExecGetJunkAttribute(JunkFilter * junkfilter, TupleTableSlot * slot,
- char *attrName, Datum * value, bool * isNull);
-extern HeapTuple ExecRemoveJunk(JunkFilter * junkfilter, TupleTableSlot * slot);
+extern JunkFilter *ExecInitJunkFilter(List *targetList);
+extern bool
+ExecGetJunkAttribute(JunkFilter *junkfilter, TupleTableSlot *slot,
+ char *attrName, Datum *value, bool *isNull);
+extern HeapTuple ExecRemoveJunk(JunkFilter *junkfilter, TupleTableSlot *slot);
/*
* prototypes from functions in execMain.c
*/
-extern TupleDesc ExecutorStart(QueryDesc * queryDesc, EState * estate);
-extern TupleTableSlot *ExecutorRun(QueryDesc * queryDesc, EState * estate, int feature, int count);
-extern void ExecutorEnd(QueryDesc * queryDesc, EState * estate);
+extern TupleDesc ExecutorStart(QueryDesc *queryDesc, EState *estate);
+extern TupleTableSlot *ExecutorRun(QueryDesc *queryDesc, EState *estate, int feature, int count);
+extern void ExecutorEnd(QueryDesc *queryDesc, EState *estate);
extern HeapTuple ExecConstraints(char *caller, Relation rel, HeapTuple tuple);
/*
* prototypes from functions in execProcnode.c
*/
-extern bool ExecInitNode(Plan * node, EState * estate, Plan * parent);
-extern TupleTableSlot *ExecProcNode(Plan * node, Plan * parent);
-extern int ExecCountSlotsNode(Plan * node);
-extern void ExecEndNode(Plan * node, Plan * parent);
+extern bool ExecInitNode(Plan *node, EState *estate, Plan *parent);
+extern TupleTableSlot *ExecProcNode(Plan *node, Plan *parent);
+extern int ExecCountSlotsNode(Plan *node);
+extern void ExecEndNode(Plan *node, Plan *parent);
/*
* prototypes from functions in execQual.c
extern bool execConstByVal;
extern int execConstLen;
-extern Datum
-ExecExtractResult(TupleTableSlot * slot, AttrNumber attnum,
- bool * isNull);
-extern Datum
-ExecEvalParam(Param * expression, ExprContext * econtext,
- bool * isNull);
+extern Datum
+ExecExtractResult(TupleTableSlot *slot, AttrNumber attnum,
+ bool *isNull);
+extern Datum
+ExecEvalParam(Param *expression, ExprContext *econtext,
+ bool *isNull);
/* stop here */
extern char *
-GetAttributeByName(TupleTableSlot * slot, char *attname,
- bool * isNull);
-extern Datum
-ExecEvalExpr(Node * expression, ExprContext * econtext, bool * isNull,
- bool * isDone);
-extern bool ExecQual(List * qual, ExprContext * econtext);
-extern int ExecTargetListLength(List * targetlist);
-extern TupleTableSlot *ExecProject(ProjectionInfo * projInfo, bool * isDone);
+GetAttributeByName(TupleTableSlot *slot, char *attname,
+ bool *isNull);
+extern Datum
+ExecEvalExpr(Node *expression, ExprContext *econtext, bool *isNull,
+ bool *isDone);
+extern bool ExecQual(List *qual, ExprContext *econtext);
+extern int ExecTargetListLength(List *targetlist);
+extern TupleTableSlot *ExecProject(ProjectionInfo *projInfo, bool *isDone);
/*
* prototypes from functions in execScan.c
*/
-extern TupleTableSlot *ExecScan(Scan * node, TupleTableSlot * (*accessMtd) ());
+extern TupleTableSlot *ExecScan(Scan *node, TupleTableSlot *(*accessMtd) ());
/*
* prototypes from functions in execTuples.c
extern TupleTableSlot *ExecAllocTableSlot(TupleTable table);
extern TupleTableSlot *
ExecStoreTuple(HeapTuple tuple,
- TupleTableSlot * slot,
+ TupleTableSlot *slot,
Buffer buffer,
bool shouldFree);
-extern TupleTableSlot *ExecClearTuple(TupleTableSlot * slot);
-extern bool ExecSetSlotPolicy(TupleTableSlot * slot, bool shouldFree);
-extern TupleDesc
-ExecSetSlotDescriptor(TupleTableSlot * slot,
+extern TupleTableSlot *ExecClearTuple(TupleTableSlot *slot);
+extern bool ExecSetSlotPolicy(TupleTableSlot *slot, bool shouldFree);
+extern TupleDesc
+ExecSetSlotDescriptor(TupleTableSlot *slot,
TupleDesc tupdesc);
-extern void ExecSetSlotDescriptorIsNew(TupleTableSlot * slot, bool isNew);
-extern void ExecIncrSlotBufferRefcnt(TupleTableSlot * slot);
-extern bool TupIsNull(TupleTableSlot * slot);
-extern void ExecInitResultTupleSlot(EState * estate, CommonState * commonstate);
+extern void ExecSetSlotDescriptorIsNew(TupleTableSlot *slot, bool isNew);
+extern void ExecIncrSlotBufferRefcnt(TupleTableSlot *slot);
+extern bool TupIsNull(TupleTableSlot *slot);
+extern void ExecInitResultTupleSlot(EState *estate, CommonState *commonstate);
extern void
-ExecInitScanTupleSlot(EState * estate,
- CommonScanState * commonscanstate);
-extern void ExecInitMarkedTupleSlot(EState * estate, MergeJoinState * mergestate);
-extern void ExecInitOuterTupleSlot(EState * estate, HashJoinState * hashstate);
+ExecInitScanTupleSlot(EState *estate,
+ CommonScanState *commonscanstate);
+extern void ExecInitMarkedTupleSlot(EState *estate, MergeJoinState *mergestate);
+extern void ExecInitOuterTupleSlot(EState *estate, HashJoinState *hashstate);
-extern TupleDesc ExecGetTupType(Plan * node);
-extern TupleDesc ExecTypeFromTL(List * targetList);
+extern TupleDesc ExecGetTupType(Plan *node);
+extern TupleDesc ExecTypeFromTL(List *targetList);
/*
* prototypes from functions in execTuples.c
*/
extern void ResetTupleCount(void);
extern void
-ExecAssignNodeBaseInfo(EState * estate, CommonState * basenode,
- Plan * parent);
-extern void ExecAssignExprContext(EState * estate, CommonState * commonstate);
+ExecAssignNodeBaseInfo(EState *estate, CommonState *basenode,
+ Plan *parent);
+extern void ExecAssignExprContext(EState *estate, CommonState *commonstate);
extern void
-ExecAssignResultType(CommonState * commonstate,
+ExecAssignResultType(CommonState *commonstate,
TupleDesc tupDesc);
extern void
-ExecAssignResultTypeFromOuterPlan(Plan * node,
- CommonState * commonstate);
-extern void ExecAssignResultTypeFromTL(Plan * node, CommonState * commonstate);
-extern TupleDesc ExecGetResultType(CommonState * commonstate);
-extern void ExecAssignProjectionInfo(Plan * node, CommonState * commonstate);
-extern void ExecFreeProjectionInfo(CommonState * commonstate);
-extern TupleDesc ExecGetScanType(CommonScanState * csstate);
+ExecAssignResultTypeFromOuterPlan(Plan *node,
+ CommonState *commonstate);
+extern void ExecAssignResultTypeFromTL(Plan *node, CommonState *commonstate);
+extern TupleDesc ExecGetResultType(CommonState *commonstate);
+extern void ExecAssignProjectionInfo(Plan *node, CommonState *commonstate);
+extern void ExecFreeProjectionInfo(CommonState *commonstate);
+extern TupleDesc ExecGetScanType(CommonScanState *csstate);
extern void
-ExecAssignScanType(CommonScanState * csstate,
+ExecAssignScanType(CommonScanState *csstate,
TupleDesc tupDesc);
extern void
-ExecAssignScanTypeFromOuterPlan(Plan * node,
- CommonScanState * csstate);
+ExecAssignScanTypeFromOuterPlan(Plan *node,
+ CommonScanState *csstate);
extern AttributeTupleForm ExecGetTypeInfo(Relation relDesc);
extern void
ExecOpenIndices(Oid resultRelationOid,
- RelationInfo * resultRelationInfo);
-extern void ExecCloseIndices(RelationInfo * resultRelationInfo);
+ RelationInfo *resultRelationInfo);
+extern void ExecCloseIndices(RelationInfo *resultRelationInfo);
extern void
-ExecInsertIndexTuples(TupleTableSlot * slot, ItemPointer tupleid,
- EState * estate, bool is_update);
+ExecInsertIndexTuples(TupleTableSlot *slot, ItemPointer tupleid,
+ EState *estate, bool is_update);
extern void resetVarAttrLenForCreateTable(TupleDesc tupType);
extern void
setVarAttrLenForCreateTable(TupleDesc tupType,
- List * targetList, List * rangeTable);
+ List *targetList, List *rangeTable);
/* ----------------------------------------------------------------
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: functions.h,v 1.3 1997/09/08 02:36:18 momjian Exp $
+ * $Id: functions.h,v 1.4 1997/09/08 21:51:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef FUNCTIONS_H
#define FUNCTIONS_H
-extern Datum
-ProjectAttribute(TupleDesc TD, TargetEntry * tlist,
- HeapTuple tup, bool * isnullP);
+extern Datum
+ProjectAttribute(TupleDesc TD, TargetEntry *tlist,
+ HeapTuple tup, bool *isnullP);
-extern Datum
-postquel_function(Func * funcNode, char **args,
- bool * isNull, bool * isDone);
+extern Datum
+postquel_function(Func *funcNode, char **args,
+ bool *isNull, bool *isDone);
#endif /* FUNCTIONS_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: hashjoin.h,v 1.5 1997/09/08 02:36:20 momjian Exp $
+ * $Id: hashjoin.h,v 1.6 1997/09/08 21:52:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/
int curbatch;
int nprocess;
int pcount;
-} HashTableData; /* real hash table follows here */
+} HashTableData; /* real hash table follows here */
typedef HashTableData *HashJoinTable;
{
RelativeAddr tuple; /* HeapTuple */
RelativeAddr next; /* struct OverflowTupleData * */
-} OverflowTupleData; /* real tuple follows here */
+} OverflowTupleData; /* real tuple follows here */
typedef OverflowTupleData *OverflowTuple;
RelativeAddr bottom; /* HeapTuple */
RelativeAddr firstotuple; /* OverflowTuple */
RelativeAddr lastotuple; /* OverflowTuple */
-} HashBucketData; /* real bucket follows here */
+} HashBucketData; /* real bucket follows here */
typedef HashBucketData *HashBucket;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodeAgg.h,v 1.4 1997/09/08 20:58:17 momjian Exp $
+ * $Id: nodeAgg.h,v 1.5 1997/09/08 21:52:01 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define NODEAGG_H
extern TupleTableSlot *ExecAgg(Agg *node);
-extern bool ExecInitAgg(Agg *node, EState * estate, Plan * parent);
+extern bool ExecInitAgg(Agg *node, EState *estate, Plan *parent);
extern int ExecCountSlotsAgg(Agg *node);
extern void ExecEndAgg(Agg *node);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodeAppend.h,v 1.5 1997/09/08 20:58:19 momjian Exp $
+ * $Id: nodeAppend.h,v 1.6 1997/09/08 21:52:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef NODEAPPEND_H
#define NODEAPPEND_H
-extern bool ExecInitAppend(Append *node, EState * estate, Plan * parent);
+extern bool ExecInitAppend(Append *node, EState *estate, Plan *parent);
extern int ExecCountSlotsAppend(Append *node);
extern TupleTableSlot *ExecProcAppend(Append *node);
extern void ExecEndAppend(Append *node);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodeGroup.h,v 1.3 1997/09/08 02:36:23 momjian Exp $
+ * $Id: nodeGroup.h,v 1.4 1997/09/08 21:52:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef NODEGROUP_H
#define NODEGROUP_H
-extern TupleTableSlot *ExecGroup(Group * node);
-extern bool ExecInitGroup(Group * node, EState * estate, Plan * parent);
-extern int ExecCountSlotsGroup(Group * node);
-extern void ExecEndGroup(Group * node);
+extern TupleTableSlot *ExecGroup(Group *node);
+extern bool ExecInitGroup(Group *node, EState *estate, Plan *parent);
+extern int ExecCountSlotsGroup(Group *node);
+extern void ExecEndGroup(Group *node);
#endif /* NODEGROUP_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodeHash.h,v 1.4 1997/09/08 02:36:23 momjian Exp $
+ * $Id: nodeHash.h,v 1.5 1997/09/08 21:52:04 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef NODEHASH_H
#define NODEHASH_H
-extern TupleTableSlot *ExecHash(Hash * node);
-extern bool ExecInitHash(Hash * node, EState * estate, Plan * parent);
-extern int ExecCountSlotsHash(Hash * node);
-extern void ExecEndHash(Hash * node);
-extern HashJoinTable ExecHashTableCreate(Hash * node);
+extern TupleTableSlot *ExecHash(Hash *node);
+extern bool ExecInitHash(Hash *node, EState *estate, Plan *parent);
+extern int ExecCountSlotsHash(Hash *node);
+extern void ExecEndHash(Hash *node);
+extern HashJoinTable ExecHashTableCreate(Hash *node);
extern void
-ExecHashTableInsert(HashJoinTable hashtable, ExprContext * econtext,
- Var * hashkey, File * batches);
+ExecHashTableInsert(HashJoinTable hashtable, ExprContext *econtext,
+ Var *hashkey, File *batches);
extern void ExecHashTableDestroy(HashJoinTable hashtable);
extern int
-ExecHashGetBucket(HashJoinTable hashtable, ExprContext * econtext,
- Var * hashkey);
-extern HeapTuple
-ExecScanHashBucket(HashJoinState * hjstate, HashBucket bucket,
- HeapTuple curtuple, List * hjclauses,
- ExprContext * econtext);
+ExecHashGetBucket(HashJoinTable hashtable, ExprContext *econtext,
+ Var *hashkey);
+extern HeapTuple
+ExecScanHashBucket(HashJoinState *hjstate, HashBucket bucket,
+ HeapTuple curtuple, List *hjclauses,
+ ExprContext *econtext);
extern void ExecHashTableReset(HashJoinTable hashtable, int ntuples);
#endif /* NODEHASH_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodeHashjoin.h,v 1.4 1997/09/08 02:36:25 momjian Exp $
+ * $Id: nodeHashjoin.h,v 1.5 1997/09/08 21:52:05 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef NODEHASHJOIN_H
#define NODEHASHJOIN_H
-extern TupleTableSlot *ExecHashJoin(HashJoin * node);
+extern TupleTableSlot *ExecHashJoin(HashJoin *node);
-extern bool ExecInitHashJoin(HashJoin * node, EState * estate, Plan * parent);
+extern bool ExecInitHashJoin(HashJoin *node, EState *estate, Plan *parent);
-extern int ExecCountSlotsHashJoin(HashJoin * node);
+extern int ExecCountSlotsHashJoin(HashJoin *node);
-extern void ExecEndHashJoin(HashJoin * node);
+extern void ExecEndHashJoin(HashJoin *node);
extern char *
ExecHashJoinSaveTuple(HeapTuple heapTuple, char *buffer,
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodeIndexscan.h,v 1.4 1997/09/08 02:36:25 momjian Exp $
+ * $Id: nodeIndexscan.h,v 1.5 1997/09/08 21:52:06 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef NODEINDEXSCAN_H
#define NODEINDEXSCAN_H
-extern TupleTableSlot *ExecIndexScan(IndexScan * node);
+extern TupleTableSlot *ExecIndexScan(IndexScan *node);
-extern void ExecIndexReScan(IndexScan * node, ExprContext * exprCtxt, Plan * parent);
+extern void ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent);
-extern void ExecEndIndexScan(IndexScan * node);
+extern void ExecEndIndexScan(IndexScan *node);
-extern void ExecIndexMarkPos(IndexScan * node);
+extern void ExecIndexMarkPos(IndexScan *node);
-extern void ExecIndexRestrPos(IndexScan * node);
+extern void ExecIndexRestrPos(IndexScan *node);
-extern void ExecUpdateIndexScanKeys(IndexScan * node, ExprContext * econtext);
+extern void ExecUpdateIndexScanKeys(IndexScan *node, ExprContext *econtext);
-extern bool ExecInitIndexScan(IndexScan * node, EState * estate, Plan * parent);
+extern bool ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent);
-extern int ExecCountSlotsIndexScan(IndexScan * node);
+extern int ExecCountSlotsIndexScan(IndexScan *node);
-extern void ExecIndexReScan(IndexScan * node, ExprContext * exprCtxt, Plan * parent);
+extern void ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent);
#endif /* NODEINDEXSCAN_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodeMaterial.h,v 1.3 1997/09/08 02:36:26 momjian Exp $
+ * $Id: nodeMaterial.h,v 1.4 1997/09/08 21:52:07 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef NODEMATERIAL_H
#define NODEMATERIAL_H
-extern TupleTableSlot *ExecMaterial(Material * node);
-extern bool ExecInitMaterial(Material * node, EState * estate, Plan * parent);
-extern int ExecCountSlotsMaterial(Material * node);
-extern void ExecEndMaterial(Material * node);
-extern List ExecMaterialMarkPos(Material * node);
-extern void ExecMaterialRestrPos(Material * node);
+extern TupleTableSlot *ExecMaterial(Material *node);
+extern bool ExecInitMaterial(Material *node, EState *estate, Plan *parent);
+extern int ExecCountSlotsMaterial(Material *node);
+extern void ExecEndMaterial(Material *node);
+extern List ExecMaterialMarkPos(Material *node);
+extern void ExecMaterialRestrPos(Material *node);
#endif /* NODEMATERIAL_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodeMergejoin.h,v 1.5 1997/09/08 02:36:29 momjian Exp $
+ * $Id: nodeMergejoin.h,v 1.6 1997/09/08 21:52:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef NODEMERGEJOIN_H
#define NODEMERGEJOIN_H
-extern TupleTableSlot *ExecMergeJoin(MergeJoin * node);
+extern TupleTableSlot *ExecMergeJoin(MergeJoin *node);
-extern bool ExecInitMergeJoin(MergeJoin * node, EState * estate, Plan * parent);
+extern bool ExecInitMergeJoin(MergeJoin *node, EState *estate, Plan *parent);
-extern int ExecCountSlotsMergeJoin(MergeJoin * node);
+extern int ExecCountSlotsMergeJoin(MergeJoin *node);
-extern void ExecEndMergeJoin(MergeJoin * node);
+extern void ExecEndMergeJoin(MergeJoin *node);
#endif /* NODEMERGEJOIN_H; */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodeNestloop.h,v 1.3 1997/09/08 02:36:34 momjian Exp $
+ * $Id: nodeNestloop.h,v 1.4 1997/09/08 21:52:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef NODENESTLOOP_H
#define NODENESTLOOP_H
-extern TupleTableSlot *ExecNestLoop(NestLoop * node, Plan * parent);
-extern bool ExecInitNestLoop(NestLoop * node, EState * estate, Plan * parent);
-extern int ExecCountSlotsNestLoop(NestLoop * node);
-extern void ExecEndNestLoop(NestLoop * node);
+extern TupleTableSlot *ExecNestLoop(NestLoop *node, Plan *parent);
+extern bool ExecInitNestLoop(NestLoop *node, EState *estate, Plan *parent);
+extern int ExecCountSlotsNestLoop(NestLoop *node);
+extern void ExecEndNestLoop(NestLoop *node);
#endif /* NODENESTLOOP_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodeResult.h,v 1.3 1997/09/08 02:36:38 momjian Exp $
+ * $Id: nodeResult.h,v 1.4 1997/09/08 21:52:11 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef NODERESULT_H
#define NODERESULT_H
-extern TupleTableSlot *ExecResult(Result * node);
-extern bool ExecInitResult(Result * node, EState * estate, Plan * parent);
-extern int ExecCountSlotsResult(Result * node);
-extern void ExecEndResult(Result * node);
+extern TupleTableSlot *ExecResult(Result *node);
+extern bool ExecInitResult(Result *node, EState *estate, Plan *parent);
+extern int ExecCountSlotsResult(Result *node);
+extern void ExecEndResult(Result *node);
#endif /* NODERESULT_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodeSeqscan.h,v 1.4 1997/09/08 02:36:39 momjian Exp $
+ * $Id: nodeSeqscan.h,v 1.5 1997/09/08 21:52:12 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef NODESEQSCAN_H
#define NODESEQSCAN_H
-extern TupleTableSlot *ExecSeqScan(SeqScan * node);
-extern bool ExecInitSeqScan(SeqScan * node, EState * estate, Plan * parent);
-extern int ExecCountSlotsSeqScan(SeqScan * node);
-extern void ExecEndSeqScan(SeqScan * node);
-extern void ExecSeqReScan(SeqScan * node, ExprContext * exprCtxt, Plan * parent);
-extern void ExecSeqMarkPos(SeqScan * node);
-extern void ExecSeqRestrPos(SeqScan * node);
+extern TupleTableSlot *ExecSeqScan(SeqScan *node);
+extern bool ExecInitSeqScan(SeqScan *node, EState *estate, Plan *parent);
+extern int ExecCountSlotsSeqScan(SeqScan *node);
+extern void ExecEndSeqScan(SeqScan *node);
+extern void ExecSeqReScan(SeqScan *node, ExprContext *exprCtxt, Plan *parent);
+extern void ExecSeqMarkPos(SeqScan *node);
+extern void ExecSeqRestrPos(SeqScan *node);
#endif /* NODESEQSCAN_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodeSort.h,v 1.3 1997/09/08 02:36:40 momjian Exp $
+ * $Id: nodeSort.h,v 1.4 1997/09/08 21:52:12 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef NODESORT_H
#define NODESORT_H
-extern TupleTableSlot *ExecSort(Sort * node);
-extern bool ExecInitSort(Sort * node, EState * estate, Plan * parent);
-extern int ExecCountSlotsSort(Sort * node);
-extern void ExecEndSort(Sort * node);
-extern void ExecSortMarkPos(Sort * node);
-extern void ExecSortRestrPos(Sort * node);
+extern TupleTableSlot *ExecSort(Sort *node);
+extern bool ExecInitSort(Sort *node, EState *estate, Plan *parent);
+extern int ExecCountSlotsSort(Sort *node);
+extern void ExecEndSort(Sort *node);
+extern void ExecSortMarkPos(Sort *node);
+extern void ExecSortRestrPos(Sort *node);
#endif /* NODESORT_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodeTee.h,v 1.3 1997/09/08 02:36:41 momjian Exp $
+ * $Id: nodeTee.h,v 1.4 1997/09/08 21:52:13 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef NODETEE_H
#define NODETEE_H
-extern TupleTableSlot *ExecTee(Tee * node, Plan * parent);
-extern bool ExecInitTee(Tee * node, EState * estate, Plan * parent);
-extern void ExecTeeReScan(Tee * node, ExprContext * exprCtxt, Plan * parent);
-extern void ExecEndTee(Tee * node, Plan * parent);
-extern int ExecCountSlotsTee(Tee * node);
+extern TupleTableSlot *ExecTee(Tee *node, Plan *parent);
+extern bool ExecInitTee(Tee *node, EState *estate, Plan *parent);
+extern void ExecTeeReScan(Tee *node, ExprContext *exprCtxt, Plan *parent);
+extern void ExecEndTee(Tee *node, Plan *parent);
+extern int ExecCountSlotsTee(Tee *node);
#endif /* NODETEE_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodeUnique.h,v 1.3 1997/09/08 02:36:42 momjian Exp $
+ * $Id: nodeUnique.h,v 1.4 1997/09/08 21:52:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef NODEUNIQUE_H
#define NODEUNIQUE_H
-extern TupleTableSlot *ExecUnique(Unique * node);
-extern bool ExecInitUnique(Unique * node, EState * estate, Plan * parent);
-extern int ExecCountSlotsUnique(Unique * node);
-extern void ExecEndUnique(Unique * node);
+extern TupleTableSlot *ExecUnique(Unique *node);
+extern bool ExecInitUnique(Unique *node, EState *estate, Plan *parent);
+extern int ExecCountSlotsUnique(Unique *node);
+extern void ExecEndUnique(Unique *node);
#endif /* NODEUNIQUE_H */
uint32 free; /* # of free vals */
TupleDesc tupdesc; /* tuple descriptor */
HeapTuple *vals; /* tuples */
-} SPITupleTable;
+} SPITupleTable;
#define SPI_ERROR_CONNECT -1
#define SPI_ERROR_COPY -2
extern int SPI_finish(void);
extern int SPI_exec(char *src, int tcount);
extern int SPI_execp(void *plan, char **values, char *Nulls, int tcount);
-extern void *SPI_prepare(char *src, int nargs, Oid * argtypes);
+extern void *SPI_prepare(char *src, int nargs, Oid *argtypes);
extern void *SPI_saveplan(void *plan);
extern int SPI_fnumber(TupleDesc tupdesc, char *fname);
extern char *SPI_getvalue(HeapTuple tuple, TupleDesc tupdesc, int fnumber);
-extern char *SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool * isnull);
+extern char *SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool *isnull);
extern char *SPI_gettype(TupleDesc tupdesc, int fnumber);
extern Oid SPI_gettypeid(TupleDesc tupdesc, int fnumber);
extern char *SPI_getrelname(Relation rel);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: tuptable.h,v 1.6 1997/09/08 02:36:45 momjian Exp $
+ * $Id: tuptable.h,v 1.7 1997/09/08 21:52:16 momjian Exp $
*
* NOTES
* The tuple table interface is getting pretty ugly.
TupleDesc ttc_tupleDescriptor;
Buffer ttc_buffer;
int ttc_whichplan;
-} TupleTableSlot;
+} TupleTableSlot;
/* ----------------
* tuple table data structure
int size; /* size of the table */
int next; /* next available slot number */
TupleTableSlot *array; /* array of TupleTableSlot's */
-} TupleTableData;
+} TupleTableData;
typedef TupleTableData *TupleTable;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: dllist.h,v 1.6 1997/09/08 02:36:47 momjian Exp $
+ * $Id: dllist.h,v 1.7 1997/09/08 21:52:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
struct Dlelem *dle_prev; /* previous element */
void *dle_val; /* value of the element */
struct Dllist *dle_list; /* what list this element is in */
-} Dlelem;
+} Dlelem;
typedef struct Dllist
{
Dlelem *dll_head;
Dlelem *dll_tail;
-} Dllist;
+} Dllist;
extern Dllist *DLNewList(void); /* initialize a new list */
extern void DLFreeList(Dllist *); /* free up a list and all the
extern void DLFreeElem(Dlelem *);
extern Dlelem *DLGetHead(Dllist *);
extern Dlelem *DLGetTail(Dllist *);
-extern Dlelem *DLRemTail(Dllist * l);
+extern Dlelem *DLRemTail(Dllist *l);
extern Dlelem *DLGetPred(Dlelem *); /* get predecessor */
extern Dlelem *DLGetSucc(Dlelem *); /* get successor */
extern void DLRemove(Dlelem *); /* removes node from list */
-extern void DLAddHead(Dllist * list, Dlelem * node);
-extern void DLAddTail(Dllist * list, Dlelem * node);
-extern Dlelem *DLRemHead(Dllist * list); /* remove and return the
- * head */
+extern void DLAddHead(Dllist *list, Dlelem *node);
+extern void DLAddTail(Dllist *list, Dlelem *node);
+extern Dlelem *DLRemHead(Dllist *list); /* remove and return the head */
#define DLE_VAL(x) (x->dle_val)
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: fstack.h,v 1.4 1997/09/08 02:36:51 momjian Exp $
+ * $Id: fstack.h,v 1.5 1997/09/08 21:52:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
FixedItem top; /* Top item on the stack or NULL */
Offset offset; /* Offset from struct base to item */
/* this could be signed short int! */
-} FixedStackData;
+} FixedStackData;
typedef FixedStackData *FixedStack;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: hasht.h,v 1.4 1997/09/08 02:36:54 momjian Exp $
+ * $Id: hasht.h,v 1.5 1997/09/08 21:52:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
typedef void (*HashtFunc) ();
-extern void HashTableWalk(HTAB * hashtable, HashtFunc function, int arg);
+extern void HashTableWalk(HTAB *hashtable, HashtFunc function, int arg);
#endif /* HASHT_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: stringinfo.h,v 1.4 1997/09/08 02:36:55 momjian Exp $
+ * $Id: stringinfo.h,v 1.5 1997/09/08 21:52:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
char *data;
int maxlen;
int len;
-} StringInfoData;
+} StringInfoData;
typedef StringInfoData *StringInfo;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: auth.h,v 1.6 1997/09/08 02:36:58 momjian Exp $
+ * $Id: auth.h,v 1.7 1997/09/08 21:52:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define DEFAULT_CLIENT_AUTHSVC "kerberos"
#endif /* KRB4 || KRB5 */
-extern int fe_sendauth(MsgType msgtype, Port * port, char *hostname);
+extern int fe_sendauth(MsgType msgtype, Port *port, char *hostname);
extern void fe_setauthsvc(char *name);
extern MsgType fe_getauthsvc();
extern char *fe_getauthname(void);
-extern int be_recvauth(MsgType msgtype, Port * port, char *username, StartupInfo * sp);
+extern int be_recvauth(MsgType msgtype, Port *port, char *username, StartupInfo *sp);
extern void be_setauthsvc(char *name);
/* the value that matches any dbName value when doing
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: be-fsstubs.h,v 1.4 1997/09/08 02:37:00 momjian Exp $
+ * $Id: be-fsstubs.h,v 1.5 1997/09/08 21:52:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define LOread(f,l) loread(f,l)
#define LOwrite(f,b) lowrite(f,b)
-extern Oid lo_import(text * filename);
-extern int4 lo_export(Oid lobjId, text * filename);
+extern Oid lo_import(text *filename);
+extern int4 lo_export(Oid lobjId, text *filename);
extern Oid lo_creat(int mode);
* Interface to hba.c
*
*
- * $Id: hba.h,v 1.4 1997/09/07 04:58:19 momjian Exp $
+ * $Id: hba.h,v 1.5 1997/09/08 21:52:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
enum Userauth
{
- Trust, Ident, Password
+ Trust, Ident,
+ Password
};
extern int
-hba_recvauth(const Port * port, const char database[], const char user[],
+hba_recvauth(const Port *port, const char database[], const char user[],
const char DataDir[]);
void
find_hba_entry(const char DataDir[], const struct in_addr ip_addr,
const char database[],
- bool * host_ok_p, enum Userauth * userauth_p,
+ bool *host_ok_p, enum Userauth * userauth_p,
char usermap_name[], bool find_password_entries);
#endif
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: libpq-be.h,v 1.6 1997/09/08 02:37:03 momjian Exp $
+ * $Id: libpq-be.h,v 1.7 1997/09/08 21:52:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* in be-dumpdata.c */
extern void be_portalinit(void);
-extern void be_portalpush(PortalEntry * entry);
+extern void be_portalpush(PortalEntry *entry);
extern PortalEntry *be_portalpop(void);
extern PortalEntry *be_currentportal(void);
extern PortalEntry *be_newportal(void);
extern void
-be_typeinit(PortalEntry * entry, TupleDesc attrs,
+be_typeinit(PortalEntry *entry, TupleDesc attrs,
int natts);
extern void be_printtup(HeapTuple tuple, TupleDesc typeinfo);
/* in be-pqexec.c */
extern char *
PQfn(int fnid, int *result_buf, int result_len, int result_is_int,
- PQArgBlock * args, int nargs);
+ PQArgBlock *args, int nargs);
extern char *PQexec(char *query);
extern int pqtest_PQexec(char *q);
extern int pqtest_PQfn(char *q);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: libpq.h,v 1.7 1997/09/08 02:37:08 momjian Exp $
+ * $Id: libpq.h,v 1.8 1997/09/08 21:52:36 momjian Exp $
*
* NOTES
* This file contains definitions for structures and
int *ptr; /* can't use void (dec compiler barfs) */
int integer;
} u;
-} PQArgBlock;
+} PQArgBlock;
/* ----------------
* TypeBlock --
char name[NAMEDATALEN]; /* name of the attribute */
int adtid; /* adtid of the type */
int adtsize; /* adtsize of the type */
-} TypeBlock;
+} TypeBlock;
/* ----------------
* TupleBlock --
* foreach tuple */
struct TupleBlock *next; /* next tuple block */
int tuple_index; /* current tuple index */
-} TupleBlock;
+} TupleBlock;
/* ----------------
* GroupBuffer --
TypeBlock *types; /* types of the attributes */
TupleBlock *tuples; /* tuples in this group */
struct GroupBuffer *next; /* next group */
-} GroupBuffer;
+} GroupBuffer;
/* ----------------
* PortalBuffer --
int no_tuples; /* number of tuples in this portal buffer */
int no_groups; /* number of tuple groups */
GroupBuffer *groups; /* linked list of tuple groups */
-} PortalBuffer;
+} PortalBuffer;
/* ----------------
* PortalEntry --
PortalBuffer *portal; /* tuples contained in this portal */
Pointer portalcxt; /* memory context (for backend) */
Pointer result; /* result for PQexec */
-} PortalEntry;
+} PortalEntry;
#define PORTALS_INITIAL_SIZE 32
#define PORTALS_GROW_BY 32
int be_pid; /* process id of backend */
int valid; /* has this already been handled by user. */
/* SLNode Node; */
-} PQNotifyList;
+} PQNotifyList;
/*
* Exceptions.
extern int PQnportals(int rule_p);
extern void PQpnames(char **pnames, int rule_p);
extern PortalBuffer *PQparray(char *pname);
-extern int PQrulep(PortalBuffer * portal);
-extern int PQntuples(PortalBuffer * portal);
-extern int PQninstances(PortalBuffer * portal);
-extern int PQngroups(PortalBuffer * portal);
-extern int PQntuplesGroup(PortalBuffer * portal, int group_index);
-extern int PQninstancesGroup(PortalBuffer * portal, int group_index);
-extern int PQnfieldsGroup(PortalBuffer * portal, int group_index);
-extern int PQfnumberGroup(PortalBuffer * portal, int group_index, char *field_name);
-extern char *PQfnameGroup(PortalBuffer * portal, int group_index, int field_number);
+extern int PQrulep(PortalBuffer *portal);
+extern int PQntuples(PortalBuffer *portal);
+extern int PQninstances(PortalBuffer *portal);
+extern int PQngroups(PortalBuffer *portal);
+extern int PQntuplesGroup(PortalBuffer *portal, int group_index);
+extern int PQninstancesGroup(PortalBuffer *portal, int group_index);
+extern int PQnfieldsGroup(PortalBuffer *portal, int group_index);
+extern int PQfnumberGroup(PortalBuffer *portal, int group_index, char *field_name);
+extern char *PQfnameGroup(PortalBuffer *portal, int group_index, int field_number);
extern int
-PQftypeGroup(PortalBuffer * portal, int group_index,
+PQftypeGroup(PortalBuffer *portal, int group_index,
int field_number);
extern int
-PQfsizeGroup(PortalBuffer * portal, int group_index,
+PQfsizeGroup(PortalBuffer *portal, int group_index,
int field_number);
-extern GroupBuffer *PQgroup(PortalBuffer * portal, int tuple_index);
-extern int PQgetgroup(PortalBuffer * portal, int tuple_index);
-extern int PQnfields(PortalBuffer * portal, int tuple_index);
-extern int PQfnumber(PortalBuffer * portal, int tuple_index, char *field_name);
-extern char *PQfname(PortalBuffer * portal, int tuple_index, int field_number);
-extern int PQftype(PortalBuffer * portal, int tuple_index, int field_number);
-extern int PQfsize(PortalBuffer * portal, int tuple_index, int field_number);
-extern int PQsametype(PortalBuffer * portal, int tuple_index1, int tuple_index2);
-extern char *PQgetvalue(PortalBuffer * portal, int tuple_index, int field_number);
-extern char *PQgetAttr(PortalBuffer * portal, int tuple_index, int field_number);
-extern int PQgetlength(PortalBuffer * portal, int tuple_index, int field_number);
+extern GroupBuffer *PQgroup(PortalBuffer *portal, int tuple_index);
+extern int PQgetgroup(PortalBuffer *portal, int tuple_index);
+extern int PQnfields(PortalBuffer *portal, int tuple_index);
+extern int PQfnumber(PortalBuffer *portal, int tuple_index, char *field_name);
+extern char *PQfname(PortalBuffer *portal, int tuple_index, int field_number);
+extern int PQftype(PortalBuffer *portal, int tuple_index, int field_number);
+extern int PQfsize(PortalBuffer *portal, int tuple_index, int field_number);
+extern int PQsametype(PortalBuffer *portal, int tuple_index1, int tuple_index2);
+extern char *PQgetvalue(PortalBuffer *portal, int tuple_index, int field_number);
+extern char *PQgetAttr(PortalBuffer *portal, int tuple_index, int field_number);
+extern int PQgetlength(PortalBuffer *portal, int tuple_index, int field_number);
extern void PQclear(char *pname);
extern void PQcleanNotify(void);
extern void PQnotifies_init(void);
extern PQNotifyList *PQnotifies(void);
-extern void PQremoveNotify(PQNotifyList * nPtr);
+extern void PQremoveNotify(PQNotifyList *nPtr);
extern void PQappendNotify(char *relname, int pid);
/*
extern caddr_t pbuf_alloc(size_t size);
extern void pbuf_free(caddr_t pointer);
extern PortalBuffer *pbuf_addPortal(void);
-extern GroupBuffer *pbuf_addGroup(PortalBuffer * portal);
+extern GroupBuffer *pbuf_addGroup(PortalBuffer *portal);
extern TypeBlock *pbuf_addTypes(int n);
extern TupleBlock *pbuf_addTuples(void);
extern char **pbuf_addTuple(int n);
extern char *pbuf_addValues(int n);
extern PortalEntry *pbuf_addEntry(void);
extern void pbuf_freeEntry(int i);
-extern void pbuf_freeTypes(TypeBlock * types);
-extern void pbuf_freeTuples(TupleBlock * tuples, int no_tuples, int no_fields);
-extern void pbuf_freeGroup(GroupBuffer * group);
-extern void pbuf_freePortal(PortalBuffer * portal);
+extern void pbuf_freeTypes(TypeBlock *types);
+extern void pbuf_freeTuples(TupleBlock *tuples, int no_tuples, int no_fields);
+extern void pbuf_freeGroup(GroupBuffer *group);
+extern void pbuf_freePortal(PortalBuffer *portal);
extern int pbuf_getIndex(char *pname);
-extern void pbuf_setportalinfo(PortalEntry * entry, char *pname);
+extern void pbuf_setportalinfo(PortalEntry *entry, char *pname);
extern PortalEntry *pbuf_setup(char *pname);
extern void pbuf_close(char *pname);
-extern GroupBuffer *pbuf_findGroup(PortalBuffer * portal, int group_index);
-extern int pbuf_findFnumber(GroupBuffer * group, char *field_name);
-extern void pbuf_checkFnumber(GroupBuffer * group, int field_number);
-extern char *pbuf_findFname(GroupBuffer * group, int field_number);
+extern GroupBuffer *pbuf_findGroup(PortalBuffer *portal, int group_index);
+extern int pbuf_findFnumber(GroupBuffer *group, char *field_name);
+extern void pbuf_checkFnumber(GroupBuffer *group, int field_number);
+extern char *pbuf_findFname(GroupBuffer *group, int field_number);
/*
* prototypes for functions in pqcomm.c
extern int
pq_connect(char *dbname, char *user, char *args, char *hostName,
char *debugTty, char *execFile, short portName);
-extern int StreamOpen(char *hostName, short portName, Port * port);
+extern int StreamOpen(char *hostName, short portName, Port *port);
extern void pq_regoob(void (*fptr) ());
extern void pq_unregoob(void);
extern void pq_async_notify(void);
extern int StreamServerPort(char *hostName, short portName, int *fdP);
-extern int StreamConnection(int server_fd, Port * port);
+extern int StreamConnection(int server_fd, Port *port);
extern void StreamClose(int sock);
#endif /* LIBPQ_H */
#define PWFILE_NAME_SIZE USERMAP_NAME_SIZE
int
-verify_password(char *user, char *password, Port * port,
+verify_password(char *user, char *password, Port *port,
char *database, char *DataDir);
#endif
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: pqcomm.h,v 1.13 1997/09/08 20:58:26 momjian Exp $
+ * $Id: pqcomm.h,v 1.14 1997/09/08 21:52:38 momjian Exp $
*
* NOTES
* Some of this should move to libpq.h
char options[ARGV_SIZE]; /* possible additional args */
char execFile[ARGV_SIZE]; /* possible backend to use */
char tty[PATH_SIZE]; /* possible tty for debug output */
-} StartupInfo;
+} StartupInfo;
/* amount of available data in a packet buffer */
#define MESSAGE_SIZE sizeof(StartupInfo) + 5 /* why 5? BJM 2/11/97 */
int len;
MsgType msgtype;
char data[MESSAGE_SIZE];
-} PacketBuf;
+} PacketBuf;
/* update the conversion routines
StartupInfo2PacketBuf() and PacketBuf2StartupInfo() (decl. below)
* PacketBufId id;
*//* id of packet buf currently in use */
PacketBuf buf; /* stream implementation (curr pack buf) */
-} Port;
+} Port;
/* invalid socket descriptor */
#define INVALID_SOCK (-1)
/*
* prototypes for functions in pqpacket.c
*/
-extern int PacketReceive(Port * port, PacketBuf * buf, char nonBlocking);
+extern int PacketReceive(Port *port, PacketBuf *buf, char nonBlocking);
extern int
-PacketSend(Port * port, PacketBuf * buf,
+PacketSend(Port *port, PacketBuf *buf,
PacketLen len, char nonBlocking);
/* extern PacketBuf* StartupInfo2PacketBuf(StartupInfo*); */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: miscadmin.h,v 1.13 1997/09/08 02:33:50 momjian Exp $
+ * $Id: miscadmin.h,v 1.14 1997/09/08 21:50:26 momjian Exp $
*
* NOTES
* some of the information in this file will be moved to
BootstrapProcessing, /* bootstrap creation of template database */
InitProcessing, /* initializing system */
NormalProcessing /* normal processing */
-} ProcessingMode;
+} ProcessingMode;
/*****************************************************************************
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: execnodes.h,v 1.11 1997/09/08 20:58:40 momjian Exp $
+ * $Id: execnodes.h,v 1.12 1997/09/08 21:52:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
AttrNumber *ii_KeyAttributeNumbers;
FuncIndexInfoPtr ii_FuncIndexInfo;
Node *ii_Predicate;
-} IndexInfo;
+} IndexInfo;
/* ----------------
* RelationInfo information
int ri_NumIndices;
RelationPtr ri_IndexRelationDescs;
IndexInfo **ri_IndexRelationInfo;
-} RelationInfo;
+} RelationInfo;
/* ----------------
* ExprContext
List *ecxt_range_table;
Datum *ecxt_values; /* precomputed values for aggreg */
char *ecxt_nulls; /* null flags for aggreg values */
-} ExprContext;
+} ExprContext;
/* ----------------
* ProjectionInfo node information
Datum *pi_tupValue;
ExprContext *pi_exprContext;
TupleTableSlot *pi_slot;
-} ProjectionInfo;
+} ProjectionInfo;
/* ----------------
* JunkFilter
int jf_cleanLength;
TupleDesc jf_cleanTupType;
AttrNumber *jf_cleanMap;
-} JunkFilter;
+} JunkFilter;
/* ----------------
* EState information
int *es_refcount;
uint32 es_processed; /* # of tuples processed */
Oid es_lastoid; /* last oid processed (by INSERT) */
-} EState;
+} EState;
/* ----------------
* Executor Type information needed by plannodes.h
ExprContext *cs_ExprContext;
ProjectionInfo *cs_ProjInfo;
bool cs_TupFromTlist;
-} CommonState;
+} CommonState;
/* ----------------------------------------------------------------
{
CommonState cstate; /* its first field is NodeTag */
int rs_done;
-} ResultState;
+} ResultState;
/* ----------------
* AppendState information
Relation css_currentRelation;
HeapScanDesc css_currentScanDesc;
TupleTableSlot *css_ScanTupleSlot;
-} CommonScanState;
+} CommonScanState;
/* ----------------
* IndexScanState information
Pointer iss_RuntimeKeyInfo;
RelationPtr iss_RelationDescs;
IndexScanDescPtr iss_ScanDescs;
-} IndexScanState;
+} IndexScanState;
/* ----------------------------------------------------------------
{
JoinState jstate; /* its first field is NodeTag */
bool nl_PortalFlag;
-} NestLoopState;
+} NestLoopState;
/* ----------------
* MergeJoinState information
List *mj_ISortopO;
int mj_JoinState;
TupleTableSlot *mj_MarkedTupleSlot;
-} MergeJoinState;
+} MergeJoinState;
/* ----------------
* HashJoinState information
int hj_OuterReadBlk;
TupleTableSlot *hj_OuterTupleSlot;
TupleTableSlot *hj_HashTupleSlot;
-} HashJoinState;
+} HashJoinState;
/* ----------------------------------------------------------------
CommonScanState csstate; /* its first field is NodeTag */
bool mat_Flag;
Relation mat_TempRelation;
-} MaterialState;
+} MaterialState;
/* ---------------------
* AggregateState information
bool grp_useLastTuple; /* last tuple not processed yet */
bool grp_done;
TupleTableSlot *grp_lastSlot;
-} GroupState;
+} GroupState;
/* ----------------
* SortState information
bool sort_Flag;
ScanKey sort_Keys;
bool cleaned;
-} SortState;
+} SortState;
/* ----------------
* UniqueState information
{
CommonState cstate; /* its first field is NodeTag */
File *hashBatches;
-} HashState;
+} HashState;
/* -----------------------
* TeeState information
MemoryContext tee_mcxt;
HeapScanDesc tee_leftScanDesc;
HeapScanDesc tee_rightScanDesc;
-} TeeState;
+} TeeState;
#endif /* EXECNODES_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: memnodes.h,v 1.6 1997/09/08 02:37:19 momjian Exp $
+ * $Id: memnodes.h,v 1.7 1997/09/08 21:52:44 momjian Exp $
*
* XXX the typedefs in this file are different from the other ???nodes.h;
* they are pointers to structures instead of the structures themselves.
typedef struct MemoryContextMethodsData
{
- Pointer(*alloc) ();
+ Pointer (*alloc) ();
void (*free_p) (); /* need to use free as a #define, so can't
* use free */
- Pointer(*realloc) ();
+ Pointer (*realloc) ();
char *(*getName) ();
void (*dump) ();
} *MemoryContextMethods;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodeFuncs.h,v 1.4 1997/09/08 02:37:20 momjian Exp $
+ * $Id: nodeFuncs.h,v 1.5 1997/09/08 21:52:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef NODEFUNCS_H
#define NODEFUNCS_H
-extern bool single_node(Node * node);
-extern bool var_is_outer(Var * var);
-extern bool var_is_rel(Var * var);
-extern Oper *replace_opid(Oper * oper);
-extern bool non_null(Expr * c);
+extern bool single_node(Node *node);
+extern bool var_is_outer(Var *var);
+extern bool var_is_rel(Var *var);
+extern Oper *replace_opid(Oper *oper);
+extern bool non_null(Expr *c);
#endif /* NODEFUNCS_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodes.h,v 1.13 1997/09/08 02:37:21 momjian Exp $
+ * $Id: nodes.h,v 1.14 1997/09/08 21:52:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
T_SortClause,
T_GroupClause,
T_SubSelect
-} NodeTag;
+} NodeTag;
/*
* The first field of a node of any type is gauranteed to be the NodeTag.
typedef struct Node
{
NodeTag type;
-} Node;
+} Node;
#define nodeTag(_node_) ((Node*)_node_)->type
CMD_NOTIFY,
CMD_UTILITY /* cmds like create, destroy, copy,
* vacuum, etc. */
-} CmdType;
+} CmdType;
#endif /* NODES_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: params.h,v 1.5 1997/09/08 02:37:22 momjian Exp $
+ * $Id: params.h,v 1.6 1997/09/08 21:52:48 momjian Exp $
*
*-------------------------------------------------------------------------
*/
bool isnull;
bool byval;
Datum value;
-} ParamListInfoData;
+} ParamListInfoData;
typedef ParamListInfoData *ParamListInfo;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: parsenodes.h,v 1.26 1997/09/08 20:58:47 momjian Exp $
+ * $Id: parsenodes.h,v 1.27 1997/09/08 21:52:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
List *join_relation_list_; /* list of relations generated by
* joins */
bool query_is_archival_; /* archival query flag */
-} Query;
+} Query;
/*****************************************************************************
struct AclItem *aclitem;
unsigned modechg;
List *relNames;
-} ChangeACLStmt;
+} ChangeACLStmt;
/* ----------------------
* Close Portal Statement
{
NodeTag type;
char *portalname; /* name of the portal (cursor) */
-} ClosePortalStmt;
+} ClosePortalStmt;
/* ----------------------
* Copy Statement
int direction; /* TO or FROM */
char *filename; /* if NULL, use stdin/stdout */
char *delimiter; /* delimiter character, \t by default */
-} CopyStmt;
+} CopyStmt;
/* ----------------------
* Create Table Statement
int location; /* smgrid (-1 if none) */
int archiveLoc; /* smgrid (-1 if none) */
List *constraints; /* list of constraints (ConstaintDef) */
-} CreateStmt;
+} CreateStmt;
typedef enum ConstrType
{
CONSTR_NONE, CONSTR_CHECK /* type of constaints */
-} ConstrType;
+} ConstrType;
typedef struct ConstraintDef
{
ConstrType type;
char *name; /* name */
void *def; /* definition */
-} ConstraintDef;
+} ConstraintDef;
/* ----------------------
* Create/Drop TRIGGER Statements
char *text; /* AS 'text' */
List *attr; /* UPDATE OF a, b,... (NI) or NULL */
char *when; /* WHEN 'a > 10 ...' (NI) or NULL */
-} CreateTrigStmt;
+} CreateTrigStmt;
typedef struct DropTrigStmt
{
NodeTag type;
char *trigname; /* TRIGGER' name */
char *relname; /* triggered relation */
-} DropTrigStmt;
+} DropTrigStmt;
/* ----------------------
* Create SEQUENCE Statement
NodeTag type;
char *seqname; /* the relation to create */
List *options;
-} CreateSeqStmt;
+} CreateSeqStmt;
/* ----------------------
* Create Version Statement
int direction; /* FORWARD | BACKWARD */
char *fromRelname; /* relation to create a version */
char *date; /* date of the snapshot */
-} VersionStmt;
+} VersionStmt;
/* ----------------------
* Create {Operator|Type|Aggregate} Statement
int defType; /* OPERATOR|P_TYPE|AGGREGATE */
char *defname;
List *definition; /* a list of DefElem */
-} DefineStmt;
+} DefineStmt;
/* ----------------------
* Drop Table Statement
NodeTag type;
List *relNames; /* relations to be dropped */
bool sequence;
-} DestroyStmt;
+} DestroyStmt;
/* ----------------------
* Extend Index Statement
Node *whereClause; /* qualifications */
List *rangetable; /* range table, filled in by
* transformStmt() */
-} ExtendStmt;
+} ExtendStmt;
/* ----------------------
* Begin Recipe Statement
{
NodeTag type;
char *recipeName; /* name of the recipe */
-} RecipeStmt;
+} RecipeStmt;
/* ----------------------
* Fetch Statement
int direction; /* FORWARD or BACKWARD */
int howMany; /* amount to fetch ("ALL" --> 0) */
char *portalname; /* name of portal (cursor) */
-} FetchStmt;
+} FetchStmt;
/* ----------------------
* Create Index Statement
* transformStmt() */
bool *lossy; /* is index lossy? */
bool unique; /* is index unique? */
-} IndexStmt;
+} IndexStmt;
/* ----------------------
* Move Statement (Not implemented)
bool to;
int where;
char *portalname;
-} MoveStmt;
+} MoveStmt;
/* ----------------------
* Create Function Statement
List *withClause; /* a list of ParamString */
char *as; /* the SQL statement or filename */
char *language; /* C or SQL */
-} ProcedureStmt;
+} ProcedureStmt;
/* ----------------------
* Purge Statement
char *relname; /* relation to purge */
char *beforeDate; /* purge before this date */
char *afterDate; /* purge after this date */
-} PurgeStmt;
+} PurgeStmt;
/* ----------------------
* Drop Aggregate Statement
NodeTag type;
char *aggname; /* aggregate to drop */
char *aggtype; /* for this type */
-} RemoveAggrStmt;
+} RemoveAggrStmt;
/* ----------------------
* Drop Function Statement
NodeTag type;
char *funcname; /* function to drop */
List *args; /* types of the arguments */
-} RemoveFuncStmt;
+} RemoveFuncStmt;
/* ----------------------
* Drop Operator Statement
NodeTag type;
char *opname; /* operator to drop */
List *args; /* types of the arguments */
-} RemoveOperStmt;
+} RemoveOperStmt;
/* ----------------------
* Drop {Type|Index|Rule|View} Statement
NodeTag type;
int removeType; /* P_TYPE|INDEX|RULE|VIEW */
char *name; /* name to drop */
-} RemoveStmt;
+} RemoveStmt;
/* ----------------------
* Alter Table Statement
* the new name. Otherwise, rename this
* column name. */
char *newname; /* the new name */
-} RenameStmt;
+} RenameStmt;
/* ----------------------
* Create Rule Statement
struct Attr *object; /* object affected */
bool instead; /* is a 'do instead'? */
List *actions; /* the action statements */
-} RuleStmt;
+} RuleStmt;
/* ----------------------
* Notify Statement
{
NodeTag type;
char *relname; /* relation to notify */
-} NotifyStmt;
+} NotifyStmt;
/* ----------------------
* Listen Statement
{
NodeTag type;
char *relname; /* relation to listen on */
-} ListenStmt;
+} ListenStmt;
/* ----------------------
* {Begin|Abort|End} Transaction Statement
{
NodeTag type;
int command; /* BEGIN|END|ABORT */
-} TransactionStmt;
+} TransactionStmt;
/* ----------------------
* Create View Statement
NodeTag type;
char *viewname; /* name of the view */
Query *query; /* the SQL statement */
-} ViewStmt;
+} ViewStmt;
/* ----------------------
* Load Statement
{
NodeTag type;
char *filename; /* file to load */
-} LoadStmt;
+} LoadStmt;
/* ----------------------
* Createdb Statement
{
NodeTag type;
char *dbname; /* database to create */
-} CreatedbStmt;
+} CreatedbStmt;
/* ----------------------
* Destroydb Statement
{
NodeTag type;
char *dbname; /* database to drop */
-} DestroydbStmt;
+} DestroydbStmt;
/* ----------------------
* Cluster Statement (support pbrown's cluster index implementation)
NodeTag type;
char *relname; /* relation being indexed */
char *indexname; /* original index defined */
-} ClusterStmt;
+} ClusterStmt;
/* ----------------------
* Vacuum Statement
bool analyze; /* analyze data */
char *vacrel; /* table to vacuum */
List *va_spec; /* columns to analyse */
-} VacuumStmt;
+} VacuumStmt;
/* ----------------------
* Explain Statement
NodeTag type;
Query *query; /* the query */
bool verbose; /* print plan info */
-} ExplainStmt;
+} ExplainStmt;
/* ----------------------
* Set Statement
NodeTag type;
char *name;
char *value;
-} VariableSetStmt;
+} VariableSetStmt;
/* ----------------------
* Show Statement
{
NodeTag type;
char *name;
-} VariableShowStmt;
+} VariableShowStmt;
/* ----------------------
* Reset Statement
{
NodeTag type;
char *name;
-} VariableResetStmt;
+} VariableResetStmt;
/*****************************************************************************
NodeTag type;
char *relname; /* relation to delete from */
Node *whereClause; /* qualifications */
-} DeleteStmt;
+} DeleteStmt;
/* ----------------------
* Update Statement
List *targetList; /* the target list (of ResTarget) */
Node *whereClause; /* qualifications */
List *fromClause; /* the from clause */
-} ReplaceStmt;
+} ReplaceStmt;
/* ----------------------
* Create Cursor Statement
Node *whereClause; /* qualifications */
List *groupClause; /* group by clause */
List *sortClause; /* sort clause (a list of SortGroupBy's) */
-} CursorStmt;
+} CursorStmt;
/* ----------------------
* Select Statement
Node *havingClause; /* having conditional-expression */
List *selectClause; /* subselect parameters */
List *sortClause; /* sort clause (a list of SortGroupBy's) */
-} RetrieveStmt;
+} RetrieveStmt;
/****************************************************************************
Node *whereClause; /* qualifications */
List *groupClause; /* group by clause */
Node *havingClause; /* having conditional-expression */
-} SubSelect;
+} SubSelect;
/*
* TypeName - specifies a type in definitions
bool setof; /* is a set? */
List *arrayBounds; /* array bounds */
int typlen; /* length for char() and varchar() */
-} TypeName;
+} TypeName;
/*
* ParamNo - specifies a parameter reference
NodeTag type;
int number; /* the number of the parameter */
TypeName *typename; /* the typecast */
-} ParamNo;
+} ParamNo;
/*
* A_Expr - binary expressions
TypeName *typename; /* type of column */
bool is_not_null; /* flag to NOT NULL constraint */
char *defval; /* default value of column */
-} ColumnDef;
+} ColumnDef;
/*
* Ident -
List *indirection; /* array references */
bool isRel; /* is a relation - filled in by
* transformExpr() */
-} Ident;
+} Ident;
/*
* FuncCall - a function/aggregate invocation
NodeTag type;
char *funcname; /* name of function */
List *args; /* the arguments (list of exprs) */
-} FuncCall;
+} FuncCall;
/*
* A_Indices - array reference or bounds ([lidx:uidx] or [uidx])
List *indirection; /* array references */
Node *val; /* the value of the result (A_Expr or
* Attr) (or A_Const) */
-} ResTarget;
+} ResTarget;
/*
* ParamString - used in with clauses
NodeTag type;
char *name;
char *val;
-} ParamString;
+} ParamString;
/*
* TimeRange - specifies a time range
NodeTag type;
char *startDate;
char *endDate; /* snapshot if NULL */
-} TimeRange;
+} TimeRange;
/*
* RelExpr - relation expressions
char *relname; /* the relation name */
bool inh; /* inheritance query */
TimeRange *timeRange; /* the time range */
-} RelExpr;
+} RelExpr;
/*
* SortGroupBy - for order by clause
char *range;
char *name; /* name of column to sort on */
char *useOp; /* operator to use */
-} SortGroupBy;
+} SortGroupBy;
/*
* RangeVar - range variable, used in from clauses
NodeTag type;
RelExpr *relExpr; /* the relation expression */
char *name; /* the name to be referenced (optional) */
-} RangeVar;
+} RangeVar;
/*
* IndexElem - index parameters (used in create index)
List *args; /* if not NULL, function index */
char *class;
TypeName *tname; /* type of index's keys (optional) */
-} IndexElem;
+} IndexElem;
/*
* DefElem -
NodeTag type;
char *defname;
Node *arg; /* a (Value *) or a (TypeName *) */
-} DefElem;
+} DefElem;
/****************************************************************************
Resdom *resdom; /* fjoin overload this to be a list?? */
Fjoin *fjoin;
Node *expr; /* can be a list too */
-} TargetEntry;
+} TargetEntry;
/*
* RangeTblEntry -
bool archive; /* filled in by plan_archive */
bool inFromCl; /* comes from From Clause */
TimeQual timeQual; /* filled in by pg_plan */
-} RangeTblEntry;
+} RangeTblEntry;
/*
* SortClause -
NodeTag type;
Resdom *resdom; /* attributes in tlist to be sorted */
Oid opoid; /* sort operators */
-} SortClause;
+} SortClause;
/*
* GroupClause -
NodeTag type;
TargetEntry *entry; /* attributes to group on */
Oid grpOpoid; /* the sort operator to use */
-} GroupClause;
+} GroupClause;
#endif /* PARSENODES_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_list.h,v 1.7 1997/09/08 02:37:24 momjian Exp $
+ * $Id: pg_list.h,v 1.8 1997/09/08 21:52:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
long ival;
double dval;
} val;
-} Value;
+} Value;
#define intVal(v) (((Value *)v)->val.ival)
#define floatVal(v) (((Value *)v)->val.dval)
int int_value;
} elem;
struct List *next;
-} List;
+} List;
#define NIL ((List *) NULL)
/*
* function prototypes in nodes/list.c
*/
-extern int length(List * list);
-extern List *append(List * list1, List * list2);
-extern List *nconc(List * list1, List * list2);
-extern List *lcons(void *datum, List * list);
-extern bool member(void *foo, List * bar);
+extern int length(List *list);
+extern List *append(List *list1, List *list2);
+extern List *nconc(List *list1, List *list2);
+extern List *lcons(void *datum, List *list);
+extern bool member(void *foo, List *bar);
extern Value *makeInteger(long i);
extern Value *makeFloat(double d);
extern Value *makeString(char *str);
extern List *makeList(void *elem,...);
-extern List *lappend(List * list, void *obj);
-extern List *lremove(void *elem, List * list);
-extern void freeList(List * list);
-extern List *LispRemove(void *elem, List * list);
+extern List *lappend(List *list, void *obj);
+extern List *lremove(void *elem, List *list);
+extern void freeList(List *list);
+extern List *LispRemove(void *elem, List *list);
-extern void *nth(int n, List * l);
-extern void set_nth(List * l, int n, void *elem);
+extern void *nth(int n, List *l);
+extern void set_nth(List *l, int n, void *elem);
-List *lconsi(int datum, List * list);
-List *lappendi(List * list, int datum);
+List *lconsi(int datum, List *list);
+List *lappendi(List *list, int datum);
extern bool intMember(int, List *);
-extern List *intAppend(List * list1, List * list2);
+extern List *intAppend(List *list1, List *list2);
-extern int nthi(int n, List * l);
+extern int nthi(int n, List *l);
extern List *nreverse(List *);
extern List *set_difference(List *, List *);
extern List *set_differencei(List *, List *);
-extern List *LispUnion(List * foo, List * bar);
-extern List *LispUnioni(List * foo, List * bar);
-extern bool same(List * foo, List * bar);
+extern List *LispUnion(List *foo, List *bar);
+extern List *LispUnioni(List *foo, List *bar);
+extern bool same(List *foo, List *bar);
/* should be in nodes.h but needs List */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: plannodes.h,v 1.9 1997/09/08 20:58:48 momjian Exp $
+ * $Id: plannodes.h,v 1.10 1997/09/08 21:52:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
List *qual; /* Node* or List* ?? */
struct Plan *lefttree;
struct Plan *righttree;
-} Plan;
+} Plan;
/* ----------------
* these are are defined to avoid confusion problems with "left"
Plan plan;
Node *resconstantqual;
ResultState *resstate;
-} Result;
+} Result;
/* ----------------
* append node
Plan plan;
Index scanrelid; /* relid is index into the range table */
CommonScanState *scanstate;
-} Scan;
+} Scan;
/* ----------------
* sequential scan node
List *indxid;
List *indxqual;
IndexScanState *indxstate;
-} IndexScan;
+} IndexScan;
/*
* ==========
{
Join join;
NestLoopState *nlstate;
-} NestLoop;
+} NestLoop;
/* ----------------
* merge join node
Oid *mergerightorder;/* inner sort operator */
Oid *mergeleftorder; /* outer sort operator */
MergeJoinState *mergestate;
-} MergeJoin;
+} MergeJoin;
/* ----------------
* hash join (probe) node
IpcMemoryKey hashjointablekey;
int hashjointablesize;
bool hashdone;
-} HashJoin;
+} HashJoin;
/* ---------------
* aggregate node
int numCols; /* number of group columns */
AttrNumber *grpColIdx; /* index into the target list */
GroupState *grpstate;
-} Group;
+} Group;
/*
* ==========
Plan plan;
Oid tempid;
int keycount;
-} Temp;
+} Temp;
/* ----------------
* materialization node
Oid tempid;
int keycount;
MaterialState *matstate;
-} Material;
+} Material;
/* ----------------
* sort node
SortState *sortstate;
void *psortstate;
bool cleaned;
-} Sort;
+} Sort;
/* ----------------
* unique node
AttrNumber uniqueAttrNum; /* attribute number of attribute to select
* distinct on */
UniqueState *uniquestate;
-} Unique;
+} Unique;
/* ----------------
* hash build node
HashJoinTable hashtable;
IpcMemoryKey hashtablekey;
int hashtablesize;
-} Hash;
+} Hash;
/* ---------------------
* choose node
{
Plan plan;
List *chooseplanlist;
-} Choose;
+} Choose;
/* -------------------
* Tee node information
List *rtentries; /* the range table for the plan below the
* Tee may be different than the parent
* plans */
-} Tee;
+} Tee;
#endif /* PLANNODES_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: primnodes.h,v 1.10 1997/09/08 20:58:50 momjian Exp $
+ * $Id: primnodes.h,v 1.11 1997/09/08 21:52:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
Index reskey;
Oid reskeyop;
int resjunk;
-} Resdom;
+} Resdom;
/* -------------
* Fjoin
List *fj_innerNode;
DatumPtr fj_results;
BoolPtr fj_alwaysDone;
-} Fjoin;
+} Fjoin;
/* ----------------
* Expr
typedef enum OpType
{
OP_EXPR, FUNC_EXPR, OR_EXPR, AND_EXPR, NOT_EXPR
-} OpType;
+} OpType;
typedef struct Expr
{
OpType opType; /* type of the op */
Node *oper; /* could be Oper or Func */
List *args; /* list of argument nodes */
-} Expr;
+} Expr;
/* ----------------
* Var
Oid vartype;
Index varnoold; /* only used by optimizer */
AttrNumber varoattno; /* only used by optimizer */
-} Var;
+} Var;
/* ----------------
* Oper
Oid opresulttype;
int opsize;
FunctionCachePtr op_fcache;
-} Oper;
+} Oper;
/* ----------------
bool constbyval;
bool constisset;
bool constiscast;
-} Const;
+} Const;
/* ----------------
* Param
char *paramname;
Oid paramtype;
List *param_tlist;
-} Param;
+} Param;
/* ----------------
FunctionCachePtr func_fcache;
List *func_tlist;
List *func_planlist;
-} Func;
+} Func;
/* ----------------
* Aggreg
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: print.h,v 1.4 1997/09/08 02:37:28 momjian Exp $
+ * $Id: print.h,v 1.5 1997/09/08 21:52:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern void print(void *obj);
extern void pprint(void *obj);
-extern void print_rt(List * rtable);
-extern void print_expr(Node * expr, List * rtable);
-extern void print_keys(List * keys, List * rtable);
-extern void print_tl(List * tlist, List * rtable);
-extern void print_slot(TupleTableSlot * slot);
+extern void print_rt(List *rtable);
+extern void print_expr(Node *expr, List *rtable);
+extern void print_keys(List *keys, List *rtable);
+extern void print_tl(List *tlist, List *rtable);
+extern void print_slot(TupleTableSlot *slot);
extern void
-print_plan_recursive(Plan * p, Query * parsetree,
+print_plan_recursive(Plan *p, Query *parsetree,
int indentLevel, char *label);
-extern void print_plan(Plan * p, Query * parsetree);
+extern void print_plan(Plan *p, Query *parsetree);
#endif /* PRINT_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: relation.h,v 1.6 1997/09/08 02:37:29 momjian Exp $
+ * $Id: relation.h,v 1.7 1997/09/08 21:53:01 momjian Exp $
*
*-------------------------------------------------------------------------
*/
List *joininfo; /* join clauses */
List *innerjoin;
List *superrels;
-} Rel;
+} Rel;
-extern Var *get_expr(TargetEntry * foo);
+extern Var *get_expr(TargetEntry *foo);
typedef struct MergeOrder
{
Oid right_operator;
Oid left_type;
Oid right_type;
-} MergeOrder;
+} MergeOrder;
typedef enum OrderType
{
MERGE_ORDER, SORTOP_ORDER
-} OrderType;
+} OrderType;
typedef struct PathOrder
{
Oid *sortop;
MergeOrder *merge;
} ord;
-} PathOrder;
+} PathOrder;
typedef struct Path
{
Cost outerjoincost;
Relid joinid;
List *locclauseinfo;
-} Path;
+} Path;
typedef struct IndexPath
{
List *indexqual;
int *indexkeys; /* to transform heap attnos into index
* ones */
-} IndexPath;
+} IndexPath;
typedef struct JoinPath
{
List *pathclauseinfo;
Path *outerjoinpath;
Path *innerjoinpath;
-} JoinPath;
+} JoinPath;
typedef struct MergePath
{
List *path_mergeclauses;
List *outersortkeys;
List *innersortkeys;
-} MergePath;
+} MergePath;
typedef struct HashPath
{
List *path_hashclauses;
List *outerhashkeys;
List *innerhashkeys;
-} HashPath;
+} HashPath;
/******
* Keys
NodeTag type;
int attribute_number;
Index array_index;
-} OrderKey;
+} OrderKey;
typedef struct JoinKey
{
NodeTag type;
Var *outer;
Var *inner;
-} JoinKey;
+} JoinKey;
/*******
* clause info
/* hashjoin only */
Oid hashjoinoperator;
Relid cinfojoinid;
-} CInfo;
+} CInfo;
typedef struct JoinMethod
{
NodeTag type;
List *jmkeys;
List *clauses;
-} JoinMethod;
+} JoinMethod;
typedef struct HInfo
{
JoinMethod jmethod;
Oid hashop;
-} HInfo;
+} HInfo;
typedef struct MInfo
{
JoinMethod jmethod;
MergeOrder *m_ordering;
-} MInfo;
+} MInfo;
typedef struct JInfo
{
bool mergesortable;
bool hashjoinable;
bool inactive;
-} JInfo;
+} JInfo;
typedef struct Iter
{
Node *iterexpr;
Oid itertype; /* type of the iter expr (use for type
* checking) */
-} Iter;
+} Iter;
/*
** Stream:
bool groupup;
Cost groupcost;
Cost groupsel;
-} Stream;
+} Stream;
#endif /* RELATION_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: clauseinfo.h,v 1.3 1997/09/08 02:37:32 momjian Exp $
+ * $Id: clauseinfo.h,v 1.4 1997/09/08 21:53:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef CLAUSEINFO_H
#define CLAUSEINFO_H
-extern bool valid_or_clause(CInfo * clauseinfo);
-extern List *get_actual_clauses(List * clauseinfo_list);
+extern bool valid_or_clause(CInfo *clauseinfo);
+extern List *get_actual_clauses(List *clauseinfo_list);
extern void
-get_relattvals(List * clauseinfo_list, List ** attnos,
- List ** values, List ** flags);
+get_relattvals(List *clauseinfo_list, List **attnos,
+ List **values, List **flags);
extern void
-get_joinvars(Oid relid, List * clauseinfo_list,
- List ** attnos, List ** values, List ** flags);
-extern List *get_opnos(List * clauseinfo_list);
+get_joinvars(Oid relid, List *clauseinfo_list,
+ List **attnos, List **values, List **flags);
+extern List *get_opnos(List *clauseinfo_list);
#endif /* CLAUSEINFO_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: clauses.h,v 1.6 1997/09/08 20:58:54 momjian Exp $
+ * $Id: clauses.h,v 1.7 1997/09/08 21:53:06 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include <nodes/primnodes.h>
-extern Expr *make_clause(int type, Node * oper, List * args);
-extern bool is_opclause(Node * clause);
-extern Expr *make_opclause(Oper * op, Var * leftop, Var * rightop);
-extern Var *get_leftop(Expr * clause);
-extern Var *get_rightop(Expr * clause);
-
-extern bool is_funcclause(Node * clause);
-extern Expr *make_funcclause(Func * func, List * funcargs);
-
-extern bool or_clause(Node * clause);
-extern Expr *make_orclause(List * orclauses);
-
-extern bool not_clause(Node * clause);
-extern Expr *make_notclause(Expr * notclause);
-extern Expr *get_notclausearg(Expr * notclause);
-
-extern bool and_clause(Node * clause);
-extern Expr *make_andclause(List * andclauses);
-
-extern List *pull_constant_clauses(List * quals, List ** constantQual);
-extern void clause_relids_vars(Node * clause, List ** relids, List ** vars);
-extern int NumRelids(Node * clause);
-extern bool contains_not(Node * clause);
-extern bool join_clause_p(Node * clause);
-extern bool qual_clause_p(Node * clause);
-extern void fix_opid(Node * clause);
-extern List *fix_opids(List * clauses);
+extern Expr *make_clause(int type, Node *oper, List *args);
+extern bool is_opclause(Node *clause);
+extern Expr *make_opclause(Oper *op, Var *leftop, Var *rightop);
+extern Var *get_leftop(Expr *clause);
+extern Var *get_rightop(Expr *clause);
+
+extern bool is_funcclause(Node *clause);
+extern Expr *make_funcclause(Func *func, List *funcargs);
+
+extern bool or_clause(Node *clause);
+extern Expr *make_orclause(List *orclauses);
+
+extern bool not_clause(Node *clause);
+extern Expr *make_notclause(Expr *notclause);
+extern Expr *get_notclausearg(Expr *notclause);
+
+extern bool and_clause(Node *clause);
+extern Expr *make_andclause(List *andclauses);
+
+extern List *pull_constant_clauses(List *quals, List **constantQual);
+extern void clause_relids_vars(Node *clause, List **relids, List **vars);
+extern int NumRelids(Node *clause);
+extern bool contains_not(Node *clause);
+extern bool join_clause_p(Node *clause);
+extern bool qual_clause_p(Node *clause);
+extern void fix_opid(Node *clause);
+extern List *fix_opids(List *clauses);
extern void
-get_relattval(Node * clause, int *relid,
- AttrNumber *attno, Datum * constval, int *flag);
+get_relattval(Node *clause, int *relid,
+ AttrNumber *attno, Datum *constval, int *flag);
extern void
-get_rels_atts(Node * clause, int *relid1,
+get_rels_atts(Node *clause, int *relid1,
AttrNumber *attno1, int *relid2, AttrNumber *attno2);
-extern void CommuteClause(Node * clause);
+extern void CommuteClause(Node *clause);
#endif /* CLAUSES_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: cost.h,v 1.4 1997/09/08 02:37:40 momjian Exp $
+ * $Id: cost.h,v 1.5 1997/09/08 21:53:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern bool _enable_hashjoin_;
extern Cost cost_seqscan(int relid, int relpages, int reltuples);
-extern Cost
+extern Cost
cost_index(Oid indexid, int expected_indexpages, Cost selec,
int relpages, int reltuples, int indexpages,
int indextuples, bool is_injoin);
-extern Cost cost_sort(List * keys, int tuples, int width, bool noread);
-extern Cost
+extern Cost cost_sort(List *keys, int tuples, int width, bool noread);
+extern Cost
cost_nestloop(Cost outercost, Cost innercost, int outertuples,
int innertuples, int outerpages, bool is_indexjoin);
-extern Cost
+extern Cost
cost_mergesort(Cost outercost, Cost innercost,
- List * outersortkeys, List * innersortkeys,
+ List *outersortkeys, List *innersortkeys,
int outersize, int innersize, int outerwidth, int innerwidth);
-extern Cost
-cost_hashjoin(Cost outercost, Cost innercost, List * outerkeys,
- List * innerkeys, int outersize, int innersize,
+extern Cost
+cost_hashjoin(Cost outercost, Cost innercost, List *outerkeys,
+ List *innerkeys, int outersize, int innersize,
int outerwidth, int innerwidth);
-extern int compute_rel_size(Rel * rel);
-extern int compute_rel_width(Rel * rel);
-extern int compute_joinrel_size(JoinPath * joinpath);
+extern int compute_rel_size(Rel *rel);
+extern int compute_rel_width(Rel *rel);
+extern int compute_joinrel_size(JoinPath *joinpath);
extern int page_size(int tuples, int width);
/*
* prototypes for fuctions in clausesel.h--
* routines to compute clause selectivities
*/
-extern void set_clause_selectivities(List * clauseinfo_list, Cost new_selectivity);
-extern Cost product_selec(List * clauseinfo_list);
-extern void set_rest_relselec(Query * root, List * rel_list);
-extern void set_rest_selec(Query * root, List * clauseinfo_list);
-extern Cost
-compute_clause_selec(Query * root,
- Node * clause, List * or_selectivities);
+extern void set_clause_selectivities(List *clauseinfo_list, Cost new_selectivity);
+extern Cost product_selec(List *clauseinfo_list);
+extern void set_rest_relselec(Query *root, List *rel_list);
+extern void set_rest_selec(Query *root, List *clauseinfo_list);
+extern Cost
+compute_clause_selec(Query *root,
+ Node *clause, List *or_selectivities);
#endif /* COST_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo.h,v 1.5 1997/09/08 02:37:42 momjian Exp $
+ * $Id: geqo.h,v 1.6 1997/09/08 21:53:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* ^^^ */
/* geqo prototypes */
-extern Rel *geqo(Query * root);
+extern Rel *geqo(Query *root);
extern void geqo_params(int string_length);
-extern Cost geqo_eval(Query * root, Gene * tour, int num_gene);
+extern Cost geqo_eval(Query *root, Gene *tour, int num_gene);
double geqo_log(double x, double b);
-extern Rel *gimme_tree(Query * root, Gene * tour, int rel_count, int num_gene, Rel * outer_rel);
+extern Rel *gimme_tree(Query *root, Gene *tour, int rel_count, int num_gene, Rel *outer_rel);
#endif /* GEQO_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_copy.h,v 1.3 1997/09/08 02:37:43 momjian Exp $
+ * $Id: geqo_copy.h,v 1.4 1997/09/08 21:53:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define GEQO_COPY_H
-extern void geqo_copy(Chromosome * chromo1, Chromosome * chromo2, int string_length);
+extern void geqo_copy(Chromosome *chromo1, Chromosome *chromo2, int string_length);
#endif /* GEQO_COPY_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_gene.h,v 1.3 1997/09/08 02:37:44 momjian Exp $
+ * $Id: geqo_gene.h,v 1.4 1997/09/08 21:53:11 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* we presume that int instead of Relid
is o.k. for Gene; so don't change it! */
typedef
-int Gene;
+int Gene;
typedef struct Chromosome
{
Gene *string;
Cost worth;
-} Chromosome;
+} Chromosome;
typedef struct Pool
{
Chromosome *data;
int size;
int string_length;
-} Pool;
+} Pool;
#endif /* GEQO_GENE_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_misc.h,v 1.3 1997/09/08 02:37:46 momjian Exp $
+ * $Id: geqo_misc.h,v 1.4 1997/09/08 21:53:13 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include <stdio.h>
-extern void print_pool(FILE * fp, Pool * pool, int start, int stop);
-extern void print_gen(FILE * fp, Pool * pool, int generation);
-extern void print_edge_table(FILE * fp, Edge * edge_table, int num_gene);
+extern void print_pool(FILE *fp, Pool *pool, int start, int stop);
+extern void print_gen(FILE *fp, Pool *pool, int generation);
+extern void print_edge_table(FILE *fp, Edge *edge_table, int num_gene);
-extern void geqo_print_rel(Query * root, Rel * rel);
-extern void geqo_print_path(Query * root, Path * path, int indent);
-extern void geqo_print_joinclauses(Query * root, List * clauses);
+extern void geqo_print_rel(Query *root, Rel *rel);
+extern void geqo_print_path(Query *root, Path *path, int indent);
+extern void geqo_print_joinclauses(Query *root, List *clauses);
#endif /* GEQO_MISC_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_mutation.h,v 1.3 1997/09/08 02:37:46 momjian Exp $
+ * $Id: geqo_mutation.h,v 1.4 1997/09/08 21:53:13 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define GEQO_MUTATION_H
-extern void geqo_mutation(Gene * tour, int num_gene);
+extern void geqo_mutation(Gene *tour, int num_gene);
#endif /* GEQO_MUTATION_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_paths.h,v 1.3 1997/09/08 02:37:47 momjian Exp $
+ * $Id: geqo_paths.h,v 1.4 1997/09/08 21:53:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define GEQO_PATHS_H
-extern List *geqo_prune_rels(List * rel_list);
-extern void geqo_rel_paths(Rel * rel);
+extern List *geqo_prune_rels(List *rel_list);
+extern void geqo_rel_paths(Rel *rel);
#endif /* GEQO_PATHS_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_pool.h,v 1.3 1997/09/08 02:37:47 momjian Exp $
+ * $Id: geqo_pool.h,v 1.4 1997/09/08 21:53:15 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern Pool *alloc_pool(int pool_size, int string_length);
-extern void free_pool(Pool * pool);
+extern void free_pool(Pool *pool);
-extern void random_init_pool(Query * root, Pool * pool, int strt, int stop);
+extern void random_init_pool(Query *root, Pool *pool, int strt, int stop);
extern Chromosome *alloc_chromo(int string_length);
-extern void free_chromo(Chromosome * chromo);
+extern void free_chromo(Chromosome *chromo);
-extern void spread_chromo(Chromosome * chromo, Pool * pool);
+extern void spread_chromo(Chromosome *chromo, Pool *pool);
-extern void sort_pool(Pool * pool);
+extern void sort_pool(Pool *pool);
#endif /* GEQO_POOL_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_recombination.h,v 1.3 1997/09/08 02:37:48 momjian Exp $
+ * $Id: geqo_recombination.h,v 1.4 1997/09/08 21:53:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define GEQO_RECOMBINATION_H
-extern void init_tour(Gene * tour, int num_gene);
+extern void init_tour(Gene *tour, int num_gene);
/* edge recombination crossover [ERX] */
Gene edge_list[4]; /* list of edges */
int total_edges;
int unused_edges;
-} Edge;
+} Edge;
extern Edge *alloc_edge_table(int num_gene);
-extern void free_edge_table(Edge * edge_table);
+extern void free_edge_table(Edge *edge_table);
-extern float gimme_edge_table(Gene * tour1, Gene * tour2, int num_gene, Edge * edge_table);
+extern float gimme_edge_table(Gene *tour1, Gene *tour2, int num_gene, Edge *edge_table);
-extern int gimme_tour(Edge * edge_table, Gene * new_gene, int num_gene);
+extern int gimme_tour(Edge *edge_table, Gene *new_gene, int num_gene);
/* partially matched crossover [PMX] */
#define DAD 1 /* indicator for gene from dad */
#define MOM 0 /* indicator for gene from mom */
-extern void pmx(Gene * tour1, Gene * tour2, Gene * offspring, int num_gene);
+extern void pmx(Gene *tour1, Gene *tour2, Gene *offspring, int num_gene);
typedef struct City
int tour1_position;
int used;
int select_list;
-} City;
+} City;
extern City *alloc_city_table(int num_gene);
-extern void free_city_table(City * city_table);
+extern void free_city_table(City *city_table);
/* cycle crossover [CX] */
-extern int cx(Gene * tour1, Gene * tour2, Gene * offspring, int num_gene, City * city_table);
+extern int cx(Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, City *city_table);
/* position crossover [PX] */
-extern void px(Gene * tour1, Gene * tour2, Gene * offspring, int num_gene, City * city_table);
+extern void px(Gene *tour1, Gene *tour2, Gene *offspring, int num_gene, City *city_table);
/* order crossover [OX1] according to Davis */
-extern void ox1(Gene * mom, Gene * dad, Gene * offspring, int num_gene, City * city_table);
+extern void ox1(Gene *mom, Gene *dad, Gene *offspring, int num_gene, City *city_table);
/* order crossover [OX2] according to Syswerda */
-extern void ox2(Gene * mom, Gene * dad, Gene * offspring, int num_gene, City * city_table);
+extern void ox2(Gene *mom, Gene *dad, Gene *offspring, int num_gene, City *city_table);
#endif /* GEQO_RECOMBINATION_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geqo_selection.h,v 1.3 1997/09/08 02:37:49 momjian Exp $
+ * $Id: geqo_selection.h,v 1.4 1997/09/08 21:53:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define GEQO_SELECTION_H
-extern void geqo_selection(Chromosome * momma, Chromosome * daddy, Pool * pool, double bias);
+extern void geqo_selection(Chromosome *momma, Chromosome *daddy, Pool *pool, double bias);
#endif /* GEQO_SELECTION_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: joininfo.h,v 1.3 1997/09/08 02:37:50 momjian Exp $
+ * $Id: joininfo.h,v 1.4 1997/09/08 21:53:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef JOININFO_H
#define JOININFO_H
-extern JInfo *joininfo_member(List * join_relids, List * joininfo_list);
-extern JInfo *find_joininfo_node(Rel * this_rel, List * join_relids);
-extern Var *other_join_clause_var(Var * var, Expr * clause);
+extern JInfo *joininfo_member(List *join_relids, List *joininfo_list);
+extern JInfo *find_joininfo_node(Rel *this_rel, List *join_relids);
+extern Var *other_join_clause_var(Var *var, Expr *clause);
#endif /* JOININFO_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: keys.h,v 1.4 1997/09/08 02:37:51 momjian Exp $
+ * $Id: keys.h,v 1.5 1997/09/08 21:53:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef KEYS_H
#define KEYS_H
-extern bool match_indexkey_operand(int indexkey, Var * operand, Rel * rel);
-extern Var *extract_subkey(JoinKey * jk, int which_subkey);
-extern bool samekeys(List * keys1, List * keys2);
-extern List *collect_index_pathkeys(int *index_keys, List * tlist);
+extern bool match_indexkey_operand(int indexkey, Var *operand, Rel *rel);
+extern Var *extract_subkey(JoinKey *jk, int which_subkey);
+extern bool samekeys(List *keys1, List *keys2);
+extern List *collect_index_pathkeys(int *index_keys, List *tlist);
#endif /* KEYS_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: ordering.h,v 1.5 1997/09/08 02:37:52 momjian Exp $
+ * $Id: ordering.h,v 1.6 1997/09/08 21:53:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include <nodes/relation.h>
-extern bool
-equal_path_path_ordering(PathOrder * path_ordering1,
- PathOrder * path_ordering2);
-extern bool
-equal_path_merge_ordering(Oid * path_ordering,
- MergeOrder * merge_ordering);
-extern bool
-equal_merge_merge_ordering(MergeOrder * merge_ordering1,
- MergeOrder * merge_ordering2);
+extern bool
+equal_path_path_ordering(PathOrder *path_ordering1,
+ PathOrder *path_ordering2);
+extern bool
+equal_path_merge_ordering(Oid *path_ordering,
+ MergeOrder *merge_ordering);
+extern bool
+equal_merge_merge_ordering(MergeOrder *merge_ordering1,
+ MergeOrder *merge_ordering2);
#endif /* ORDERING_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: pathnode.h,v 1.3 1997/09/08 02:37:52 momjian Exp $
+ * $Id: pathnode.h,v 1.4 1997/09/08 21:53:23 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/*
* prototypes for pathnode.c
*/
-extern bool path_is_cheaper(Path * path1, Path * path2);
-extern Path *set_cheapest(Rel * parent_rel, List * pathlist);
+extern bool path_is_cheaper(Path *path1, Path *path2);
+extern Path *set_cheapest(Rel *parent_rel, List *pathlist);
extern List *
-add_pathlist(Rel * parent_rel, List * unique_paths,
- List * new_paths);
-extern Path *create_seqscan_path(Rel * rel);
+add_pathlist(Rel *parent_rel, List *unique_paths,
+ List *new_paths);
+extern Path *create_seqscan_path(Rel *rel);
extern IndexPath *
-create_index_path(Query * root, Rel * rel, Rel * index,
- List * restriction_clauses, bool is_join_scan);
+create_index_path(Query *root, Rel *rel, Rel *index,
+ List *restriction_clauses, bool is_join_scan);
extern JoinPath *
-create_nestloop_path(Rel * joinrel, Rel * outer_rel,
- Path * outer_path, Path * inner_path, List * keys);
+create_nestloop_path(Rel *joinrel, Rel *outer_rel,
+ Path *outer_path, Path *inner_path, List *keys);
extern MergePath *
-create_mergesort_path(Rel * joinrel, int outersize,
- int innersize, int outerwidth, int innerwidth, Path * outer_path,
- Path * inner_path, List * keys, MergeOrder * order,
- List * mergeclauses, List * outersortkeys, List * innersortkeys);
+create_mergesort_path(Rel *joinrel, int outersize,
+ int innersize, int outerwidth, int innerwidth, Path *outer_path,
+ Path *inner_path, List *keys, MergeOrder *order,
+ List *mergeclauses, List *outersortkeys, List *innersortkeys);
extern HashPath *
-create_hashjoin_path(Rel * joinrel, int outersize,
- int innersize, int outerwidth, int innerwidth, Path * outer_path,
- Path * inner_path, List * keys, Oid operator, List * hashclauses,
- List * outerkeys, List * innerkeys);
+create_hashjoin_path(Rel *joinrel, int outersize,
+ int innersize, int outerwidth, int innerwidth, Path *outer_path,
+ Path *inner_path, List *keys, Oid operator, List *hashclauses,
+ List *outerkeys, List *innerkeys);
/*
* prototypes for rel.c
*/
-extern Rel *rel_member(List * relid, List * rels);
-extern Rel *get_base_rel(Query * root, int relid);
-extern Rel *get_join_rel(Query * root, List * relid);
+extern Rel *rel_member(List *relid, List *rels);
+extern Rel *get_base_rel(Query *root, int relid);
+extern Rel *get_join_rel(Query *root, List *relid);
/*
* prototypes for indexnode.h
*/
-extern List *find_relation_indices(Query * root, Rel * rel);
+extern List *find_relation_indices(Query *root, Rel *rel);
#endif /* PATHNODE_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: paths.h,v 1.3 1997/09/08 02:37:53 momjian Exp $
+ * $Id: paths.h,v 1.4 1997/09/08 21:53:25 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/*
* allpaths.h
*/
-extern List *find_paths(Query * root, List * rels);
+extern List *find_paths(Query *root, List *rels);
/*
* indxpath.h
* routines to generate index paths
*/
extern List *
-find_index_paths(Query * root, Rel * rel, List * indices,
- List * clauseinfo_list,
- List * joininfo_list);
+find_index_paths(Query *root, Rel *rel, List *indices,
+ List *clauseinfo_list,
+ List *joininfo_list);
/*
* joinpath.h
* routines to create join paths
*/
-extern void find_all_join_paths(Query * root, List * joinrels);
+extern void find_all_join_paths(Query *root, List *joinrels);
/*
* orindxpath.h
*/
-extern List *create_or_index_paths(Query * root, Rel * rel, List * clauses);
+extern List *create_or_index_paths(Query *root, Rel *rel, List *clauses);
/*
* hashutils.h
* routines to deal with hash keys and clauses
*/
extern List *
-group_clauses_by_hashop(List * clauseinfo_list,
+group_clauses_by_hashop(List *clauseinfo_list,
int inner_relid);
/*
* generic join method key/clause routines
*/
extern List *
-match_pathkeys_joinkeys(List * pathkeys,
- List * joinkeys, List * joinclauses, int which_subkey,
- List ** matchedJoinClausesPtr);
+match_pathkeys_joinkeys(List *pathkeys,
+ List *joinkeys, List *joinclauses, int which_subkey,
+ List **matchedJoinClausesPtr);
extern List *
-extract_path_keys(List * joinkeys, List * tlist,
+extract_path_keys(List *joinkeys, List *tlist,
int which_subkey);
extern Path *
-match_paths_joinkeys(List * joinkeys, PathOrder * ordering,
- List * paths, int which_subkey);
+match_paths_joinkeys(List *joinkeys, PathOrder *ordering,
+ List *paths, int which_subkey);
extern List *
-new_join_pathkeys(List * outer_pathkeys,
- List * join_rel_tlist, List * joinclauses);
+new_join_pathkeys(List *outer_pathkeys,
+ List *join_rel_tlist, List *joinclauses);
/*
* mergeutils.h
* routines to deal with merge keys and clauses
*/
extern List *
-group_clauses_by_order(List * clauseinfo_list,
+group_clauses_by_order(List *clauseinfo_list,
int inner_relid);
extern MInfo *
-match_order_mergeinfo(PathOrder * ordering,
- List * mergeinfo_list);
+match_order_mergeinfo(PathOrder *ordering,
+ List *mergeinfo_list);
/*
* joinrels.h
* routines to determine which relations to join
*/
-extern List *find_join_rels(Query * root, List * outer_rels);
-extern void add_new_joininfos(Query * root, List * joinrels, List * outerrels);
-extern List *final_join_rels(List * join_rel_list);
+extern List *find_join_rels(Query *root, List *outer_rels);
+extern void add_new_joininfos(Query *root, List *joinrels, List *outerrels);
+extern List *final_join_rels(List *join_rel_list);
/*
* prototypes for path/prune.c
*/
-extern List *prune_joinrels(List * rel_list);
-extern void prune_rel_paths(List * rel_list);
-extern Path *prune_rel_path(Rel * rel, Path * unorderedpath);
-extern List *merge_joinrels(List * rel_list1, List * rel_list2);
-extern List *prune_oldrels(List * old_rels);
+extern List *prune_joinrels(List *rel_list);
+extern void prune_rel_paths(List *rel_list);
+extern Path *prune_rel_path(Rel *rel, Path *unorderedpath);
+extern List *merge_joinrels(List *rel_list1, List *rel_list2);
+extern List *prune_oldrels(List *old_rels);
#endif /* PATHS_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: plancat.h,v 1.5 1997/09/08 02:37:54 momjian Exp $
+ * $Id: plancat.h,v 1.6 1997/09/08 21:53:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
Oid *classlist; /* classes of AM operators */
Oid indproc;
Node *indpred;
-} IdxInfoRetval;
+} IdxInfoRetval;
extern void
-relation_info(Query * root,
+relation_info(Query *root,
Oid relid,
- bool * hashindex, int *pages,
+ bool *hashindex, int *pages,
int *tuples);
-extern bool
-index_info(Query * root,
- bool first, int relid, IdxInfoRetval * info);
+extern bool
+index_info(Query *root,
+ bool first, int relid, IdxInfoRetval *info);
-extern Cost
+extern Cost
restriction_selectivity(Oid functionObjectId,
Oid operatorObjectId,
Oid relationObjectId,
int32 constFlag);
extern void
-index_selectivity(Oid indid, Oid * classes, List * opnos,
- Oid relid, List * attnos, List * values, List * flags,
+index_selectivity(Oid indid, Oid *classes, List *opnos,
+ Oid relid, List *attnos, List *values, List *flags,
int32 nkeys, float *idxPages, float *idxSelec);
-extern Cost
+extern Cost
join_selectivity(Oid functionObjectId, Oid operatorObjectId,
Oid relationObjectId1, AttrNumber attributeNumber1,
Oid relationObjectId2, AttrNumber attributeNumber2);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: planmain.h,v 1.4 1997/09/08 20:58:56 momjian Exp $
+ * $Id: planmain.h,v 1.5 1997/09/08 21:53:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* prototypes for plan/planmain.c
*/
extern Plan *
-query_planner(Query * root,
- int command_type, List * tlist, List * qual);
+query_planner(Query *root,
+ int command_type, List *tlist, List *qual);
/*
* prototypes for plan/createplan.c
*/
-extern Plan *create_plan(Path * best_path);
+extern Plan *create_plan(Path *best_path);
extern SeqScan *
-make_seqscan(List * qptlist, List * qpqual, Index scanrelid,
- Plan * lefttree);
+make_seqscan(List *qptlist, List *qpqual, Index scanrelid,
+ Plan *lefttree);
extern Sort *
-make_sort(List * tlist, Oid tempid, Plan * lefttree,
+make_sort(List *tlist, Oid tempid, Plan *lefttree,
int keycount);
-extern Agg *make_agg(List * tlist, int nagg, Aggreg **aggs);
+extern Agg *make_agg(List *tlist, int nagg, Aggreg **aggs);
extern Group *
-make_group(List * tlist, bool tuplePerGroup, int ngrp,
- AttrNumber *grpColIdx, Sort * lefttree);
-extern Unique *make_unique(List * tlist, Plan * lefttree, char *uniqueAttr);
-extern List *generate_fjoin(List * tlist);
+make_group(List *tlist, bool tuplePerGroup, int ngrp,
+ AttrNumber *grpColIdx, Sort *lefttree);
+extern Unique *make_unique(List *tlist, Plan *lefttree, char *uniqueAttr);
+extern List *generate_fjoin(List *tlist);
/*
* prototypes for plan/initsplan.c
*/
-extern void initialize_base_rels_list(Query * root, List * tlist);
-extern void initialize_base_rels_jinfo(Query * root, List * clauses);
-extern void initialize_join_clause_info(List * rel_list);
-extern void add_missing_vars_to_base_rels(Query * root, List * tlist);
+extern void initialize_base_rels_list(Query *root, List *tlist);
+extern void initialize_base_rels_jinfo(Query *root, List *clauses);
+extern void initialize_join_clause_info(List *rel_list);
+extern void add_missing_vars_to_base_rels(Query *root, List *tlist);
/*
* prototypes for plan/setrefs.c
*/
-extern void set_tlist_references(Plan * plan);
+extern void set_tlist_references(Plan *plan);
extern List *
-join_references(List * clauses, List * outer_tlist,
- List * inner_tlist);
+join_references(List *clauses, List *outer_tlist,
+ List *inner_tlist);
extern List *
-index_outerjoin_references(List * inner_indxqual,
- List * outer_tlist, Index inner_relid);
-extern void set_result_tlist_references(Result * resultNode);
+index_outerjoin_references(List *inner_indxqual,
+ List *outer_tlist, Index inner_relid);
+extern void set_result_tlist_references(Result *resultNode);
extern void set_agg_tlist_references(Agg *aggNode);
extern void set_agg_agglist_references(Agg *aggNode);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: planner.h,v 1.4 1997/09/08 02:37:56 momjian Exp $
+ * $Id: planner.h,v 1.5 1997/09/08 21:53:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/*
*/
-extern Plan *planner(Query * parse);
-extern void pg_checkretval(Oid rettype, QueryTreeList * querytree_list);
+extern Plan *planner(Query *parse);
+extern void pg_checkretval(Oid rettype, QueryTreeList *querytree_list);
#endif /* PLANNER_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: prep.h,v 1.4 1997/09/08 02:37:57 momjian Exp $
+ * $Id: prep.h,v 1.5 1997/09/08 21:53:30 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/*
* prototypes for archive.h
*/
-extern void plan_archive(List * rt);
+extern void plan_archive(List *rt);
extern List *find_archive_rels(Oid relid);
/*
* prototypes for prepqual.h
*/
extern List *
-preprocess_qualification(Expr * qual, List * tlist,
- List ** existentialQualPtr);
-extern List *cnfify(Expr * qual, bool removeAndFlag);
+preprocess_qualification(Expr *qual, List *tlist,
+ List **existentialQualPtr);
+extern List *cnfify(Expr *qual, bool removeAndFlag);
/*
* prototypes for preptlist.h
*/
extern List *
-preprocess_targetlist(List * tlist, int command_type,
- Index result_relation, List * range_table);
+preprocess_targetlist(List *tlist, int command_type,
+ Index result_relation, List *range_table);
/*
* prototypes for prepunion.h
typedef enum UnionFlag
{
INHERITS_FLAG, ARCHIVE_FLAG, VERSION_FLAG
-} UnionFlag;
+} UnionFlag;
extern List *
-find_all_inheritors(List * unexamined_relids,
- List * examined_relids);
-extern int first_matching_rt_entry(List * rangetable, UnionFlag flag);
+find_all_inheritors(List *unexamined_relids,
+ List *examined_relids);
+extern int first_matching_rt_entry(List *rangetable, UnionFlag flag);
extern Append *
-plan_union_queries(Index rt_index, Query * parse,
+plan_union_queries(Index rt_index, Query *parse,
UnionFlag flag);
#endif /* PREP_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: tlist.h,v 1.4 1997/09/08 02:37:57 momjian Exp $
+ * $Id: tlist.h,v 1.5 1997/09/08 21:53:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef TLIST_H
#define TLIST_H
-extern int exec_tlist_length(List * targelist);
-extern TargetEntry *tlistentry_member(Var * var, List * targetlist);
-extern Expr *matching_tlvar(Var * var, List * targetlist);
-extern void add_tl_element(Rel * rel, Var * var);
-extern TargetEntry *create_tl_element(Var * var, int resdomno);
-extern List *get_actual_tlist(List * tlist);
-extern Resdom *tlist_member(Var * var, List * tlist);
-extern Resdom *tlist_resdom(List * tlist, Resdom * resnode);
+extern int exec_tlist_length(List *targelist);
+extern TargetEntry *tlistentry_member(Var *var, List *targetlist);
+extern Expr *matching_tlvar(Var *var, List *targetlist);
+extern void add_tl_element(Rel *rel, Var *var);
+extern TargetEntry *create_tl_element(Var *var, int resdomno);
+extern List *get_actual_tlist(List *tlist);
+extern Resdom *tlist_member(Var *var, List *tlist);
+extern Resdom *tlist_resdom(List *tlist, Resdom *resnode);
-extern TargetEntry *MakeTLE(Resdom * resdom, Node * expr);
-extern Var *get_expr(TargetEntry * tle);
+extern TargetEntry *MakeTLE(Resdom *resdom, Node *expr);
+extern Var *get_expr(TargetEntry *tle);
-extern TargetEntry *match_varid(Var * test_var, List * tlist);
-extern List *new_unsorted_tlist(List * targetlist);
-extern List *copy_vars(List * target, List * source);
-extern List *flatten_tlist(List * tlist);
+extern TargetEntry *match_varid(Var *test_var, List *tlist);
+extern List *new_unsorted_tlist(List *targetlist);
+extern List *copy_vars(List *target, List *source);
+extern List *flatten_tlist(List *tlist);
extern List *
-flatten_tlist_vars(List * full_tlist,
- List * flat_tlist);
+flatten_tlist_vars(List *full_tlist,
+ List *flat_tlist);
#endif /* TLIST_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: var.h,v 1.3 1997/09/08 02:37:58 momjian Exp $
+ * $Id: var.h,v 1.4 1997/09/08 21:53:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef VAR_H
#define VAR_H
-extern List *pull_varnos(Node * me);
-extern bool contain_var_clause(Node * clause);
-extern List *pull_var_clause(Node * clause);
-extern bool var_equal(Var * var1, Var * var2);
+extern List *pull_varnos(Node *me);
+extern bool contain_var_clause(Node *clause);
+extern List *pull_var_clause(Node *clause);
+extern bool var_equal(Var *var1, Var *var2);
#endif /* VAR_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: xfunc.h,v 1.4 1997/09/08 02:37:59 momjian Exp $
+ * $Id: xfunc.h,v 1.5 1997/09/08 21:53:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define is_join(pathnode) (length(get_relids(get_parent(pathnode))) > 1 ? 1 : 0)
/* function prototypes from planner/path/xfunc.c */
-extern void xfunc_trypullup(Rel * rel);
+extern void xfunc_trypullup(Rel *rel);
extern int
-xfunc_shouldpull(Path * childpath, JoinPath * parentpath,
- int whichchild, CInfo * maxcinfopt);
+xfunc_shouldpull(Path *childpath, JoinPath *parentpath,
+ int whichchild, CInfo *maxcinfopt);
extern CInfo *
-xfunc_pullup(Path * childpath, JoinPath * parentpath, CInfo * cinfo,
+xfunc_pullup(Path *childpath, JoinPath *parentpath, CInfo *cinfo,
int whichchild, int clausetype);
-extern Cost xfunc_rank(Expr * clause);
-extern Cost xfunc_expense(Query * queryInfo, Expr * clause);
-extern Cost xfunc_join_expense(JoinPath * path, int whichchild);
-extern Cost xfunc_local_expense(Expr * clause);
-extern Cost xfunc_func_expense(Expr * node, List * args);
-extern int xfunc_width(Expr * clause);
+extern Cost xfunc_rank(Expr *clause);
+extern Cost xfunc_expense(Query *queryInfo, Expr *clause);
+extern Cost xfunc_join_expense(JoinPath *path, int whichchild);
+extern Cost xfunc_local_expense(Expr *clause);
+extern Cost xfunc_func_expense(Expr *node, List *args);
+extern int xfunc_width(Expr *clause);
/* static, moved to xfunc.c */
/* extern int xfunc_card_unreferenced(Expr *clause, Relid referenced); */
extern int xfunc_card_product(Relid relids);
-extern List *xfunc_find_references(List * clause);
-extern List *xfunc_primary_join(JoinPath * pathnode);
-extern Cost xfunc_get_path_cost(Path * pathnode);
-extern Cost xfunc_total_path_cost(JoinPath * pathnode);
-extern Cost xfunc_expense_per_tuple(JoinPath * joinnode, int whichchild);
-extern void xfunc_fixvars(Expr * clause, Rel * rel, int varno);
+extern List *xfunc_find_references(List *clause);
+extern List *xfunc_primary_join(JoinPath *pathnode);
+extern Cost xfunc_get_path_cost(Path *pathnode);
+extern Cost xfunc_total_path_cost(JoinPath *pathnode);
+extern Cost xfunc_expense_per_tuple(JoinPath *joinnode, int whichchild);
+extern void xfunc_fixvars(Expr *clause, Rel *rel, int varno);
extern int xfunc_cinfo_compare(void *arg1, void *arg2);
extern int xfunc_clause_compare(void *arg1, void *arg2);
-extern void xfunc_disjunct_sort(List * clause_list);
+extern void xfunc_disjunct_sort(List *clause_list);
extern int xfunc_disjunct_compare(void *arg1, void *arg2);
-extern int xfunc_func_width(RegProcedure funcid, List * args);
+extern int xfunc_func_width(RegProcedure funcid, List *args);
extern int xfunc_tuple_width(Relation rd);
-extern int xfunc_num_join_clauses(JoinPath * path);
-extern List *xfunc_LispRemove(List * foo, List * bar);
-extern bool xfunc_copyrel(Rel * from, Rel ** to);
+extern int xfunc_num_join_clauses(JoinPath *path);
+extern List *xfunc_LispRemove(List *foo, List *bar);
+extern bool xfunc_copyrel(Rel *from, Rel **to);
/*
* function prototypes for path/predmig.c
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: catalog_utils.h,v 1.12 1997/09/08 02:38:01 momjian Exp $
+ * $Id: catalog_utils.h,v 1.13 1997/09/08 21:53:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern char *instr2(Type tp, char *string, int typlen);
extern Oid GetArrayElementType(Oid typearray);
extern Oid funcid_get_rettype(Oid funcid);
-extern bool
-func_get_detail(char *funcname, int nargs, Oid * oid_array,
- Oid * funcid, Oid * rettype, bool * retset, Oid ** true_typeids);
+extern bool
+func_get_detail(char *funcname, int nargs, Oid *oid_array,
+ Oid *funcid, Oid *rettype, bool *retset, Oid **true_typeids);
extern Oid typeid_get_retinfunc(Oid type_id);
extern Oid typeid_get_retoutfunc(Oid type_id);
extern Oid typeid_get_relid(Oid type_id);
extern Oid get_typrelid(Type typ);
extern Oid get_typelem(Oid type_id);
-extern void func_error(char *caller, char *funcname, int nargs, Oid * argtypes);
+extern void func_error(char *caller, char *funcname, int nargs, Oid *argtypes);
extern void agg_error(char *caller, char *aggname, Oid basetypeID);
#endif /* CATALOG_UTILS_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: gramparse.h,v 1.4 1997/09/08 02:38:11 momjian Exp $
+ * $Id: gramparse.h,v 1.5 1997/09/08 21:53:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern void init_io(void);
/* from gram.y */
-extern void parser_init(Oid * typev, int nargs);
+extern void parser_init(Oid *typev, int nargs);
extern int yyparse(void);
#endif /* GRAMPARSE_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: keywords.h,v 1.3 1997/09/08 02:38:14 momjian Exp $
+ * $Id: keywords.h,v 1.4 1997/09/08 21:53:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
char *name;
int value;
-} ScanKeyword;
+} ScanKeyword;
extern ScanKeyword *ScanKeywordLookup(char *text);
extern char *AtomValueGetString(int atomval);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: parse_query.h,v 1.11 1997/09/08 02:38:15 momjian Exp $
+ * $Id: parse_query.h,v 1.12 1997/09/08 21:53:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
int len; /* number of queries */
Query **qtrees;
-} QueryTreeList;
+} QueryTreeList;
-extern RangeTblEntry *refnameRangeTableEntry(List * rtable, char *refname);
-extern RangeTblEntry *colnameRangeTableEntry(ParseState * pstate, char *colname);
-extern int refnameRangeTablePosn(List * rtable, char *refname);
+extern RangeTblEntry *refnameRangeTableEntry(List *rtable, char *refname);
+extern RangeTblEntry *colnameRangeTableEntry(ParseState *pstate, char *colname);
+extern int refnameRangeTablePosn(List *rtable, char *refname);
extern RangeTblEntry *
-addRangeTableEntry(ParseState * pstate,
+addRangeTableEntry(ParseState *pstate,
char *relname, char *refname,
bool inh, bool inFromCl,
- TimeRange * timeRange);
+ TimeRange *timeRange);
extern List *
-expandAll(ParseState * pstate, char *relname, char *refname,
+expandAll(ParseState *pstate, char *relname, char *refname,
int *this_resno);
-extern TimeQual
+extern TimeQual
makeTimeRange(char *datestring1, char *datestring2,
int timecode);
-extern Expr *make_op(char *opname, Node * ltree, Node * rtree);
+extern Expr *make_op(char *opname, Node *ltree, Node *rtree);
extern Oid find_atttype(Oid relid, char *attrname);
extern Var *
-make_var(ParseState * pstate,
- char *relname, char *attrname, Oid * type_id);
-extern ArrayRef *make_array_ref(Node * array, List * indirection);
+make_var(ParseState *pstate,
+ char *relname, char *attrname, Oid *type_id);
+extern ArrayRef *make_array_ref(Node *array, List *indirection);
extern ArrayRef *
-make_array_set(Expr * target_expr, List * upperIndexpr,
- List * lowerIndexpr, Expr * expr);
-extern Const *make_const(Value * value);
+make_array_set(Expr *target_expr, List *upperIndexpr,
+ List *lowerIndexpr, Expr *expr);
+extern Const *make_const(Value *value);
-extern void param_type_init(Oid * typev, int nargs);
+extern void param_type_init(Oid *typev, int nargs);
extern Oid param_type(int t);
/* parser.c (was ylib.c) */
-extern QueryTreeList *parser(char *str, Oid * typev, int nargs);
-extern Node *parser_typecast(Value * expr, TypeName * typename, int typlen);
-extern Node *parser_typecast2(Node * expr, Oid exprType, Type tp, int typlen);
-extern Aggreg *ParseAgg(char *aggname, Oid basetype, Node * target);
+extern QueryTreeList *parser(char *str, Oid *typev, int nargs);
+extern Node *parser_typecast(Value *expr, TypeName *typename, int typlen);
+extern Node *parser_typecast2(Node *expr, Oid exprType, Type tp, int typlen);
+extern Aggreg *ParseAgg(char *aggname, Oid basetype, Node *target);
extern void
-handleTargetColname(ParseState * pstate, char **resname,
+handleTargetColname(ParseState *pstate, char **resname,
char *refname, char *colname);
/*
* analyze.c
*/
-Oid exprType(Node * expr);
-QueryTreeList *parse_analyze(List * querytree_list);
+Oid exprType(Node *expr);
+QueryTreeList *parse_analyze(List *querytree_list);
/* define in parse_query.c, used in gram.y */
extern Oid *param_type_info;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: parse_state.h,v 1.7 1997/09/08 02:38:15 momjian Exp $
+ * $Id: parse_state.h,v 1.8 1997/09/08 21:53:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
bool p_is_rule;
Relation p_target_relation;
RangeTblEntry *p_target_rangetblentry;
-} ParseState;
+} ParseState;
#endif /* PARSE_QUERY_H */
typedef struct
{
int sem[4];
-} slock_t;
+} slock_t;
#ifndef BIG_ENDIAN
#define BIG_ENDIAN 4321
*
* Copyright (c) 1995, Regents of the University of California
*
- * $Id: postgres.h,v 1.8 1997/09/08 02:33:54 momjian Exp $
+ * $Id: postgres.h,v 1.9 1997/09/08 21:50:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
typedef struct char8
{
char data[8];
-} char8;
+} char8;
/* ----------------
* char16
typedef struct char16
{
char data[16];
-} char16;
+} char16;
typedef char16 *Char16;
typedef struct nameData
{
char data[NAMEDATALEN];
-} NameData;
+} NameData;
typedef NameData *Name;
/* ----------------
{
Oid oi_oid;
int32 oi_int4;
-} OidInt4Data;
+} OidInt4Data;
typedef struct OidInt4Data *OidInt4;
{
Oid oi_oid;
int16 oi_int2;
-} OidInt2Data;
+} OidInt2Data;
typedef struct OidInt2Data *OidInt2;
{
Oid id;
NameData name;
-} OidNameData;
+} OidNameData;
typedef struct OidNameData *OidName;
size_t re_nsub; /* number of parenthesized subexpressions */
const char *re_endp; /* end pointer for REG_PEND */
struct re_guts *re_g; /* none of your business :-) */
-} regex_t;
+} regex_t;
typedef struct
{
regoff_t rm_so; /* start of match */
regoff_t rm_eo; /* end of match */
-} regmatch_t;
+} regmatch_t;
/* regcomp() flags */
#define REG_BASIC 0000
uch hash; /* hash code */
size_t smultis;
char *multis; /* -> char[smulti] ab\0cd\0ef\0\0 */
-} cset;
+} cset;
/* note that CHadd and CHsub are unsafe, and CHIN doesn't yield 0/1 */
#define CHadd(cs, c) ((cs)->ptr[(uch)(c)] |= (cs)->mask, (cs)->hash += (c))
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: locks.h,v 1.5 1997/09/08 02:38:44 momjian Exp $
+ * $Id: locks.h,v 1.6 1997/09/08 21:54:01 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "rewrite/prs2lock.h"
extern List *
-matchLocks(CmdType event, RuleLock * rulelocks, int varno,
- Query * parsetree);
+matchLocks(CmdType event, RuleLock *rulelocks, int varno,
+ Query *parsetree);
#endif /* LOCKS_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: prs2lock.h,v 1.6 1997/09/08 02:38:46 momjian Exp $
+ * $Id: prs2lock.h,v 1.7 1997/09/08 21:54:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
Node *qual;
List *actions;
bool isInstead;
-} RewriteRule;
+} RewriteRule;
/*
* RuleLock -
{
int numLocks;
RewriteRule **rules;
-} RuleLock;
+} RuleLock;
#endif /* REWRITE_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: rewriteDefine.h,v 1.3 1997/09/08 02:38:48 momjian Exp $
+ * $Id: rewriteDefine.h,v 1.4 1997/09/08 21:54:05 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef REWRITEDEFINE_H
#define REWRITEDEFINE_H
-extern void DefineQueryRewrite(RuleStmt * args);
+extern void DefineQueryRewrite(RuleStmt *args);
#endif /* REWRITEDEFINE_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: rewriteHandler.h,v 1.3 1997/09/08 02:38:50 momjian Exp $
+ * $Id: rewriteHandler.h,v 1.4 1997/09/08 21:54:07 momjian Exp $
*
*-------------------------------------------------------------------------
*/
typedef struct _rewrite_meta_knowledge RewriteInfo;
-extern List *QueryRewrite(Query * parsetree);
+extern List *QueryRewrite(Query *parsetree);
#endif /* REWRITEHANDLER_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: rewriteManip.h,v 1.3 1997/09/08 02:38:51 momjian Exp $
+ * $Id: rewriteManip.h,v 1.4 1997/09/08 21:54:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define REWRITEMANIP_H
/* RewriteManip.c */
-void OffsetVarNodes(Node * node, int offset);
-void ChangeVarNodes(Node * node, int old_varno, int new_varno);
-void AddQual(Query * parsetree, Node * qual);
-void AddNotQual(Query * parsetree, Node * qual);
-void FixResdomTypes(List * user_tlist);
-void FixNew(RewriteInfo * info, Query * parsetree);
+void OffsetVarNodes(Node *node, int offset);
+void ChangeVarNodes(Node *node, int old_varno, int new_varno);
+void AddQual(Query *parsetree, Node *qual);
+void AddNotQual(Query *parsetree, Node *qual);
+void FixResdomTypes(List *user_tlist);
+void FixNew(RewriteInfo *info, Query *parsetree);
void
-HandleRIRAttributeRule(Query * parsetree, List * rtable, List * targetlist,
+HandleRIRAttributeRule(Query *parsetree, List *rtable, List *targetlist,
int rt_index, int attr_num, int *modified,
int *badpostquel);
void
-HandleViewRule(Query * parsetree, List * rtable, List * targetlist,
+HandleViewRule(Query *parsetree, List *rtable, List *targetlist,
int rt_index, int *modified);
#endif /* REWRITEMANIP_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: rewriteSupport.h,v 1.4 1997/09/08 02:38:52 momjian Exp $
+ * $Id: rewriteSupport.h,v 1.5 1997/09/08 21:54:11 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern void
prs2_addToRelation(Oid relid, Oid ruleId, CmdType event_type,
- AttrNumber attno, bool isInstead, Node * qual,
- List * actions);
+ AttrNumber attno, bool isInstead, Node *qual,
+ List *actions);
extern void prs2_deleteFromRelation(Oid relid, Oid ruleId);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: buf_internals.h,v 1.17 1997/09/08 20:59:00 momjian Exp $
+ * $Id: buf_internals.h,v 1.18 1997/09/08 21:54:14 momjian Exp $
*
* NOTE
* If BUFFERPAGE0 is defined, then 0 will be used as a
/* buf_table.c */
extern void InitBufTable(void);
-extern BufferDesc *BufTableLookup(BufferTag * tagPtr);
+extern BufferDesc *BufTableLookup(BufferTag *tagPtr);
extern bool BufTableDelete(BufferDesc *buf);
extern bool BufTableInsert(BufferDesc *buf);
extern BufferDesc *
LocalBufferAlloc(Relation reln, BlockNumber blockNum,
- bool * foundPtr);
+ bool *foundPtr);
extern int WriteLocalBuffer(Buffer buffer, bool release);
extern int FlushLocalBuffer(Buffer buffer, bool release);
extern void InitLocalBuffer(void);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: bufmgr.h,v 1.14 1997/09/08 20:59:05 momjian Exp $
+ * $Id: bufmgr.h,v 1.15 1997/09/08 21:54:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
BlockNumber blockNum);
extern void InitBufferPool(IPCKey key);
-extern void PrintBufferUsage(FILE * statfp);
+extern void PrintBufferUsage(FILE *statfp);
extern void ResetBufferUsage(void);
extern void ResetBufferPool(void);
extern int BufferPoolCheckLeak(void);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: bufpage.h,v 1.12 1997/09/08 02:38:59 momjian Exp $
+ * $Id: bufpage.h,v 1.13 1997/09/08 21:54:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
typedef struct OpaqueData
{
uint16 od_pagesize;
-} OpaqueData;
+} OpaqueData;
typedef OpaqueData *Opaque;
LocationIndex pd_special; /* offset to start of special space */
OpaqueData pd_opaque; /* AM-generic information */
ItemIdData pd_linp[1]; /* line pointers */
-} PageHeaderData;
+} PageHeaderData;
typedef PageHeaderData *PageHeader;
{
ShufflePageManagerMode,
OverwritePageManagerMode
-} PageManagerMode;
+} PageManagerMode;
/* ----------------
* misc support macros
*/
extern void PageInit(Page page, Size pageSize, Size specialSize);
-extern OffsetNumber
+extern OffsetNumber
PageAddItem(Page page, Item item, Size size,
OffsetNumber offsetNumber, ItemIdFlags flags);
extern Page PageGetTempPage(Page page, Size specialSize);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: ipc.h,v 1.19 1997/09/08 02:39:01 momjian Exp $
+ * $Id: ipc.h,v 1.20 1997/09/08 21:54:21 momjian Exp $
*
* NOTES
* This file is very architecture-specific. This stuff should actually
#if defined(HAS_TEST_AND_SET)
-extern void S_LOCK(slock_t * lock);
-extern void S_UNLOCK(slock_t * lock);
-extern void S_INIT_LOCK(slock_t * lock);
+extern void S_LOCK(slock_t *lock);
+extern void S_UNLOCK(slock_t *lock);
+extern void S_INIT_LOCK(slock_t *lock);
#if (defined(alpha) && !defined(linuxalpha)) || \
defined(hpux) || \
defined(irix5) || \
defined(nextstep)
-extern int S_LOCK_FREE(slock_t * lock);
+extern int S_LOCK_FREE(slock_t *lock);
#else
#define S_LOCK_FREE(lock) ((*lock) == 0)
extern void quasi_exitpg(void);
extern int on_exitpg(void (*function) (), caddr_t arg);
-extern IpcSemaphoreId
+extern IpcSemaphoreId
IpcSemaphoreCreate(IpcSemaphoreKey semKey,
int semNum, int permission, int semStartValue,
int removeOnExit, int *status);
extern void IpcSemaphoreUnlock(IpcSemaphoreId semId, int sem, int lock);
extern int IpcSemaphoreGetCount(IpcSemaphoreId semId, int sem);
extern int IpcSemaphoreGetValue(IpcSemaphoreId semId, int sem);
-extern IpcMemoryId
+extern IpcMemoryId
IpcMemoryCreate(IpcMemoryKey memKey, uint32 size,
int permission);
extern IpcMemoryId IpcMemoryIdGet(IpcMemoryKey memKey, uint32 size);
PROCSTRUCTLOCKID,
FIRSTFREELOCKID
-} _LockId_;
+} _LockId_;
#define MAX_SPINS FIRSTFREELOCKID
slock_t exlock;
slock_t comlock;
struct slock *next;
-} SLock;
+} SLock;
extern void ExclusiveLock(int lockid);
extern void ExclusiveUnlock(int lockid);
PROCSTRUCTLOCKID,
OIDGENLOCKID,
FIRSTFREELOCKID
-} _LockId_;
+} _LockId_;
#define MAX_SPINS FIRSTFREELOCKID
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: itemid.h,v 1.3 1997/09/08 02:39:02 momjian Exp $
+ * $Id: itemid.h,v 1.4 1997/09/08 21:54:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* can be reduced by 2 if necc. */
lp_flags:6, /* flags on tuple */
lp_len:13; /* length of tuple */
-} ItemIdData;
+} ItemIdData;
typedef struct ItemIdData *ItemId;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: itemptr.h,v 1.6 1997/09/08 02:39:03 momjian Exp $
+ * $Id: itemptr.h,v 1.7 1997/09/08 21:54:25 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
BlockIdData ip_blkid;
OffsetNumber ip_posid;
-} ItemPointerData;
+} ItemPointerData;
typedef ItemPointerData *ItemPointer;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: large_object.h,v 1.6 1997/09/08 02:39:03 momjian Exp $
+ * $Id: large_object.h,v 1.7 1997/09/08 21:54:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define IFS_ATEOF (1 << 2)
u_long flags; /* locking info, etc */
-} LargeObjectDesc;
+} LargeObjectDesc;
/*
* Function definitions...
/* inversion stuff in inv_api.c */
extern LargeObjectDesc *inv_create(int flags);
extern LargeObjectDesc *inv_open(Oid lobjId, int flags);
-extern void inv_close(LargeObjectDesc * obj_desc);
+extern void inv_close(LargeObjectDesc *obj_desc);
extern int inv_destroy(Oid lobjId);
-extern int inv_seek(LargeObjectDesc * obj_desc, int offset, int whence);
-extern int inv_tell(LargeObjectDesc * obj_desc);
-extern int inv_read(LargeObjectDesc * obj_desc, char *buf, int nbytes);
-extern int inv_write(LargeObjectDesc * obj_desc, char *buf, int nbytes);
+extern int inv_seek(LargeObjectDesc *obj_desc, int offset, int whence);
+extern int inv_tell(LargeObjectDesc *obj_desc);
+extern int inv_read(LargeObjectDesc *obj_desc, char *buf, int nbytes);
+extern int inv_write(LargeObjectDesc *obj_desc, char *buf, int nbytes);
#endif /* LARGE_OBJECT_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: lmgr.h,v 1.7 1997/09/08 02:39:04 momjian Exp $
+ * $Id: lmgr.h,v 1.8 1997/09/08 21:54:30 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
Oid relId; /* a relation identifier */
Oid dbId; /* a database identifier */
-} LRelId;
+} LRelId;
typedef struct LockInfoData
{
LRelId lRelId;
TransactionId transactionIdData;
uint16 flags;
-} LockInfoData;
+} LockInfoData;
typedef LockInfoData *LockInfo;
#define LockInfoIsValid(linfo) \
/* single.c */
extern bool SingleLockReln(LockInfo linfo, LOCKT lockt, int action);
-extern bool
+extern bool
SingleLockPage(LockInfo linfo, ItemPointer tidPtr,
LOCKT lockt, int action);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: lock.h,v 1.7 1997/09/08 02:39:05 momjian Exp $
+ * $Id: lock.h,v 1.8 1997/09/08 21:54:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
Oid relId;
Oid dbId;
ItemPointerData tupleId;
-} LOCKTAG;
+} LOCKTAG;
#define TAGSIZE (sizeof(LOCKTAG))
int conflictTab[MAX_LOCKTYPES];
int prio[MAX_LOCKTYPES];
SPINLOCK masterLock;
-} LOCKCTL;
+} LOCKCTL;
/*
* lockHash -- hash table on lock Ids,
HTAB *lockHash;
HTAB *xidHash;
LOCKCTL *ctl;
-} LOCKTAB;
+} LOCKTAB;
/* -----------------------
* A transaction never conflicts with its own locks. Hence, if
SHMEM_OFFSET lock;
int pid;
TransactionId xid;
-} XIDTAG;
+} XIDTAG;
typedef struct XIDLookupEnt
{
int holders[MAX_LOCKTYPES];
int nHolding;
SHM_QUEUE queue;
-} XIDLookupEnt;
+} XIDLookupEnt;
#define XID_TAGSIZE (sizeof(XIDTAG))
{
SHM_QUEUE links;
int size;
-} PROC_QUEUE;
+} PROC_QUEUE;
/*
int nHolding;
int activeHolders[MAX_LOCKTYPES];
int nActive;
-} LOCK;
+} LOCK;
#define LockGetLock_nHolders(l) l->nHolders
*/
extern void InitLocks(void);
extern void LockDisable(int status);
-extern LockTableId
-LockTabInit(char *tabName, MASK * conflictsP, int *prioP,
+extern LockTableId
+LockTabInit(char *tabName, MASK *conflictsP, int *prioP,
int ntypes);
-extern bool LockAcquire(LockTableId tableId, LOCKTAG * lockName, LOCKT lockt);
+extern bool LockAcquire(LockTableId tableId, LOCKTAG *lockName, LOCKT lockt);
extern int
-LockResolveConflicts(LOCKTAB * ltable, LOCK * lock, LOCKT lockt,
+LockResolveConflicts(LOCKTAB *ltable, LOCK *lock, LOCKT lockt,
TransactionId xid);
-extern bool LockRelease(LockTableId tableId, LOCKTAG * lockName, LOCKT lockt);
-extern void GrantLock(LOCK * lock, LOCKT lockt);
-extern bool LockReleaseAll(LockTableId tableId, SHM_QUEUE * lockQueue);
+extern bool LockRelease(LockTableId tableId, LOCKTAG *lockName, LOCKT lockt);
+extern void GrantLock(LOCK *lock, LOCKT lockt);
+extern bool LockReleaseAll(LockTableId tableId, SHM_QUEUE *lockQueue);
extern int LockShmemSize(void);
extern bool LockingDisabled(void);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: proc.h,v 1.7 1997/09/08 02:39:07 momjian Exp $
+ * $Id: proc.h,v 1.8 1997/09/08 21:54:32 momjian Exp $
*
*-------------------------------------------------------------------------
*/
int semNum;
IpcSemaphoreId semId;
IpcSemaphoreKey semKey;
-} SEMA;
+} SEMA;
/*
* Each backend has:
short sLocks[MAX_SPINS]; /* Spin lock stats */
SHM_QUEUE lockQueue; /* locks associated with current
* transaction */
-} PROC;
+} PROC;
/*
int numProcs;
IPCKey currKey;
int32 freeSemMap[MAX_PROC_SEMS / PROC_NSEMS_PER_SET];
-} PROC_HDR;
+} PROC_HDR;
extern PROC *MyProc;
/* extern bool ProcKill(int exitStatus, int pid); */
/* make static in storage/lmgr/proc.c -- jolly */
-extern void ProcQueueInit(PROC_QUEUE * queue);
+extern void ProcQueueInit(PROC_QUEUE *queue);
extern int
-ProcSleep(PROC_QUEUE * queue, SPINLOCK spinlock, int token,
- int prio, LOCK * lock);
-extern int ProcLockWakeup(PROC_QUEUE * queue, char *ltable, char *lock);
-extern void ProcAddLock(SHM_QUEUE * elem);
-extern void ProcReleaseSpins(PROC * proc);
+ProcSleep(PROC_QUEUE *queue, SPINLOCK spinlock, int token,
+ int prio, LOCK *lock);
+extern int ProcLockWakeup(PROC_QUEUE *queue, char *ltable, char *lock);
+extern void ProcAddLock(SHM_QUEUE *elem);
+extern void ProcReleaseSpins(PROC *proc);
extern void ProcFreeAllSemaphores(void);
#endif /* PROC_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: shmem.h,v 1.8 1997/09/08 20:59:07 momjian Exp $
+ * $Id: shmem.h,v 1.9 1997/09/08 21:54:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
SHMEM_OFFSET prev;
SHMEM_OFFSET next;
-} SHM_QUEUE;
+} SHM_QUEUE;
/* shmem.c */
extern void ShmemBindingTabReset(void);
extern int ShmemIsValid(unsigned long addr);
extern HTAB *
ShmemInitHash(char *name, long init_size, long max_size,
- HASHCTL * infoP, int hash_flags);
-extern bool ShmemPIDLookup(int pid, SHMEM_OFFSET * locationPtr);
+ HASHCTL *infoP, int hash_flags);
+extern bool ShmemPIDLookup(int pid, SHMEM_OFFSET *locationPtr);
extern SHMEM_OFFSET ShmemPIDDestroy(int pid);
extern long *
ShmemInitStruct(char *name, unsigned long size,
- bool * foundPtr);
+ bool *foundPtr);
extern bool TransactionIdIsInProgress(TransactionId xid);
/*
* prototypes for functions in shmqueue.c
*/
-extern void SHMQueueInit(SHM_QUEUE * queue);
-extern void SHMQueueElemInit(SHM_QUEUE * queue);
-extern void SHMQueueDelete(SHM_QUEUE * queue);
-extern void SHMQueueInsertTL(SHM_QUEUE * queue, SHM_QUEUE * elem);
+extern void SHMQueueInit(SHM_QUEUE *queue);
+extern void SHMQueueElemInit(SHM_QUEUE *queue);
+extern void SHMQueueDelete(SHM_QUEUE *queue);
+extern void SHMQueueInsertTL(SHM_QUEUE *queue, SHM_QUEUE *elem);
extern void
-SHMQueueFirst(SHM_QUEUE * queue, Pointer * nextPtrPtr,
- SHM_QUEUE * nextQueue);
-extern bool SHMQueueEmpty(SHM_QUEUE * queue);
+SHMQueueFirst(SHM_QUEUE *queue, Pointer *nextPtrPtr,
+ SHM_QUEUE *nextQueue);
+extern bool SHMQueueEmpty(SHM_QUEUE *queue);
#endif /* SHMEM_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: sinvaladt.h,v 1.5 1997/09/08 02:39:13 momjian Exp $
+ * $Id: sinvaladt.h,v 1.6 1997/09/08 21:54:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
bool resetState; /* true, if backend has to reset its state */
int tag; /* special tag, recieved from the
* postmaster */
-} ProcState;
+} ProcState;
typedef struct SISeg
ProcState procState[MaxBackendId]; /* reflects the
* invalidation state */
/* here starts the entry section, controlled by offsets */
-} SISeg;
+} SISeg;
#define SizeSISeg sizeof(SISeg)
int cacheId; /* XXX */
Index hashIndex;
ItemPointerData pointerData;
-} SharedInvalidData;
+} SharedInvalidData;
typedef SharedInvalidData *SharedInvalid;
SharedInvalidData entryData;/* the message data */
bool isfree; /* entry free? */
Offset next; /* offset to next entry */
-} SISegEntry;
+} SISegEntry;
#define SizeOfOneSISegEntry sizeof(SISegEntry)
Offset startSegment; /* always 0 (for now) */
Offset offsetToFirstEntry; /* A + a = B */
Offset offsetToEndOfSegemnt; /* A + a + b */
-} SISegOffsets;
+} SISegOffsets;
/****************************************************************************/
/*
* prototypes for functions in sinvaladt.c
*/
-extern int SIBackendInit(SISeg * segInOutP);
+extern int SIBackendInit(SISeg *segInOutP);
extern int SISegmentInit(bool killExistingSegment, IPCKey key);
-extern bool SISetDataEntry(SISeg * segP, SharedInvalidData * data);
-extern void SISetProcStateInvalid(SISeg * segP);
-extern bool SIDelDataEntry(SISeg * segP);
+extern bool SISetDataEntry(SISeg *segP, SharedInvalidData *data);
+extern void SISetProcStateInvalid(SISeg *segP);
+extern bool SIDelDataEntry(SISeg *segP);
extern void
-SIReadEntryData(SISeg * segP, int backendId,
+SIReadEntryData(SISeg *segP, int backendId,
void (*invalFunction) (), void (*resetFunction) ());
-extern void SIDelExpiredDataEntries(SISeg * segP);
+extern void SIDelExpiredDataEntries(SISeg *segP);
#endif /* SINVALADT_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: dest.h,v 1.10 1997/09/08 02:39:16 momjian Exp $
+ * $Id: dest.h,v 1.11 1997/09/08 21:54:36 momjian Exp $
*
*-------------------------------------------------------------------------
*/
RemoteInternal, /* results sent to frontend process in
* internal (binary) form */
SPI /* results sent to SPI manager */
-} CommandDest;
+} CommandDest;
/* AttrInfo* replaced with TupleDesc, now that TupleDesc also has within it
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: pquery.h,v 1.6 1997/09/08 02:39:19 momjian Exp $
+ * $Id: pquery.h,v 1.7 1997/09/08 21:54:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern void
-ProcessPortal(char *portalName, Query * parseTree,
- Plan * plan, EState * state, TupleDesc attinfo,
+ProcessPortal(char *portalName, Query *parseTree,
+ Plan *plan, EState *state, TupleDesc attinfo,
CommandDest dest);
extern void
-ProcessQuery(Query * parsetree, Plan * plan, char *argv[],
- Oid * typev, int nargs, CommandDest dest);
+ProcessQuery(Query *parsetree, Plan *plan, char *argv[],
+ Oid *typev, int nargs, CommandDest dest);
#endif /* pqueryIncluded */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: tcopprot.h,v 1.6 1997/09/08 02:39:20 momjian Exp $
+ * $Id: tcopprot.h,v 1.7 1997/09/08 21:54:42 momjian Exp $
*
* OLD COMMENTS
* This file was created so that other c files could get the two
#ifndef BOOTSTRAP_INCLUDE
extern List *
-pg_plan(char *query_string, Oid * typev, int nargs,
- QueryTreeList ** queryListP, CommandDest dest);
-extern void pg_eval(char *query_string, char **argv, Oid * typev, int nargs);
+pg_plan(char *query_string, Oid *typev, int nargs,
+ QueryTreeList **queryListP, CommandDest dest);
+extern void pg_eval(char *query_string, char **argv, Oid *typev, int nargs);
extern void
-pg_eval_dest(char *query_string, char **argv, Oid * typev,
+pg_eval_dest(char *query_string, char **argv, Oid *typev,
int nargs, CommandDest dest);
#endif /* BOOTSTRAP_HEADER */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: utility.h,v 1.4 1997/09/08 02:39:21 momjian Exp $
+ * $Id: utility.h,v 1.5 1997/09/08 21:54:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include <executor/execdesc.h>
-extern void ProcessUtility(Node * parsetree, CommandDest dest);
+extern void ProcessUtility(Node *parsetree, CommandDest dest);
#endif /* UTILITY_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: acl.h,v 1.10 1997/09/08 20:59:15 momjian Exp $
+ * $Id: acl.h,v 1.11 1997/09/08 21:54:47 momjian Exp $
*
* NOTES
* For backward-compatability purposes we have to allow there
extern char *aclmakepriv(char *old_privlist, char new_priv);
extern char *aclmakeuser(char *user_type, char *user);
extern ChangeACLStmt *
-makeAclStmt(char *privs, List * rel_list, char *grantee,
+makeAclStmt(char *privs, List *rel_list, char *grantee,
char grant_or_revoke);
/*
/* XXX move these elsewhere -pma */
extern int32 pg_aclcheck(char *relname, char *usename, AclMode mode);
extern int32 pg_ownercheck(char *usename, char *value, int cacheid);
-extern int32
+extern int32
pg_func_ownercheck(char *usename, char *funcname,
- int nargs, Oid * arglist);
-extern int32
+ int nargs, Oid *arglist);
+extern int32
pg_aggr_ownercheck(char *usename, char *aggname,
Oid basetypeID);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: array.h,v 1.7 1997/09/08 20:59:18 momjian Exp $
+ * $Id: array.h,v 1.8 1997/09/08 21:54:49 momjian Exp $
*
* NOTES
* XXX the data array should be LONGALIGN'd -- notice that the array
{
char lo_name[NAME_LEN];
int C[MAXDIM];
-} CHUNK_INFO;
+} CHUNK_INFO;
/*
* prototypes for functions defined in arrayfuncs.c
*/
extern char *array_in(char *string, Oid element_type);
extern char *array_out(ArrayType *v, Oid element_type);
-extern char *array_dims(ArrayType *v, bool * isNull);
-extern Datum
+extern char *array_dims(ArrayType *v, bool *isNull);
+extern Datum
array_ref(ArrayType *array, int n, int indx[], int reftype,
- int elmlen, int arraylen, bool * isNull);
-extern Datum
+ int elmlen, int arraylen, bool *isNull);
+extern Datum
array_clip(ArrayType *array, int n, int upperIndx[],
- int lowerIndx[], int reftype, int len, bool * isNull);
+ int lowerIndx[], int reftype, int len, bool *isNull);
extern char *
array_set(ArrayType *array, int n, int indx[], char *dataPtr,
- int reftype, int elmlen, int arraylen, bool * isNull);
+ int reftype, int elmlen, int arraylen, bool *isNull);
extern char *
array_assgn(ArrayType *array, int n, int upperIndx[],
int lowerIndx[], ArrayType *newArr, int reftype,
- int len, bool * isNull);
+ int len, bool *isNull);
extern int array_eq(ArrayType *array1, ArrayType *array2);
extern int
_LOtransfer(char **destfd, int size, int nitems, char **srcfd,
* prototypes for functions defined in chunk.c
*/
extern char *
-_ChunkArray(int fd, FILE * afd, int ndim, int dim[], int baseSize,
+_ChunkArray(int fd, FILE *afd, int ndim, int dim[], int baseSize,
int *nbytes, char *chunkfile);
extern int
_ReadChunkArray(int st[], int endp[], int bsize, int fp,
- char *destfp, ArrayType *array, int isDestLO, bool * isNull);
+ char *destfp, ArrayType *array, int isDestLO, bool *isNull);
extern struct varlena *
_ReadChunkArray1El(int st[], int bsize, int fp,
- ArrayType *array, bool * isNull);
+ ArrayType *array, bool *isNull);
#endif /* ARRAY_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: builtins.h,v 1.24 1997/09/08 20:59:19 momjian Exp $
+ * $Id: builtins.h,v 1.25 1997/09/08 21:54:50 momjian Exp $
*
* NOTES
* This should normally only be included by fmgr.h.
extern int32 int2in(char *num);
extern char *int2out(int16 sh);
extern int16 *int28in(char *shs);
-extern char *int28out(int16(*shs)[]);
+extern char *int28out(int16 (*shs)[]);
extern int32 *int44in(char *input_string);
extern char *int44out(int32 an_array[]);
extern int32 int4in(char *num);
extern bool int42le(int32 arg1, int32 arg2);
extern bool int42gt(int32 arg1, int32 arg2);
extern bool int42ge(int32 arg1, int32 arg2);
-extern bool keyfirsteq(int16 * arg1, int16 arg2);
+extern bool keyfirsteq(int16 *arg1, int16 arg2);
extern int32 int4um(int32 arg);
extern int32 int4pl(int32 arg1, int32 arg2);
extern int32 int4mi(int32 arg1, int32 arg2);
/* name.c */
extern NameData *namein(char *s);
-extern char *nameout(NameData * s);
-extern bool nameeq(NameData * arg1, NameData * arg2);
-extern bool namene(NameData * arg1, NameData * arg2);
-extern bool namelt(NameData * arg1, NameData * arg2);
-extern bool namele(NameData * arg1, NameData * arg2);
-extern bool namegt(NameData * arg1, NameData * arg2);
-extern bool namege(NameData * arg1, NameData * arg2);
+extern char *nameout(NameData *s);
+extern bool nameeq(NameData *arg1, NameData *arg2);
+extern bool namene(NameData *arg1, NameData *arg2);
+extern bool namelt(NameData *arg1, NameData *arg2);
+extern bool namele(NameData *arg1, NameData *arg2);
+extern bool namegt(NameData *arg1, NameData *arg2);
+extern bool namege(NameData *arg1, NameData *arg2);
extern int namecmp(Name n1, Name n2);
extern int namecpy(Name n1, Name n2);
extern int namestrcpy(Name name, char *str);
extern int32 btchar4cmp(uint32 a, uint32 b);
extern int32 btchar8cmp(char *a, char *b);
extern int32 btchar16cmp(char *a, char *b);
-extern int32 btnamecmp(NameData * a, NameData * b);
+extern int32 btnamecmp(NameData *a, NameData *b);
extern int32 bttextcmp(struct varlena * a, struct varlena * b);
/* support routines for the rtree access method, by opclass */
extern BOX *rt_box_inter(BOX *a, BOX *b);
extern void rt_box_size(BOX *a, float *size);
extern void rt_bigbox_size(BOX *a, float *size);
-extern void rt_poly_size(POLYGON * a, float *size);
-extern POLYGON *rt_poly_union(POLYGON * a, POLYGON * b);
-extern POLYGON *rt_poly_inter(POLYGON * a, POLYGON * b);
+extern void rt_poly_size(POLYGON *a, float *size);
+extern POLYGON *rt_poly_union(POLYGON *a, POLYGON *b);
+extern POLYGON *rt_poly_inter(POLYGON *a, POLYGON *b);
/* projection utilities */
/* extern char *GetAttributeByName();
extern char *reltimeout(int32 timevalue);
extern TimeInterval tintervalin(char *intervalstr);
extern char *tintervalout(TimeInterval interval);
-extern RelativeTime timespan_reltime(TimeSpan * timespan);
+extern RelativeTime timespan_reltime(TimeSpan *timespan);
extern TimeSpan *reltime_timespan(RelativeTime reltime);
extern TimeInterval mktinterval(AbsoluteTime t1, AbsoluteTime t2);
extern AbsoluteTime timepl(AbsoluteTime t1, RelativeTime t2);
/* dt.c */
extern DateTime *datetime_in(char *str);
-extern char *datetime_out(DateTime * datetime);
+extern char *datetime_out(DateTime *datetime);
extern TimeSpan *timespan_in(char *str);
-extern char *timespan_out(TimeSpan * timespan);
+extern char *timespan_out(TimeSpan *timespan);
extern int datetime2tm(DateTime dt, int *tzp, struct tm * tm, double *fsec, char **tzn);
/* filename.c */
extern double *box_area(BOX *box);
/* misc.c */
-extern bool nullvalue(Datum value, bool * isNull);
-extern bool nonnullvalue(Datum value, bool * isNull);
+extern bool nullvalue(Datum value, bool *isNull);
+extern bool nonnullvalue(Datum value, bool *isNull);
extern bool oidrand(Oid o, int32 X);
extern bool oidsrand(int32 X);
extern int32 userfntest(int i);
/* oid.c */
extern Oid *oid8in(char *oidString);
-extern char *oid8out(Oid(*oidArray)[]);
+extern char *oid8out(Oid (*oidArray)[]);
extern Oid oidin(char *s);
extern char *oidout(Oid o);
extern bool oideq(Oid arg1, Oid arg2);
extern bool char8regexne(char *s, struct varlena * p);
extern bool char16regexeq(char *s, struct varlena * p);
extern bool char16regexne(char *s, struct varlena * p);
-extern bool nameregexeq(NameData * n, struct varlena * p);
-extern bool nameregexne(NameData * s, struct varlena * p);
+extern bool nameregexeq(NameData *n, struct varlena * p);
+extern bool nameregexne(NameData *s, struct varlena * p);
extern bool textregexeq(struct varlena * s, struct varlena * p);
extern bool textregexne(struct varlena * s, struct varlena * p);
extern bool char2icregexeq(uint16 arg1, struct varlena * p);
extern bool char8icregexne(char *s, struct varlena * p);
extern bool char16icregexeq(char *s, struct varlena * p);
extern bool char16icregexne(char *s, struct varlena * p);
-extern bool nameicregexeq(NameData * s, struct varlena * p);
-extern bool nameicregexne(NameData * s, struct varlena * p);
+extern bool nameicregexeq(NameData *s, struct varlena * p);
+extern bool nameicregexne(NameData *s, struct varlena * p);
extern bool texticregexeq(struct varlena * s, struct varlena * p);
extern bool texticregexne(struct varlena * s, struct varlena * p);
extern char *byteaout(struct varlena * vlena);
extern struct varlena *textin(char *inputText);
extern char *textout(struct varlena * vlena);
-extern text *textcat(text * t1, text * t2);
+extern text *textcat(text *t1, text *t2);
extern bool texteq(struct varlena * arg1, struct varlena * arg2);
extern bool textne(struct varlena * arg1, struct varlena * arg2);
extern bool text_lt(struct varlena * arg1, struct varlena * arg2);
extern bool text_le(struct varlena * arg1, struct varlena * arg2);
extern bool text_gt(struct varlena * arg1, struct varlena * arg2);
extern bool text_ge(struct varlena * arg1, struct varlena * arg2);
-extern int32 textpos(text * t1, text * t2);
+extern int32 textpos(text *t1, text *t2);
extern int32 byteaGetSize(struct varlena * v);
extern int32 byteaGetByte(struct varlena * v, int32 n);
extern int32 byteaGetBit(struct varlena * v, int32 n);
extern DateADT date_pli(DateADT dateVal, int32 days);
extern DateADT date_mii(DateADT dateVal, int32 days);
extern DateTime *date_datetime(DateADT date);
-extern DateADT datetime_date(DateTime * datetime);
-extern DateTime *datetime_datetime(DateADT date, TimeADT * time);
+extern DateADT datetime_date(DateTime *datetime);
+extern DateTime *datetime_datetime(DateADT date, TimeADT *time);
extern DateADT abstime_date(AbsoluteTime abstime);
extern TimeADT *time_in(char *timestr);
-extern char *time_out(TimeADT * time);
-extern bool time_eq(TimeADT * time1, TimeADT * time2);
-extern bool time_ne(TimeADT * time1, TimeADT * time2);
-extern bool time_lt(TimeADT * time1, TimeADT * time2);
-extern bool time_le(TimeADT * time1, TimeADT * time2);
-extern bool time_gt(TimeADT * time1, TimeADT * time2);
-extern bool time_ge(TimeADT * time1, TimeADT * time2);
-extern int time_cmp(TimeADT * time1, TimeADT * time2);
+extern char *time_out(TimeADT *time);
+extern bool time_eq(TimeADT *time1, TimeADT *time2);
+extern bool time_ne(TimeADT *time1, TimeADT *time2);
+extern bool time_lt(TimeADT *time1, TimeADT *time2);
+extern bool time_le(TimeADT *time1, TimeADT *time2);
+extern bool time_gt(TimeADT *time1, TimeADT *time2);
+extern bool time_ge(TimeADT *time1, TimeADT *time2);
+extern int time_cmp(TimeADT *time1, TimeADT *time2);
extern int32 int42reltime(int32 timevalue);
/* like.c */
extern bool char8nlike(char *s, struct varlena * p);
extern bool char16like(char *s, struct varlena * p);
extern bool char16nlike(char *s, struct varlena * p);
-extern bool namelike(NameData * n, struct varlena * p);
-extern bool namenlike(NameData * s, struct varlena * p);
+extern bool namelike(NameData *n, struct varlena * p);
+extern bool namenlike(NameData *s, struct varlena * p);
extern bool textlike(struct varlena * s, struct varlena * p);
extern bool textnlike(struct varlena * s, struct varlena * p);
/* oracle_compat.c */
-extern text *lower(text * string);
-extern text *upper(text * string);
-extern text *initcap(text * string);
-extern text *lpad(text * string1, int4 len, text * string2);
-extern text *rpad(text * string1, int4 len, text * string2);
-extern text *ltrim(text * string, text * set);
-extern text *rtrim(text * string, text * set);
-extern text *substr(text * string, int4 m, int4 n);
-extern text *translate(text * string, char from, char to);
+extern text *lower(text *string);
+extern text *upper(text *string);
+extern text *initcap(text *string);
+extern text *lpad(text *string1, int4 len, text *string2);
+extern text *rpad(text *string1, int4 len, text *string2);
+extern text *ltrim(text *string, text *set);
+extern text *rtrim(text *string, text *set);
+extern text *substr(text *string, int4 m, int4 n);
+extern text *translate(text *string, char from, char to);
/* acl.c */
/* if we store this as 4 bytes, we better make it int, not long, bjm */
typedef signed int Cash;
-extern const char *cash_out(Cash * value);
+extern const char *cash_out(Cash *value);
extern Cash *cash_in(const char *str);
-extern bool cash_eq(Cash * c1, Cash * c2);
-extern bool cash_ne(Cash * c1, Cash * c2);
-extern bool cash_lt(Cash * c1, Cash * c2);
-extern bool cash_le(Cash * c1, Cash * c2);
-extern bool cash_gt(Cash * c1, Cash * c2);
-extern bool cash_ge(Cash * c1, Cash * c2);
+extern bool cash_eq(Cash *c1, Cash *c2);
+extern bool cash_ne(Cash *c1, Cash *c2);
+extern bool cash_lt(Cash *c1, Cash *c2);
+extern bool cash_le(Cash *c1, Cash *c2);
+extern bool cash_gt(Cash *c1, Cash *c2);
+extern bool cash_ge(Cash *c1, Cash *c2);
-extern Cash *cash_pl(Cash * c1, Cash * c2);
-extern Cash *cash_mi(Cash * c1, Cash * c2);
-extern Cash *cash_mul(Cash * c, float8 * f);
-extern Cash *cash_div(Cash * c, float8 * f);
+extern Cash *cash_pl(Cash *c1, Cash *c2);
+extern Cash *cash_mi(Cash *c1, Cash *c2);
+extern Cash *cash_mul(Cash *c, float8 *f);
+extern Cash *cash_div(Cash *c, float8 *f);
-extern Cash *cashlarger(Cash * c1, Cash * c2);
-extern Cash *cashsmaller(Cash * c1, Cash * c2);
+extern Cash *cashlarger(Cash *c1, Cash *c2);
+extern Cash *cashsmaller(Cash *c1, Cash *c2);
-extern const char *cash_words_out(Cash * value);
+extern const char *cash_words_out(Cash *value);
#endif /* CASH_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: catcache.h,v 1.7 1997/09/08 02:39:34 momjian Exp $
+ * $Id: catcache.h,v 1.8 1997/09/08 21:54:52 momjian Exp $
*
*-------------------------------------------------------------------------
*/
Dlelem *ct_node; /* points to LRU list is the CatCTup is in
* the cache, else, points to the cache if
* the CatCTup is in LRU list */
-} CatCTup;
+} CatCTup;
/* voodoo constants */
#define NCCBUCK 500 /* CatCache buckets */
Oid indexId;
char *cc_relname; /* relation name for defered open */
char *cc_indname; /* index name for defered open */
- HeapTuple(*cc_iscanfunc) (); /* index scanfunction */
+ HeapTuple (*cc_iscanfunc) (); /* index scanfunction */
TupleDesc cc_tupdesc; /* tuple descriptor from reldesc */
int id; /* XXX could be improved -hirohama */
short cc_ntup; /* # of tuples in this cache */
struct catcache *cc_next;
Dllist *cc_lrulist; /* LRU list, most recent first */
Dllist *cc_cache[NCCBUCK + 1];
-} CatCache;
+} CatCache;
#define InvalidCatalogCacheId (-1)
extern void ResetSystemCache(void);
extern CatCache *
InitSysCache(char *relname, char *indname, int id, int nkeys,
- int key[], HeapTuple(*iScanfuncP) ());
-extern HeapTuple
+ int key[], HeapTuple (*iScanfuncP) ());
+extern HeapTuple
SearchSysCache(struct catcache * cache, Datum v1, Datum v2,
Datum v3, Datum v4);
extern void
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: datum.h,v 1.4 1997/09/08 02:39:36 momjian Exp $
+ * $Id: datum.h,v 1.5 1997/09/08 21:54:53 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* return true if thwo datums are equal, false otherwise.
* XXX : See comments in the code for restrictions!
*/
-extern bool
+extern bool
datumIsEqual(Datum value1, Datum value2, Oid type,
bool byVal, Size len);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: dt.h,v 1.20 1997/09/08 02:39:37 momjian Exp $
+ * $Id: dt.h,v 1.21 1997/09/08 21:54:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* years */
int4 month; /* months and years, after time for
* alignment */
-} TimeSpan;
+} TimeSpan;
/* ----------------------------------------------------------------
#endif /* aix */
char type;
char value; /* this may be unsigned, alas */
-} datetkn;
+} datetkn;
#ifdef NAN
#define DT_INVALID (NAN)
*/
extern DateTime *datetime_in(char *str);
-extern char *datetime_out(DateTime * dt);
-extern bool datetime_eq(DateTime * dt1, DateTime * dt2);
-extern bool datetime_ne(DateTime * dt1, DateTime * dt2);
-extern bool datetime_lt(DateTime * dt1, DateTime * dt2);
-extern bool datetime_le(DateTime * dt1, DateTime * dt2);
-extern bool datetime_ge(DateTime * dt1, DateTime * dt2);
-extern bool datetime_gt(DateTime * dt1, DateTime * dt2);
-extern bool datetime_finite(DateTime * datetime);
-extern int datetime_cmp(DateTime * dt1, DateTime * dt2);
-extern DateTime *datetime_smaller(DateTime * dt1, DateTime * dt2);
-extern DateTime *datetime_larger(DateTime * dt1, DateTime * dt2);
+extern char *datetime_out(DateTime *dt);
+extern bool datetime_eq(DateTime *dt1, DateTime *dt2);
+extern bool datetime_ne(DateTime *dt1, DateTime *dt2);
+extern bool datetime_lt(DateTime *dt1, DateTime *dt2);
+extern bool datetime_le(DateTime *dt1, DateTime *dt2);
+extern bool datetime_ge(DateTime *dt1, DateTime *dt2);
+extern bool datetime_gt(DateTime *dt1, DateTime *dt2);
+extern bool datetime_finite(DateTime *datetime);
+extern int datetime_cmp(DateTime *dt1, DateTime *dt2);
+extern DateTime *datetime_smaller(DateTime *dt1, DateTime *dt2);
+extern DateTime *datetime_larger(DateTime *dt1, DateTime *dt2);
extern TimeSpan *timespan_in(char *str);
-extern char *timespan_out(TimeSpan * span);
-extern bool timespan_eq(TimeSpan * span1, TimeSpan * span2);
-extern bool timespan_ne(TimeSpan * span1, TimeSpan * span2);
-extern bool timespan_lt(TimeSpan * span1, TimeSpan * span2);
-extern bool timespan_le(TimeSpan * span1, TimeSpan * span2);
-extern bool timespan_ge(TimeSpan * span1, TimeSpan * span2);
-extern bool timespan_gt(TimeSpan * span1, TimeSpan * span2);
-extern int timespan_cmp(TimeSpan * span1, TimeSpan * span2);
-extern TimeSpan *timespan_smaller(TimeSpan * span1, TimeSpan * span2);
-extern TimeSpan *timespan_larger(TimeSpan * span1, TimeSpan * span2);
-
-extern text *datetime_text(DateTime * datetime);
-extern DateTime *text_datetime(text * str);
-extern text *timespan_text(TimeSpan * timespan);
-extern DateTime *datetime_trunc(text * units, DateTime * datetime);
-extern TimeSpan *timespan_trunc(text * units, TimeSpan * timespan);
-extern float64 datetime_part(text * units, DateTime * datetime);
-extern float64 timespan_part(text * units, TimeSpan * timespan);
-extern text *datetime_zone(text * zone, DateTime * datetime);
-
-extern TimeSpan *timespan_um(TimeSpan * span);
-extern TimeSpan *timespan_pl(TimeSpan * span1, TimeSpan * span2);
-extern TimeSpan *timespan_mi(TimeSpan * span1, TimeSpan * span2);
-extern TimeSpan *timespan_div(TimeSpan * span1, float8 * arg2);
-
-extern TimeSpan *datetime_mi(DateTime * dt1, DateTime * dt2);
-extern DateTime *datetime_pl_span(DateTime * dt, TimeSpan * span);
-extern DateTime *datetime_mi_span(DateTime * dt, TimeSpan * span);
-extern TimeSpan *datetime_age(DateTime * dt1, DateTime * dt2);
+extern char *timespan_out(TimeSpan *span);
+extern bool timespan_eq(TimeSpan *span1, TimeSpan *span2);
+extern bool timespan_ne(TimeSpan *span1, TimeSpan *span2);
+extern bool timespan_lt(TimeSpan *span1, TimeSpan *span2);
+extern bool timespan_le(TimeSpan *span1, TimeSpan *span2);
+extern bool timespan_ge(TimeSpan *span1, TimeSpan *span2);
+extern bool timespan_gt(TimeSpan *span1, TimeSpan *span2);
+extern int timespan_cmp(TimeSpan *span1, TimeSpan *span2);
+extern TimeSpan *timespan_smaller(TimeSpan *span1, TimeSpan *span2);
+extern TimeSpan *timespan_larger(TimeSpan *span1, TimeSpan *span2);
+
+extern text *datetime_text(DateTime *datetime);
+extern DateTime *text_datetime(text *str);
+extern text *timespan_text(TimeSpan *timespan);
+extern DateTime *datetime_trunc(text *units, DateTime *datetime);
+extern TimeSpan *timespan_trunc(text *units, TimeSpan *timespan);
+extern float64 datetime_part(text *units, DateTime *datetime);
+extern float64 timespan_part(text *units, TimeSpan *timespan);
+extern text *datetime_zone(text *zone, DateTime *datetime);
+
+extern TimeSpan *timespan_um(TimeSpan *span);
+extern TimeSpan *timespan_pl(TimeSpan *span1, TimeSpan *span2);
+extern TimeSpan *timespan_mi(TimeSpan *span1, TimeSpan *span2);
+extern TimeSpan *timespan_div(TimeSpan *span1, float8 *arg2);
+
+extern TimeSpan *datetime_mi(DateTime *dt1, DateTime *dt2);
+extern DateTime *datetime_pl_span(DateTime *dt, TimeSpan *span);
+extern DateTime *datetime_mi_span(DateTime *dt, TimeSpan *span);
+extern TimeSpan *datetime_age(DateTime *dt1, DateTime *dt2);
extern void GetCurrentTime(struct tm * tm);
extern DateTime SetDateTime(DateTime datetime);
-extern int tm2datetime(struct tm * tm, double fsec, int *tzp, DateTime * dt);
+extern int tm2datetime(struct tm * tm, double fsec, int *tzp, DateTime *dt);
extern void j2date(int jd, int *year, int *month, int *day);
extern int date2j(int year, int month, int day);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: dynamic_loader.h,v 1.7 1997/09/08 02:39:38 momjian Exp $
+ * $Id: dynamic_loader.h,v 1.8 1997/09/08 21:54:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
ino_t inode; /* Inode number of file */
void *handle; /* a handle for pg_dl* functions */
struct df_files *next;
-} DynamicFileList;
+} DynamicFileList;
extern void *pg_dlopen(char *filename);
extern func_ptr pg_dlsym(void *handle, char *funcname);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: exc.h,v 1.9 1997/09/08 02:39:41 momjian Exp $
+ * $Id: exc.h,v 1.10 1997/09/08 21:54:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
ExcDetail detail;
ExcData data;
ExcMessage message;
-} ExcFrame;
+} ExcFrame;
extern ExcFrame *ExcCurFrameP;
#define reraise() \
raise4(*exception.id,exception.detail,exception.data,exception.message)
-typedef void ExcProc(Exception *, ExcDetail, ExcData, ExcMessage);
+typedef void ExcProc (Exception *, ExcDetail, ExcData, ExcMessage);
/*
*/
extern void EnableExceptionHandling(bool on);
extern void
-ExcRaise(Exception * excP,
+ExcRaise(Exception *excP,
ExcDetail detail,
ExcData data,
ExcMessage message);
* prototypes for functions in excabort.c
*/
extern void
-ExcAbort(const Exception * excP, ExcDetail detail, ExcData data,
+ExcAbort(const Exception *excP, ExcDetail detail, ExcData data,
ExcMessage message);
#endif /* EXC_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: fcache.h,v 1.4 1997/09/08 02:39:43 momjian Exp $
+ * $Id: fcache.h,v 1.5 1997/09/08 21:54:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* of tuples */
bool istrusted; /* trusted fn? */
-} FunctionCache, *FunctionCachePtr;
+} FunctionCache,
+ *FunctionCachePtr;
#endif /* FCACHE_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: fcache2.h,v 1.4 1997/09/08 02:39:43 momjian Exp $
+ * $Id: fcache2.h,v 1.5 1997/09/08 21:55:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include <nodes/execnodes.h>
extern void
- setFcache(Node * node, Oid foid, List * argList, ExprContext * econtext);
+ setFcache(Node *node, Oid foid, List *argList, ExprContext *econtext);
#endif /* FCACHE2_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: fmgrtab.h,v 1.6 1997/09/08 02:39:44 momjian Exp $
+ * $Id: fmgrtab.h,v 1.7 1997/09/08 21:55:04 momjian Exp $
*
*-------------------------------------------------------------------------
*/
uint16 nargs;
func_ptr func;
char *funcName;
-} FmgrCall;
+} FmgrCall;
extern FmgrCall *fmgr_isbuiltin(Oid id);
extern func_ptr fmgr_lookupByName(char *name);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: geo_decls.h,v 1.11 1997/09/08 20:59:21 momjian Exp $
+ * $Id: geo_decls.h,v 1.12 1997/09/08 21:55:06 momjian Exp $
*
* NOTE
* These routines do *not* use the float types from adt/.
{
double x,
y;
-} Point;
+} Point;
/*---------------------------------------------------------------------
Point p[2];
double m; /* precomputed to save time, not in tuple */
-} LSEG;
+} LSEG;
/*---------------------------------------------------------------------
int32 closed; /* is this a closed polygon? */
int32 dummy; /* padding to make it double align */
Point p[1]; /* variable length array of POINTs */
-} PATH;
+} PATH;
/*---------------------------------------------------------------------
C;
double m;
-} LINE;
+} LINE;
/*---------------------------------------------------------------------
int32 npts;
BOX boundbox;
Point p[1]; /* variable length array of POINTs */
-} POLYGON;
+} POLYGON;
/*---------------------------------------------------------------------
* CIRCLE - Specified by a center point and radius.
{
Point center;
double radius;
-} CIRCLE;
+} CIRCLE;
/*
* in geo_ops.h
/* public point routines */
extern Point *point_in(char *str);
-extern char *point_out(Point * pt);
-extern bool point_left(Point * pt1, Point * pt2);
-extern bool point_right(Point * pt1, Point * pt2);
-extern bool point_above(Point * pt1, Point * pt2);
-extern bool point_below(Point * pt1, Point * pt2);
-extern bool point_vert(Point * pt1, Point * pt2);
-extern bool point_horiz(Point * pt1, Point * pt2);
-extern bool point_eq(Point * pt1, Point * pt2);
-extern int32 pointdist(Point * p1, Point * p2);
-extern double *point_distance(Point * pt1, Point * pt2);
-extern double *point_slope(Point * pt1, Point * pt2);
+extern char *point_out(Point *pt);
+extern bool point_left(Point *pt1, Point *pt2);
+extern bool point_right(Point *pt1, Point *pt2);
+extern bool point_above(Point *pt1, Point *pt2);
+extern bool point_below(Point *pt1, Point *pt2);
+extern bool point_vert(Point *pt1, Point *pt2);
+extern bool point_horiz(Point *pt1, Point *pt2);
+extern bool point_eq(Point *pt1, Point *pt2);
+extern int32 pointdist(Point *p1, Point *p2);
+extern double *point_distance(Point *pt1, Point *pt2);
+extern double *point_slope(Point *pt1, Point *pt2);
/* private routines */
-extern double point_dt(Point * pt1, Point * pt2);
-extern double point_sl(Point * pt1, Point * pt2);
+extern double point_dt(Point *pt1, Point *pt2);
+extern double point_sl(Point *pt1, Point *pt2);
-extern Point *point(float8 * x, float8 * y);
-extern Point *point_add(Point * p1, Point * p2);
-extern Point *point_sub(Point * p1, Point * p2);
-extern Point *point_mul(Point * p1, Point * p2);
-extern Point *point_div(Point * p1, Point * p2);
+extern Point *point(float8 *x, float8 *y);
+extern Point *point_add(Point *p1, Point *p2);
+extern Point *point_sub(Point *p1, Point *p2);
+extern Point *point_mul(Point *p1, Point *p2);
+extern Point *point_div(Point *p1, Point *p2);
/* public lseg routines */
extern LSEG *lseg_in(char *str);
-extern char *lseg_out(LSEG * ls);
-extern bool lseg_intersect(LSEG * l1, LSEG * l2);
-extern bool lseg_parallel(LSEG * l1, LSEG * l2);
-extern bool lseg_perp(LSEG * l1, LSEG * l2);
-extern bool lseg_vertical(LSEG * lseg);
-extern bool lseg_horizontal(LSEG * lseg);
-extern bool lseg_eq(LSEG * l1, LSEG * l2);
-extern double *lseg_distance(LSEG * l1, LSEG * l2);
-extern Point *lseg_center(LSEG * lseg);
-extern Point *lseg_interpt(LSEG * l1, LSEG * l2);
-extern double *dist_pl(Point * pt, LINE * line);
-extern double *dist_ps(Point * pt, LSEG * lseg);
-extern double *dist_ppath(Point * pt, PATH * path);
-extern double *dist_pb(Point * pt, BOX *box);
-extern double *dist_sl(LSEG * lseg, LINE * line);
-extern double *dist_sb(LSEG * lseg, BOX *box);
-extern double *dist_lb(LINE * line, BOX *box);
-extern Point *close_pl(Point * pt, LINE * line);
-extern Point *close_ps(Point * pt, LSEG * lseg);
-extern Point *close_pb(Point * pt, BOX *box);
-extern Point *close_sl(LSEG * lseg, LINE * line);
-extern Point *close_sb(LSEG * lseg, BOX *box);
-extern Point *close_lb(LINE * line, BOX *box);
-extern bool on_pl(Point * pt, LINE * line);
-extern bool on_ps(Point * pt, LSEG * lseg);
-extern bool on_pb(Point * pt, BOX *box);
-extern bool on_ppath(Point * pt, PATH * path);
-extern bool on_sl(LSEG * lseg, LINE * line);
-extern bool on_sb(LSEG * lseg, BOX *box);
-extern bool inter_sl(LSEG * lseg, LINE * line);
-extern bool inter_sb(LSEG * lseg, BOX *box);
-extern bool inter_lb(LINE * line, BOX *box);
+extern char *lseg_out(LSEG *ls);
+extern bool lseg_intersect(LSEG *l1, LSEG *l2);
+extern bool lseg_parallel(LSEG *l1, LSEG *l2);
+extern bool lseg_perp(LSEG *l1, LSEG *l2);
+extern bool lseg_vertical(LSEG *lseg);
+extern bool lseg_horizontal(LSEG *lseg);
+extern bool lseg_eq(LSEG *l1, LSEG *l2);
+extern double *lseg_distance(LSEG *l1, LSEG *l2);
+extern Point *lseg_center(LSEG *lseg);
+extern Point *lseg_interpt(LSEG *l1, LSEG *l2);
+extern double *dist_pl(Point *pt, LINE *line);
+extern double *dist_ps(Point *pt, LSEG *lseg);
+extern double *dist_ppath(Point *pt, PATH *path);
+extern double *dist_pb(Point *pt, BOX *box);
+extern double *dist_sl(LSEG *lseg, LINE *line);
+extern double *dist_sb(LSEG *lseg, BOX *box);
+extern double *dist_lb(LINE *line, BOX *box);
+extern Point *close_pl(Point *pt, LINE *line);
+extern Point *close_ps(Point *pt, LSEG *lseg);
+extern Point *close_pb(Point *pt, BOX *box);
+extern Point *close_sl(LSEG *lseg, LINE *line);
+extern Point *close_sb(LSEG *lseg, BOX *box);
+extern Point *close_lb(LINE *line, BOX *box);
+extern bool on_pl(Point *pt, LINE *line);
+extern bool on_ps(Point *pt, LSEG *lseg);
+extern bool on_pb(Point *pt, BOX *box);
+extern bool on_ppath(Point *pt, PATH *path);
+extern bool on_sl(LSEG *lseg, LINE *line);
+extern bool on_sb(LSEG *lseg, BOX *box);
+extern bool inter_sl(LSEG *lseg, LINE *line);
+extern bool inter_sb(LSEG *lseg, BOX *box);
+extern bool inter_lb(LINE *line, BOX *box);
/* private routines */
-extern LSEG *lseg_construct(Point * pt1, Point * pt2);
+extern LSEG *lseg_construct(Point *pt1, Point *pt2);
/* public box routines */
extern BOX *box_in(char *str);
extern double box_dt(BOX *box1, BOX *box2);
-extern BOX *box(Point * p1, Point * p2);
-extern BOX *box_add(BOX *box, Point * p);
-extern BOX *box_sub(BOX *box, Point * p);
-extern BOX *box_mul(BOX *box, Point * p);
-extern BOX *box_div(BOX *box, Point * p);
+extern BOX *box(Point *p1, Point *p2);
+extern BOX *box_add(BOX *box, Point *p);
+extern BOX *box_sub(BOX *box, Point *p);
+extern BOX *box_mul(BOX *box, Point *p);
+extern BOX *box_div(BOX *box, Point *p);
/* private line routines */
-extern double *line_distance(LINE * l1, LINE * l2);
+extern double *line_distance(LINE *l1, LINE *l2);
/* public path routines */
extern PATH *path_in(char *str);
-extern char *path_out(PATH * path);
-extern bool path_n_lt(PATH * p1, PATH * p2);
-extern bool path_n_gt(PATH * p1, PATH * p2);
-extern bool path_n_eq(PATH * p1, PATH * p2);
-extern bool path_n_le(PATH * p1, PATH * p2);
-extern bool path_n_ge(PATH * p1, PATH * p2);
-extern bool path_inter(PATH * p1, PATH * p2);
-extern double *path_distance(PATH * p1, PATH * p2);
-extern double *path_length(PATH * path);
-
-extern bool path_isclosed(PATH * path);
-extern bool path_isopen(PATH * path);
-extern int4 path_npoints(PATH * path);
-
-extern PATH *path_close(PATH * path);
-extern PATH *path_open(PATH * path);
-extern PATH *path_add(PATH * p1, PATH * p2);
-extern PATH *path_add_pt(PATH * path, Point * point);
-extern PATH *path_sub_pt(PATH * path, Point * point);
-extern PATH *path_mul_pt(PATH * path, Point * point);
-extern PATH *path_div_pt(PATH * path, Point * point);
-extern bool path_contain_pt(PATH * path, Point * p);
-extern bool pt_contained_path(Point * p, PATH * path);
-
-extern Point *path_center(PATH * path);
-extern POLYGON *path_poly(PATH * path);
-
-extern PATH *upgradepath(PATH * path);
-extern bool isoldpath(PATH * path);
+extern char *path_out(PATH *path);
+extern bool path_n_lt(PATH *p1, PATH *p2);
+extern bool path_n_gt(PATH *p1, PATH *p2);
+extern bool path_n_eq(PATH *p1, PATH *p2);
+extern bool path_n_le(PATH *p1, PATH *p2);
+extern bool path_n_ge(PATH *p1, PATH *p2);
+extern bool path_inter(PATH *p1, PATH *p2);
+extern double *path_distance(PATH *p1, PATH *p2);
+extern double *path_length(PATH *path);
+
+extern bool path_isclosed(PATH *path);
+extern bool path_isopen(PATH *path);
+extern int4 path_npoints(PATH *path);
+
+extern PATH *path_close(PATH *path);
+extern PATH *path_open(PATH *path);
+extern PATH *path_add(PATH *p1, PATH *p2);
+extern PATH *path_add_pt(PATH *path, Point *point);
+extern PATH *path_sub_pt(PATH *path, Point *point);
+extern PATH *path_mul_pt(PATH *path, Point *point);
+extern PATH *path_div_pt(PATH *path, Point *point);
+extern bool path_contain_pt(PATH *path, Point *p);
+extern bool pt_contained_path(Point *p, PATH *path);
+
+extern Point *path_center(PATH *path);
+extern POLYGON *path_poly(PATH *path);
+
+extern PATH *upgradepath(PATH *path);
+extern bool isoldpath(PATH *path);
/* public polygon routines */
extern POLYGON *poly_in(char *s);
-extern char *poly_out(POLYGON * poly);
-extern bool poly_left(POLYGON * polya, POLYGON * polyb);
-extern bool poly_overleft(POLYGON * polya, POLYGON * polyb);
-extern bool poly_right(POLYGON * polya, POLYGON * polyb);
-extern bool poly_overright(POLYGON * polya, POLYGON * polyb);
-extern bool poly_same(POLYGON * polya, POLYGON * polyb);
-extern bool poly_overlap(POLYGON * polya, POLYGON * polyb);
-extern bool poly_contain(POLYGON * polya, POLYGON * polyb);
-extern bool poly_contained(POLYGON * polya, POLYGON * polyb);
-extern bool poly_contain_pt(POLYGON * poly, Point * p);
-extern bool pt_contained_poly(Point * p, POLYGON * poly);
-
-extern double *poly_distance(POLYGON * polya, POLYGON * polyb);
-extern int4 poly_npoints(POLYGON * poly);
-extern Point *poly_center(POLYGON * poly);
-extern BOX *poly_box(POLYGON * poly);
-extern PATH *poly_path(POLYGON * poly);
+extern char *poly_out(POLYGON *poly);
+extern bool poly_left(POLYGON *polya, POLYGON *polyb);
+extern bool poly_overleft(POLYGON *polya, POLYGON *polyb);
+extern bool poly_right(POLYGON *polya, POLYGON *polyb);
+extern bool poly_overright(POLYGON *polya, POLYGON *polyb);
+extern bool poly_same(POLYGON *polya, POLYGON *polyb);
+extern bool poly_overlap(POLYGON *polya, POLYGON *polyb);
+extern bool poly_contain(POLYGON *polya, POLYGON *polyb);
+extern bool poly_contained(POLYGON *polya, POLYGON *polyb);
+extern bool poly_contain_pt(POLYGON *poly, Point *p);
+extern bool pt_contained_poly(Point *p, POLYGON *poly);
+
+extern double *poly_distance(POLYGON *polya, POLYGON *polyb);
+extern int4 poly_npoints(POLYGON *poly);
+extern Point *poly_center(POLYGON *poly);
+extern BOX *poly_box(POLYGON *poly);
+extern PATH *poly_path(POLYGON *poly);
extern POLYGON *box_poly(BOX *box);
-extern POLYGON *upgradepoly(POLYGON * poly);
-extern POLYGON *revertpoly(POLYGON * poly);
+extern POLYGON *upgradepoly(POLYGON *poly);
+extern POLYGON *revertpoly(POLYGON *poly);
/* private polygon routines */
/* public circle routines */
extern CIRCLE *circle_in(char *str);
-extern char *circle_out(CIRCLE * circle);
-extern bool circle_same(CIRCLE * circle1, CIRCLE * circle2);
-extern bool circle_overlap(CIRCLE * circle1, CIRCLE * circle2);
-extern bool circle_overleft(CIRCLE * circle1, CIRCLE * circle2);
-extern bool circle_left(CIRCLE * circle1, CIRCLE * circle2);
-extern bool circle_right(CIRCLE * circle1, CIRCLE * circle2);
-extern bool circle_overright(CIRCLE * circle1, CIRCLE * circle2);
-extern bool circle_contained(CIRCLE * circle1, CIRCLE * circle2);
-extern bool circle_contain(CIRCLE * circle1, CIRCLE * circle2);
-extern bool circle_below(CIRCLE * circle1, CIRCLE * circle2);
-extern bool circle_above(CIRCLE * circle1, CIRCLE * circle2);
-
-extern bool circle_eq(CIRCLE * circle1, CIRCLE * circle2);
-extern bool circle_ne(CIRCLE * circle1, CIRCLE * circle2);
-extern bool circle_lt(CIRCLE * circle1, CIRCLE * circle2);
-extern bool circle_gt(CIRCLE * circle1, CIRCLE * circle2);
-extern bool circle_le(CIRCLE * circle1, CIRCLE * circle2);
-extern bool circle_ge(CIRCLE * circle1, CIRCLE * circle2);
-extern bool circle_contain_pt(CIRCLE * circle, Point * point);
-extern bool pt_contained_circle(Point * point, CIRCLE * circle);
-extern CIRCLE *circle_add_pt(CIRCLE * circle, Point * point);
-extern CIRCLE *circle_sub_pt(CIRCLE * circle, Point * point);
-extern CIRCLE *circle_mul_pt(CIRCLE * circle, Point * point);
-extern CIRCLE *circle_div_pt(CIRCLE * circle, Point * point);
-extern double *circle_diameter(CIRCLE * circle);
-extern double *circle_radius(CIRCLE * circle);
-extern double *circle_distance(CIRCLE * circle1, CIRCLE * circle2);
-extern double *dist_pc(Point * point, CIRCLE * circle);
-extern double *dist_cpoly(CIRCLE * circle, POLYGON * poly);
-extern Point *circle_center(CIRCLE * circle);
-extern CIRCLE *circle(Point * center, float8 * radius);
+extern char *circle_out(CIRCLE *circle);
+extern bool circle_same(CIRCLE *circle1, CIRCLE *circle2);
+extern bool circle_overlap(CIRCLE *circle1, CIRCLE *circle2);
+extern bool circle_overleft(CIRCLE *circle1, CIRCLE *circle2);
+extern bool circle_left(CIRCLE *circle1, CIRCLE *circle2);
+extern bool circle_right(CIRCLE *circle1, CIRCLE *circle2);
+extern bool circle_overright(CIRCLE *circle1, CIRCLE *circle2);
+extern bool circle_contained(CIRCLE *circle1, CIRCLE *circle2);
+extern bool circle_contain(CIRCLE *circle1, CIRCLE *circle2);
+extern bool circle_below(CIRCLE *circle1, CIRCLE *circle2);
+extern bool circle_above(CIRCLE *circle1, CIRCLE *circle2);
+
+extern bool circle_eq(CIRCLE *circle1, CIRCLE *circle2);
+extern bool circle_ne(CIRCLE *circle1, CIRCLE *circle2);
+extern bool circle_lt(CIRCLE *circle1, CIRCLE *circle2);
+extern bool circle_gt(CIRCLE *circle1, CIRCLE *circle2);
+extern bool circle_le(CIRCLE *circle1, CIRCLE *circle2);
+extern bool circle_ge(CIRCLE *circle1, CIRCLE *circle2);
+extern bool circle_contain_pt(CIRCLE *circle, Point *point);
+extern bool pt_contained_circle(Point *point, CIRCLE *circle);
+extern CIRCLE *circle_add_pt(CIRCLE *circle, Point *point);
+extern CIRCLE *circle_sub_pt(CIRCLE *circle, Point *point);
+extern CIRCLE *circle_mul_pt(CIRCLE *circle, Point *point);
+extern CIRCLE *circle_div_pt(CIRCLE *circle, Point *point);
+extern double *circle_diameter(CIRCLE *circle);
+extern double *circle_radius(CIRCLE *circle);
+extern double *circle_distance(CIRCLE *circle1, CIRCLE *circle2);
+extern double *dist_pc(Point *point, CIRCLE *circle);
+extern double *dist_cpoly(CIRCLE *circle, POLYGON *poly);
+extern Point *circle_center(CIRCLE *circle);
+extern CIRCLE *circle(Point *center, float8 *radius);
extern CIRCLE *box_circle(BOX *box);
-extern BOX *circle_box(CIRCLE * circle);
-extern CIRCLE *poly_circle(POLYGON * poly);
-extern POLYGON *circle_poly(int npts, CIRCLE * circle);
+extern BOX *circle_box(CIRCLE *circle);
+extern CIRCLE *poly_circle(POLYGON *poly);
+extern POLYGON *circle_poly(int npts, CIRCLE *circle);
/* private routines */
-extern double *circle_area(CIRCLE * circle);
-extern double circle_dt(CIRCLE * circle1, CIRCLE * circle2);
+extern double *circle_area(CIRCLE *circle);
+extern double circle_dt(CIRCLE *circle1, CIRCLE *circle2);
/* geo_selfuncs.c */
-extern float64
+extern float64
areasel(Oid opid, Oid relid, AttrNumber attno,
char *value, int32 flag);
-extern float64
+extern float64
areajoinsel(Oid opid, Oid relid, AttrNumber attno,
char *value, int32 flag);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: hsearch.h,v 1.5 1997/09/08 02:39:47 momjian Exp $
+ * $Id: hsearch.h,v 1.6 1997/09/08 21:55:07 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
unsigned long next; /* secret from user */
long key;
-} ELEMENT;
+} ELEMENT;
typedef unsigned long BUCKET_INDEX;
long accesses;
long collisions;
#endif
-} HHDR;
+} HHDR;
typedef struct htab
{
long *(*alloc) (); /* memory allocator (long * for alignment
* reasons) */
-} HTAB;
+} HTAB;
typedef struct hashctl
{
long *dir; /* directory if allocated already */
long *hctl; /* location of header information in shd
* mem */
-} HASHCTL;
+} HASHCTL;
/* Flags to indicate action for hctl */
#define HASH_BUCKET 0x001 /* Setting bucket size */
HASH_REMOVE,
HASH_FIND_SAVE,
HASH_REMOVE_SAVED
-} HASHACTION;
+} HASHACTION;
/*
* prototypes from functions in dynahash.c
*/
-extern HTAB *hash_create(int nelem, HASHCTL * info, int flags);
-extern void hash_destroy(HTAB * hashp);
-extern void hash_stats(char *where, HTAB * hashp);
+extern HTAB *hash_create(int nelem, HASHCTL *info, int flags);
+extern void hash_destroy(HTAB *hashp);
+extern void hash_stats(char *where, HTAB *hashp);
extern long *
-hash_search(HTAB * hashp, char *keyPtr, HASHACTION action,
- bool * foundPtr);
-extern long *hash_seq(HTAB * hashp);
+hash_search(HTAB *hashp, char *keyPtr, HASHACTION action,
+ bool *foundPtr);
+extern long *hash_seq(HTAB *hashp);
/*
* prototypes from functions in hashfn.c
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: inval.h,v 1.6 1997/09/08 02:39:48 momjian Exp $
+ * $Id: inval.h,v 1.7 1997/09/08 21:55:08 momjian Exp $
*
*-------------------------------------------------------------------------
*/
typedef struct InvalidationUserData
{
struct InvalidationUserData *dataP[1]; /* VARIABLE LENGTH */
-} InvalidationUserData; /* VARIABLE LENGTH STRUCTURE */
+} InvalidationUserData; /* VARIABLE LENGTH STRUCTURE */
typedef struct InvalidationEntryData
{
InvalidationUserData *nextP;
InvalidationUserData userData; /* VARIABLE LENGTH ARRAY */
-} InvalidationEntryData; /* VARIABLE LENGTH STRUCTURE */
+} InvalidationEntryData; /* VARIABLE LENGTH STRUCTURE */
typedef Pointer InvalidationEntry;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: lselect.h,v 1.6 1997/09/08 02:39:48 momjian Exp $
+ * $Id: lselect.h,v 1.7 1997/09/08 21:55:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/
int nKeys;
ScanKey scanKeys;
int sortMem; /* needed for psort */
-} LeftistContextData;
+} LeftistContextData;
typedef LeftistContextData *LeftistContext;
extern struct leftist *
lmerge(struct leftist * pt, struct leftist * qt,
LeftistContext context);
-extern HeapTuple
+extern HeapTuple
gettuple(struct leftist ** treep, short *devnum,
LeftistContext context);
extern void
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: lsyscache.h,v 1.5 1997/09/08 02:39:49 momjian Exp $
+ * $Id: lsyscache.h,v 1.6 1997/09/08 21:55:11 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern bool get_attisset(Oid relid, char *attname);
extern RegProcedure get_opcode(Oid opid);
extern char *get_opname(Oid opid);
-extern bool
+extern bool
op_mergesortable(Oid opid, Oid ltype, Oid rtype,
- Oid * leftOp, Oid * rightOp);
+ Oid *leftOp, Oid *rightOp);
extern Oid op_hashjoinable(Oid opid, Oid ltype, Oid rtype);
extern Oid get_commutator(Oid opid);
extern HeapTuple get_operator_tuple(Oid opno);
extern RegProcedure get_oprjoin(Oid opid);
extern int get_relnatts(Oid relid);
extern char *get_rel_name(Oid relid);
-extern struct varlena *get_relstub(Oid relid, int no, bool * islast);
+extern struct varlena *get_relstub(Oid relid, int no, bool *islast);
extern Oid get_ruleid(char *rulename);
extern Oid get_eventrelid(Oid ruleid);
extern int16 get_typlen(Oid typid);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: mcxt.h,v 1.7 1997/09/08 02:39:49 momjian Exp $
+ * $Id: mcxt.h,v 1.8 1997/09/08 21:55:11 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*/
extern void EnableMemoryContext(bool on);
extern Pointer MemoryContextAlloc(MemoryContext context, Size size);
-extern Pointer
+extern Pointer
MemoryContextRealloc(MemoryContext context,
Pointer pointer,
Size size);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nabstime.h,v 1.12 1997/09/08 02:39:51 momjian Exp $
+ * $Id: nabstime.h,v 1.13 1997/09/08 21:55:13 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
int32 status;
AbsoluteTime data[2];
-} TimeIntervalData;
+} TimeIntervalData;
typedef TimeIntervalData *TimeInterval;
/*
extern bool abstimege(AbsoluteTime t1, AbsoluteTime t2);
extern bool abstime_finite(AbsoluteTime time);
-extern AbsoluteTime datetime_abstime(DateTime * datetime);
+extern AbsoluteTime datetime_abstime(DateTime *datetime);
extern DateTime *abstime_datetime(AbsoluteTime abstime);
extern bool AbsoluteTimeIsBefore(AbsoluteTime time1, AbsoluteTime time2);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: portal.h,v 1.6 1997/09/08 02:39:53 momjian Exp $
+ * $Id: portal.h,v 1.7 1997/09/08 21:55:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
AllocSetData setData;
FixedItemData itemData;
-} PortalBlockData;
+} PortalBlockData;
typedef PortalBlockData *PortalBlock;
extern Portal GetPortalByName(char *name);
extern Portal BlankPortalAssignName(char *name);
extern void
-PortalSetQuery(Portal portal, QueryDesc * queryDesc,
- TupleDesc attinfo, EState * state,
+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 PortalDestroy(Portal *portalP);
extern void StartPortalAllocMode(AllocMode mode, Size limit);
extern void EndPortalAllocMode(void);
extern PortalVariableMemory PortalGetVariableMemory(Portal portal);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: psort.h,v 1.9 1997/09/08 02:39:54 momjian Exp $
+ * $Id: psort.h,v 1.10 1997/09/08 21:55:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
bool using_tape_files;
HeapTuple *memtuples;
-} Psortstate;
+} Psortstate;
#ifdef EBUG
#include <stdio.h>
#endif
/* psort.c */
-extern bool psort_begin(Sort * node, int nkeys, ScanKey key);
-extern HeapTuple psort_grabtuple(Sort * node);
-extern void psort_markpos(Sort * node);
-extern void psort_restorepos(Sort * node);
-extern void psort_end(Sort * node);
+extern bool psort_begin(Sort *node, int nkeys, ScanKey key);
+extern HeapTuple psort_grabtuple(Sort *node);
+extern void psort_markpos(Sort *node);
+extern void psort_restorepos(Sort *node);
+extern void psort_end(Sort *node);
#endif /* PSORT_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: rel.h,v 1.11 1997/09/08 02:39:55 momjian Exp $
+ * $Id: rel.h,v 1.12 1997/09/08 21:55:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
int16 tgnargs;
int16 tgattr[8];
char **tgargs;
-} Trigger;
+} Trigger;
typedef struct TriggerDesc
{
Trigger **tg_after_row[4];
Trigger **tg_after_statement[4];
Trigger *triggers;
-} TriggerDesc;
+} TriggerDesc;
typedef struct RelationData
{
IndexStrategy rd_istrat;
RegProcedure *rd_support;
TriggerDesc *trigdesc;
-} RelationData;
+} RelationData;
typedef RelationData *Relation;
extern void
RelationSetIndexSupport(Relation relation, IndexStrategy strategy,
- RegProcedure * support);
+ RegProcedure *support);
#endif /* REL_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: rel2.h,v 1.3 1997/09/07 05:02:58 momjian Exp $
+ * $Id: rel2.h,v 1.4 1997/09/08 21:55:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern void
RelationSetIndexSupport(Relation relation, IndexStrategy strategy,
- RegProcedure * support);
+ RegProcedure *support);
#endif /* TMP_REL2_H */
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: syscache.h,v 1.6 1997/09/08 02:39:58 momjian Exp $
+ * $Id: syscache.h,v 1.7 1997/09/08 21:55:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
int size; /* sizeof(appropriate struct) */
char *indname; /* index relation for this cache, if
* exists */
- HeapTuple(*iScanFunc) (); /* function to handle
- * index scans */
+ HeapTuple (*iScanFunc) ();/* function to handle index scans */
};
extern void zerocaches(void);
extern void InitCatalogCache(void);
-extern HeapTuple
+extern HeapTuple
SearchSysCacheTuple(int cacheId, Datum key1, Datum key2,
Datum key3, Datum key4);
-extern int32
+extern int32
SearchSysCacheStruct(int cacheId, char *returnStruct,
Datum key1, Datum key2, Datum key3, Datum key4);
extern void *
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: tqual.h,v 1.8 1997/09/08 02:39:59 momjian Exp $
+ * $Id: tqual.h,v 1.9 1997/09/08 21:55:19 momjian Exp $
*
* NOTE
* It may be desirable to allow time qualifications to indicate
typedef struct TimeQualSpace
{
char data[12];
-} TimeQualSpace;
+} TimeQualSpace;
typedef Pointer TimeQual;
extern bool heapisoverride(void);
extern TimeQual TimeFormSnapshotTimeQual(AbsoluteTime time);
-extern TimeQual
+extern TimeQual
TimeFormRangedTimeQual(AbsoluteTime startTime,
AbsoluteTime endTime);
extern bool HeapTupleSatisfiesTimeQual(HeapTuple tuple, TimeQual qual);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclId.c,v 1.5 1997/09/08 02:40:17 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclId.c,v 1.6 1997/09/08 21:55:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* Create the Id for a new connection and hash it
*/
void
-PgSetConnectionId(Pg_clientData * cd, char *id, PGconn * conn)
+PgSetConnectionId(Pg_clientData * cd, char *id, PGconn *conn)
{
Tcl_HashEntry *hent;
Pg_ConnectionId *connid;
* Create a new result Id and hash it
*/
void
-PgSetResultId(Pg_clientData * cd, char *id, char *connid_c, PGresult * res)
+PgSetResultId(Pg_clientData * cd, char *id, char *connid_c, PGresult *res)
{
Tcl_HashEntry *hent;
Pg_ConnectionId *connid;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: pgtclId.h,v 1.4 1997/09/08 02:40:17 momjian Exp $
+ * $Id: pgtclId.h,v 1.5 1997/09/08 21:55:26 momjian Exp $
*
*-------------------------------------------------------------------------
*/
-extern void PgSetConnectionId(Pg_clientData * cd, char *id, PGconn * conn);
+extern void PgSetConnectionId(Pg_clientData * cd, char *id, PGconn *conn);
extern PGconn *PgGetConnectionId(Pg_clientData * cd, char *id);
extern void PgDelConnectionId(Pg_clientData * cd, char *id);
-extern void PgSetResultId(Pg_clientData * cd, char *id, char *connid, PGresult * res);
+extern void PgSetResultId(Pg_clientData * cd, char *id, char *connid, PGresult *res);
extern PGresult *PgGetResultId(Pg_clientData * cd, char *id);
extern void PgDelResultId(Pg_clientData * cd, char *id);
extern void PgGetConnByResultId(Pg_clientData * cd, char *id, char *resid);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.10 1997/09/08 02:40:21 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.11 1997/09/08 21:55:32 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#endif /* KRB5 */
static int
-pg_password_sendauth(Port * port, const char *user, const char *password)
+pg_password_sendauth(Port *port, const char *user, const char *password)
{
PacketBuf buf;
char *tmp;
* fe_sendauth -- client demux routine for outgoing authentication information
*/
int
-fe_sendauth(MsgType msgtype, Port * port, const char *hostname,
+fe_sendauth(MsgType msgtype, Port *port, const char *hostname,
const char *user, const char *password, const char *PQerrormsg)
{
switch (msgtype)
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: fe-auth.h,v 1.5 1997/09/08 02:40:23 momjian Exp $
+ * $Id: fe-auth.h,v 1.6 1997/09/08 21:55:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#endif /* KRB4 || KRB5 */
extern int
-fe_sendauth(MsgType msgtype, Port * port, const char *hostname,
+fe_sendauth(MsgType msgtype, Port *port, const char *hostname,
const char *user, const char *password,
const char *PQerromsg);
extern void fe_setauthsvc(const char *name, char *PQerrormsg);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.40 1997/09/08 02:40:25 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.41 1997/09/08 21:55:36 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* use a local version instead of the one found in pqpacket.c */
-static ConnStatusType connectDB(PGconn * conn);
+static ConnStatusType connectDB(PGconn *conn);
-static void startup2PacketBuf(StartupInfo * s, PacketBuf * res);
-static void freePGconn(PGconn * conn);
-static void closePGconn(PGconn * conn);
+static void startup2PacketBuf(StartupInfo *s, PacketBuf *res);
+static void freePGconn(PGconn *conn);
+static void closePGconn(PGconn *conn);
static int conninfo_parse(const char *conninfo, char *errorMessage);
static char *conninfo_getval(char *keyword);
static void conninfo_free(void);
*
*/
static ConnStatusType
-connectDB(PGconn * conn)
+connectDB(PGconn *conn)
{
struct hostent *hp;
*
*/
static void
-freePGconn(PGconn * conn)
+freePGconn(PGconn *conn)
{
if (!conn)
return;
- properly close a connection to the backend
*/
static void
-closePGconn(PGconn * conn)
+closePGconn(PGconn *conn)
{
/* GH: What to do for !USE_POSIX_SIGNALS ? */
#if defined(USE_POSIX_SIGNALS)
after this
*/
void
-PQfinish(PGconn * conn)
+PQfinish(PGconn *conn)
{
if (!conn)
{
closes the existing connection and makes a new one
*/
void
-PQreset(PGconn * conn)
+PQreset(PGconn *conn)
{
if (!conn)
{
*
*/
int
-packetSend(Port * port,
- PacketBuf * buf,
+packetSend(Port *port,
+ PacketBuf *buf,
PacketLen len,
bool nonBlocking)
{
* converts a StartupInfo structure to a PacketBuf
*/
static void
-startup2PacketBuf(StartupInfo * s, PacketBuf * res)
+startup2PacketBuf(StartupInfo *s, PacketBuf *res)
{
char *tmp;
/* =========== accessor functions for PGconn ========= */
char *
-PQdb(PGconn * conn)
+PQdb(PGconn *conn)
{
if (!conn)
{
}
char *
-PQuser(PGconn * conn)
+PQuser(PGconn *conn)
{
if (!conn)
{
}
char *
-PQhost(PGconn * conn)
+PQhost(PGconn *conn)
{
if (!conn)
{
}
char *
-PQoptions(PGconn * conn)
+PQoptions(PGconn *conn)
{
if (!conn)
{
}
char *
-PQtty(PGconn * conn)
+PQtty(PGconn *conn)
{
if (!conn)
{
}
char *
-PQport(PGconn * conn)
+PQport(PGconn *conn)
{
if (!conn)
{
}
ConnStatusType
-PQstatus(PGconn * conn)
+PQstatus(PGconn *conn)
{
if (!conn)
{
}
char *
-PQerrorMessage(PGconn * conn)
+PQerrorMessage(PGconn *conn)
{
if (!conn)
{
}
void
-PQtrace(PGconn * conn, FILE * debug_port)
+PQtrace(PGconn *conn, FILE *debug_port)
{
if (conn == NULL ||
conn->status == CONNECTION_BAD)
}
void
-PQuntrace(PGconn * conn)
+PQuntrace(PGconn *conn)
{
if (conn == NULL ||
conn->status == CONNECTION_BAD)
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: fe-connect.h,v 1.3 1997/09/08 02:40:27 momjian Exp $
+ * $Id: fe-connect.h,v 1.4 1997/09/08 21:55:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*----------------------------------------------------------------
*/
-extern int packetSend(Port * port, PacketBuf * buf, PacketLen len, bool nonBlocking);
+extern int packetSend(Port *port, PacketBuf *buf, PacketLen len, bool nonBlocking);
#endif /* FE_CONNECT_H */
#ifndef FE_CONNECT_H
#define FE_CONNECT_H
-int packetSend(Port * port, PacketBuf * buf, PacketLen len, bool nonBlocking);
+int packetSend(Port *port, PacketBuf *buf, PacketLen len, bool nonBlocking);
#endif
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.37 1997/09/08 02:40:28 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.38 1997/09/08 21:55:41 momjian Exp $
*
*-------------------------------------------------------------------------
*/
};
-static PGresult *makePGresult(PGconn * conn, char *pname);
-static void addTuple(PGresult * res, PGresAttValue * tup);
-static PGresAttValue *getTuple(PGconn * conn, PGresult * res, int binary);
-static PGresult *makeEmptyPGresult(PGconn * conn, ExecStatusType status);
-static void fill(int length, int max, char filler, FILE * fp);
+static PGresult *makePGresult(PGconn *conn, char *pname);
+static void addTuple(PGresult *res, PGresAttValue *tup);
+static PGresAttValue *getTuple(PGconn *conn, PGresult *res, int binary);
+static PGresult *makeEmptyPGresult(PGconn *conn, ExecStatusType status);
+static void fill(int length, int max, char filler, FILE *fp);
static char *
-do_header(FILE * fout, PQprintOpt * po, const int nFields,
+do_header(FILE *fout, PQprintOpt *po, const int nFields,
int fieldMax[], char *fieldNames[], unsigned char fieldNotNum[],
- const int fs_len, PGresult * res);
+ const int fs_len, PGresult *res);
/*
* PQclear -
*
*/
void
-PQclear(PGresult * res)
+PQclear(PGresult *res)
{
int i,
j;
*/
static PGresult *
-makeEmptyPGresult(PGconn * conn, ExecStatusType status)
+makeEmptyPGresult(PGconn *conn, ExecStatusType status)
{
PGresult *result;
*/
static PGresAttValue *
-getTuple(PGconn * conn, PGresult * result, int binary)
+getTuple(PGconn *conn, PGresult *result, int binary)
{
char bitmap[MAX_FIELDS]; /* the backend sends us a bitmap
* of */
*
*/
static void
-addTuple(PGresult * res, PGresAttValue * tup)
+addTuple(PGresult *res, PGresAttValue *tup)
{
if (res->ntups == res->tupArrSize)
{
*/
static PGresult *
-makePGresult(PGconn * conn, char *pname)
+makePGresult(PGconn *conn, char *pname)
{
PGresult *result;
int id;
*/
static void
-process_response_from_backend(FILE * pfin, FILE * pfout, FILE * pfdebug,
- PGconn * conn,
- PGresult ** result_p, char *const reason)
+process_response_from_backend(FILE *pfin, FILE *pfout, FILE *pfdebug,
+ PGconn *conn,
+ PGresult **result_p, char *const reason)
{
int id;
*/
PGresult *
-PQexec(PGconn * conn, const char *query)
+PQexec(PGconn *conn, const char *query)
{
PGresult *result;
char buffer[MAX_MESSAGE_LEN];
*/
PGnotify *
-PQnotifies(PGconn * conn)
+PQnotifies(PGconn *conn)
{
Dlelem *e;
* 1 in other cases
*/
int
-PQgetline(PGconn * conn, char *s, int maxlen)
+PQgetline(PGconn *conn, char *s, int maxlen)
{
int c = '\0';
*
*/
void
-PQputline(PGconn * conn, const char *s)
+PQputline(PGconn *conn, const char *s)
{
if (conn && (conn->Pfout))
{
* 1 on failure
*/
int
-PQendcopy(PGconn * conn)
+PQendcopy(PGconn *conn)
{
FILE *pfin,
*pfdebug;
/* simply send out max-length number of filler characters to fp */
static void
-fill(int length, int max, char filler, FILE * fp)
+fill(int length, int max, char filler, FILE *fp)
{
int count;
char filltmp[2];
* kept for backward compatibility
*/
void
-PQdisplayTuples(PGresult * res,
- FILE * fp, /* where to send the output */
+PQdisplayTuples(PGresult *res,
+ FILE *fp, /* where to send the output */
int fillAlign, /* pad the fields with spaces */
const char *fieldSep, /* field separator */
int printHeader,/* display headers? */
*
*/
void
-PQprintTuples(PGresult * res,
- FILE * fout, /* output stream */
+PQprintTuples(PGresult *res,
+ FILE *fout, /* output stream */
int PrintAttNames,/* print attribute names or not */
int TerseOutput, /* delimiter bars or not? */
int colWidth /* width of column, if 0, use variable
static void
-do_field(PQprintOpt * po, PGresult * res,
+do_field(PQprintOpt *po, PGresult *res,
const int i, const int j, char *buf, const int fs_len,
char *fields[],
const int nFields, char *fieldNames[],
unsigned char fieldNotNum[], int fieldMax[],
- const int fieldMaxLen, FILE * fout
+ const int fieldMaxLen, FILE *fout
)
{
static char *
-do_header(FILE * fout, PQprintOpt * po, const int nFields, int fieldMax[],
+do_header(FILE *fout, PQprintOpt *po, const int nFields, int fieldMax[],
char *fieldNames[], unsigned char fieldNotNum[],
- const int fs_len, PGresult * res)
+ const int fs_len, PGresult *res)
{
int j; /* for loop index */
static void
-output_row(FILE * fout, PQprintOpt * po, const int nFields, char *fields[],
+output_row(FILE *fout, PQprintOpt *po, const int nFields, char *fields[],
unsigned char fieldNotNum[], int fieldMax[], char *border,
const int row_index)
{
*/
void
-PQprint(FILE * fout,
- PGresult * res,
- PQprintOpt * po
+PQprint(FILE *fout,
+ PGresult *res,
+ PQprintOpt *po
)
{
int nFields;
*/
PGresult *
-PQfn(PGconn * conn,
+PQfn(PGconn *conn,
int fnid,
int *result_buf,
int *actual_result_len,
int result_is_int,
- PQArgBlock * args,
+ PQArgBlock *args,
int nargs)
{
FILE *pfin,
/* ====== accessor funcs for PGresult ======== */
ExecStatusType
-PQresultStatus(PGresult * res)
+PQresultStatus(PGresult *res)
{
if (!res)
{
}
int
-PQntuples(PGresult * res)
+PQntuples(PGresult *res)
{
if (!res)
{
}
int
-PQnfields(PGresult * res)
+PQnfields(PGresult *res)
{
if (!res)
{
returns NULL if the field_num is invalid
*/
char *
-PQfname(PGresult * res, int field_num)
+PQfname(PGresult *res, int field_num)
{
if (!res)
{
returns -1 on a bad field name
*/
int
-PQfnumber(PGresult * res, const char *field_name)
+PQfnumber(PGresult *res, const char *field_name)
{
int i;
}
Oid
-PQftype(PGresult * res, int field_num)
+PQftype(PGresult *res, int field_num)
{
if (!res)
{
}
int2
-PQfsize(PGresult * res, int field_num)
+PQfsize(PGresult *res, int field_num)
{
if (!res)
{
}
char *
-PQcmdStatus(PGresult * res)
+PQcmdStatus(PGresult *res)
{
if (!res)
{
*/
static char oidStatus[32] = {0};
const char *
-PQoidStatus(PGresult * res)
+PQoidStatus(PGresult *res)
{
if (!res)
{
of inserted/affected tuples, if not, return ""
*/
const char *
-PQcmdTuples(PGresult * res)
+PQcmdTuples(PGresult *res)
{
if (!res)
{
if res is not binary, a null-terminated ASCII string is returned.
*/
char *
-PQgetvalue(PGresult * res, int tup_num, int field_num)
+PQgetvalue(PGresult *res, int tup_num, int field_num)
{
if (!res)
{
NOT include the size field of the varlena.
*/
int
-PQgetlength(PGresult * res, int tup_num, int field_num)
+PQgetlength(PGresult *res, int tup_num, int field_num)
{
if (!res)
{
returns the null status of a field value.
*/
int
-PQgetisnull(PGresult * res, int tup_num, int field_num)
+PQgetisnull(PGresult *res, int tup_num, int field_num)
{
if (!res)
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-lobj.c,v 1.9 1997/09/08 02:40:32 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-lobj.c,v 1.10 1997/09/08 21:55:43 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define LO_BUFSIZE 1024
-static int lo_initialize(PGconn * conn);
+static int lo_initialize(PGconn *conn);
/*
* lo_open
* return -1 upon failure.
*/
int
-lo_open(PGconn * conn, Oid lobjId, int mode)
+lo_open(PGconn *conn, Oid lobjId, int mode)
{
int fd;
int result_len;
* returns -1 upon failure.
*/
int
-lo_close(PGconn * conn, int fd)
+lo_close(PGconn *conn, int fd)
{
PQArgBlock argv[1];
PGresult *res;
*/
int
-lo_read(PGconn * conn, int fd, char *buf, int len)
+lo_read(PGconn *conn, int fd, char *buf, int len)
{
PQArgBlock argv[2];
PGresult *res;
*
*/
int
-lo_write(PGconn * conn, int fd, char *buf, int len)
+lo_write(PGconn *conn, int fd, char *buf, int len)
{
PQArgBlock argv[2];
PGresult *res;
*/
int
-lo_lseek(PGconn * conn, int fd, int offset, int whence)
+lo_lseek(PGconn *conn, int fd, int offset, int whence)
{
PQArgBlock argv[3];
PGresult *res;
*/
Oid
-lo_creat(PGconn * conn, int mode)
+lo_creat(PGconn *conn, int mode)
{
PQArgBlock argv[1];
PGresult *res;
*/
int
-lo_tell(PGconn * conn, int fd)
+lo_tell(PGconn *conn, int fd)
{
int retval;
PQArgBlock argv[1];
*/
int
-lo_unlink(PGconn * conn, Oid lobjId)
+lo_unlink(PGconn *conn, Oid lobjId)
{
PQArgBlock argv[1];
PGresult *res;
*/
Oid
-lo_import(PGconn * conn, char *filename)
+lo_import(PGconn *conn, char *filename)
{
int fd;
int nbytes,
* returns -1 upon failure, 1 otherwise
*/
int
-lo_export(PGconn * conn, Oid lobjId, char *filename)
+lo_export(PGconn *conn, Oid lobjId, char *filename)
{
int fd;
int nbytes,
* ----------------
*/
static int
-lo_initialize(PGconn * conn)
+lo_initialize(PGconn *conn)
{
PGresult *res;
PGlobjfuncs *lobjfuncs;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.7 1997/09/08 02:40:35 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.8 1997/09/08 21:55:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
if debug is set, also echo the character fetched
*/
int
-pqGetc(FILE * fin, FILE * debug)
+pqGetc(FILE *fin, FILE *debug)
{
int c;
returns 1 if there was an error, 0 otherwise.
*/
int
-pqPutnchar(const char *s, int len, FILE * f, FILE * debug)
+pqPutnchar(const char *s, int len, FILE *f, FILE *debug)
{
if (f == NULL)
return 1;
get a string of exactly len length from stream f
*/
int
-pqGetnchar(char *s, int len, FILE * f, FILE * debug)
+pqGetnchar(char *s, int len, FILE *f, FILE *debug)
{
int cnt;
get a string of up to length len from stream f
*/
int
-pqGets(char *s, int len, FILE * f, FILE * debug)
+pqGets(char *s, int len, FILE *f, FILE *debug)
{
int c;
const char *str = s;
returns 0 if successful, 1 otherwise
*/
int
-pqPutInt(const int integer, int bytes, FILE * f, FILE * debug)
+pqPutInt(const int integer, int bytes, FILE *f, FILE *debug)
{
int retval = 0;
returns 0 if successful
*/
int
-pqGetInt(int *result, int bytes, FILE * f, FILE * debug)
+pqGetInt(int *result, int bytes, FILE *f, FILE *debug)
{
int retval = 0;
/* --------------------------------------------------------------------- */
int
-pqPuts(const char *s, FILE * f, FILE * debug)
+pqPuts(const char *s, FILE *f, FILE *debug)
{
if (f == NULL)
return 1;
/* --------------------------------------------------------------------- */
void
-pqFlush(FILE * f, FILE * debug)
+pqFlush(FILE *f, FILE *debug)
{
if (f)
fflush(f);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: libpq-fe.h,v 1.22 1997/09/08 02:40:36 momjian Exp $
+ * $Id: libpq-fe.h,v 1.23 1997/09/08 21:55:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
CONNECTION_OK,
CONNECTION_BAD
- } ConnStatusType;
+ } ConnStatusType;
typedef enum
{
PGRES_NONFATAL_ERROR,
PGRES_FATAL_ERROR
- } ExecStatusType;
+ } ExecStatusType;
/* string descriptions of the ExecStatusTypes */
extern const char *pgresStatus[];
int *ptr; /* can't use void (dec compiler barfs) */
int integer;
} u;
- } PQArgBlock;
+ } PQArgBlock;
typedef struct pgresAttDesc
{
char *name; /* type name */
Oid adtid; /* type id */
short adtsize; /* type size */
- } PGresAttDesc;
+ } PGresAttDesc;
/* use char* for Attribute values,
ASCII tuples are guaranteed to be null-terminated
{
int len; /* length in bytes of the value */
char *value; /* actual value */
- } PGresAttValue;
+ } PGresAttValue;
typedef struct pgNotify
{
char relname[NAMEDATALEN]; /* name of relation
* containing data */
int be_pid; /* process id of backend */
- } PGnotify;
+ } PGnotify;
typedef struct pgLobjfuncs
{
Oid fn_lo_tell; /* OID of backend function lo_tell */
Oid fn_lo_read; /* OID of backend function LOread */
Oid fn_lo_write;/* OID of backend function LOwrite */
- } PGlobjfuncs;
+ } PGlobjfuncs;
/* PGconn encapsulates a connection to the backend */
typedef struct pg_conn
char *pgauth;
PGlobjfuncs *lobjfuncs; /* Backend function OID's for large object
* access */
- } PGconn;
+ } PGconn;
#define CMDSTATUS_LEN 40
int binary; /* binary tuple values if binary == 1,
* otherwise ASCII */
PGconn *conn;
- } PGresult;
+ } PGresult;
typedef char pqbool;
extern PGconn *PQsetdb(const char *pghost, const char *pgport, const char *pgoptions,
const char *pgtty, const char *dbName);
/* close the current connection and free the PGconn data structure */
- extern void PQfinish(PGconn * conn);
+ extern void PQfinish(PGconn *conn);
/*
* close the current connection and restablish a new one with the same
* parameters
*/
- extern void PQreset(PGconn * conn);
-
- extern char *PQdb(PGconn * conn);
- extern char *PQuser(PGconn * conn);
- extern char *PQhost(PGconn * conn);
- extern char *PQoptions(PGconn * conn);
- extern char *PQport(PGconn * conn);
- extern char *PQtty(PGconn * conn);
- extern ConnStatusType PQstatus(PGconn * conn);
- extern char *PQerrorMessage(PGconn * conn);
- extern void PQtrace(PGconn * conn, FILE * debug_port);
- extern void PQuntrace(PGconn * conn);
+ extern void PQreset(PGconn *conn);
+
+ extern char *PQdb(PGconn *conn);
+ extern char *PQuser(PGconn *conn);
+ extern char *PQhost(PGconn *conn);
+ extern char *PQoptions(PGconn *conn);
+ extern char *PQport(PGconn *conn);
+ extern char *PQtty(PGconn *conn);
+ extern ConnStatusType PQstatus(PGconn *conn);
+ extern char *PQerrorMessage(PGconn *conn);
+ extern void PQtrace(PGconn *conn, FILE *debug_port);
+ extern void PQuntrace(PGconn *conn);
/* === in fe-exec.c === */
- extern PGresult *PQexec(PGconn * conn, const char *query);
- extern int PQgetline(PGconn * conn, char *string, int length);
- extern int PQendcopy(PGconn * conn);
- extern void PQputline(PGconn * conn, const char *string);
- extern ExecStatusType PQresultStatus(PGresult * res);
- extern int PQntuples(PGresult * res);
- extern int PQnfields(PGresult * res);
- extern char *PQfname(PGresult * res, int field_num);
- extern int PQfnumber(PGresult * res, const char *field_name);
- extern Oid PQftype(PGresult * res, int field_num);
- extern short PQfsize(PGresult * res, int field_num);
- extern char *PQcmdStatus(PGresult * res);
- extern const char *PQoidStatus(PGresult * res);
- extern const char *PQcmdTuples(PGresult * res);
- extern char *PQgetvalue(PGresult * res, int tup_num, int field_num);
- extern int PQgetlength(PGresult * res, int tup_num, int field_num);
- extern int PQgetisnull(PGresult * res, int tup_num, int field_num);
- extern void PQclear(PGresult * res);
+ extern PGresult *PQexec(PGconn *conn, const char *query);
+ extern int PQgetline(PGconn *conn, char *string, int length);
+ extern int PQendcopy(PGconn *conn);
+ extern void PQputline(PGconn *conn, const char *string);
+ extern ExecStatusType PQresultStatus(PGresult *res);
+ extern int PQntuples(PGresult *res);
+ extern int PQnfields(PGresult *res);
+ extern char *PQfname(PGresult *res, int field_num);
+ extern int PQfnumber(PGresult *res, const char *field_name);
+ extern Oid PQftype(PGresult *res, int field_num);
+ extern short PQfsize(PGresult *res, int field_num);
+ extern char *PQcmdStatus(PGresult *res);
+ extern const char *PQoidStatus(PGresult *res);
+ extern const char *PQcmdTuples(PGresult *res);
+ extern char *PQgetvalue(PGresult *res, int tup_num, int field_num);
+ extern int PQgetlength(PGresult *res, int tup_num, int field_num);
+ extern int PQgetisnull(PGresult *res, int tup_num, int field_num);
+ extern void PQclear(PGresult *res);
/* PQdisplayTuples() is a better version of PQprintTuples() */
- extern void PQdisplayTuples(PGresult * res,
- FILE * fp, /* where to send the
+ extern void PQdisplayTuples(PGresult *res,
+ FILE *fp, /* where to send the
* output */
int fillAlign, /* pad the fields with
* spaces */
const char *fieldSep, /* field separator */
int printHeader, /* display headers? */
int quiet);
- extern void PQprintTuples(PGresult * res,
- FILE * fout, /* output stream */
+ extern void PQprintTuples(PGresult *res,
+ FILE *fout, /* output stream */
int printAttName, /* print attribute names
* or not */
int terseOutput, /* delimiter bars or
int width /* width of column, if
* 0, use variable width */
);
- extern void PQprint(FILE * fout, /* output stream */
- PGresult * res,
- PQprintOpt * ps /* option structure */
+ extern void PQprint(FILE *fout, /* output stream */
+ PGresult *res,
+ PQprintOpt *ps /* option structure */
);
- extern PGnotify *PQnotifies(PGconn * conn);
- extern PGresult *PQfn(PGconn * conn,
+ extern PGnotify *PQnotifies(PGconn *conn);
+ extern PGresult *PQfn(PGconn *conn,
int fnid,
int *result_buf,
int *result_len,
int result_is_int,
- PQArgBlock * args,
+ PQArgBlock *args,
int nargs);
/* === in fe-auth.c === */
extern MsgType fe_getauthsvc(char *PQerrormsg);
returns 0 if successful
if debug is non-null, debugging output is sent to that stream
*/
- extern int pqGets(char *s, int maxlen, FILE * stream, FILE * debug);
- extern int pqGetnchar(char *s, int maxlen, FILE * stream, FILE * debug);
- extern int pqPutnchar(const char *s, int maxlen, FILE * stream, FILE * debug);
- extern int pqPuts(const char *s, FILE * stream, FILE * debug);
- extern int pqGetc(FILE * stream, FILE * debug);
+ extern int pqGets(char *s, int maxlen, FILE *stream, FILE *debug);
+ extern int pqGetnchar(char *s, int maxlen, FILE *stream, FILE *debug);
+ extern int pqPutnchar(const char *s, int maxlen, FILE *stream, FILE *debug);
+ extern int pqPuts(const char *s, FILE *stream, FILE *debug);
+ extern int pqGetc(FILE *stream, FILE *debug);
/* get a n-byte integer from the stream into result */
/* returns 0 if successful */
- extern int pqGetInt(int *result, int bytes, FILE * stream, FILE * debug);
+ extern int pqGetInt(int *result, int bytes, FILE *stream, FILE *debug);
/* put a n-byte integer into the stream */
/* returns 0 if successful */
- extern int pqPutInt(const int n, int bytes, FILE * stream, FILE * debug);
- extern void pqFlush(FILE * stream, FILE * debug);
+ extern int pqPutInt(const int n, int bytes, FILE *stream, FILE *debug);
+ extern void pqFlush(FILE *stream, FILE *debug);
/* === in fe-lobj.c === */
- int lo_open(PGconn * conn, Oid lobjId, int mode);
- int lo_close(PGconn * conn, int fd);
- int lo_read(PGconn * conn, int fd, char *buf, int len);
- int lo_write(PGconn * conn, int fd, char *buf, int len);
- int lo_lseek(PGconn * conn, int fd, int offset, int whence);
- Oid lo_creat(PGconn * conn, int mode);
- int lo_tell(PGconn * conn, int fd);
- int lo_unlink(PGconn * conn, Oid lobjId);
- Oid lo_import(PGconn * conn, char *filename);
- int lo_export(PGconn * conn, Oid lobjId, char *filename);
+ int lo_open(PGconn *conn, Oid lobjId, int mode);
+ int lo_close(PGconn *conn, int fd);
+ int lo_read(PGconn *conn, int fd, char *buf, int len);
+ int lo_write(PGconn *conn, int fd, char *buf, int len);
+ int lo_lseek(PGconn *conn, int fd, int offset, int whence);
+ Oid lo_creat(PGconn *conn, int mode);
+ int lo_tell(PGconn *conn, int fd);
+ int lo_unlink(PGconn *conn, Oid lobjId);
+ Oid lo_import(PGconn *conn, char *filename);
+ int lo_export(PGconn *conn, Oid lobjId, char *filename);
/* max length of message to send */
#define MAX_MESSAGE_LEN 8193
#include "libpq-fe.h"
void
-exit_nicely(PGconn * conn)
+exit_nicely(PGconn *conn)
{
PQfinish(conn);
exit(1);
#include "libpq-fe.h"
void
-exit_nicely(PGconn * conn)
+exit_nicely(PGconn *conn)
{
PQfinish(conn);
exit(1);
#include "utils/geo-decls.h" /* for the POLYGON type */
void
-exit_nicely(PGconn * conn)
+exit_nicely(PGconn *conn)
{
PQfinish(conn);
exit(1);
#include "libpq-fe.h"
void
-exit_nicely(PGconn * conn1, PGconn * conn2)
+exit_nicely(PGconn *conn1, PGconn *conn2)
{
if (conn1)
PQfinish(conn1);
}
void
-check_conn(PGconn * conn)
+check_conn(PGconn *conn)
{
/* check to see that the backend connection was successfully made */
if (PQstatus(conn) == CONNECTION_BAD)
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/test/examples/testlo.c,v 1.5 1997/09/08 02:40:51 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/test/examples/testlo.c,v 1.6 1997/09/08 21:55:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*
*/
Oid
-importFile(PGconn * conn, char *filename)
+importFile(PGconn *conn, char *filename)
{
Oid lobjId;
int lobj_fd;
}
void
-pickout(PGconn * conn, Oid lobjId, int start, int len)
+pickout(PGconn *conn, Oid lobjId, int start, int len)
{
int lobj_fd;
char *buf;
}
void
-overwrite(PGconn * conn, Oid lobjId, int start, int len)
+overwrite(PGconn *conn, Oid lobjId, int start, int len)
{
int lobj_fd;
char *buf;
*
*/
void
-exportFile(PGconn * conn, Oid lobjId, char *filename)
+exportFile(PGconn *conn, Oid lobjId, char *filename)
{
int lobj_fd;
char buf[BUFSIZE];
}
void
-exit_nicely(PGconn * conn)
+exit_nicely(PGconn *conn)
{
PQfinish(conn);
exit(1);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/test/examples/Attic/testlo2.c,v 1.4 1997/09/08 02:40:52 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/test/examples/Attic/testlo2.c,v 1.5 1997/09/08 21:55:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
*
*/
Oid
-importFile(PGconn * conn, char *filename)
+importFile(PGconn *conn, char *filename)
{
Oid lobjId;
int lobj_fd;
}
void
-pickout(PGconn * conn, Oid lobjId, int start, int len)
+pickout(PGconn *conn, Oid lobjId, int start, int len)
{
int lobj_fd;
char *buf;
}
void
-overwrite(PGconn * conn, Oid lobjId, int start, int len)
+overwrite(PGconn *conn, Oid lobjId, int start, int len)
{
int lobj_fd;
char *buf;
*
*/
void
-exportFile(PGconn * conn, Oid lobjId, char *filename)
+exportFile(PGconn *conn, Oid lobjId, char *filename)
{
int lobj_fd;
char buf[BUFSIZE];
}
void
-exit_nicely(PGconn * conn)
+exit_nicely(PGconn *conn)
{
PQfinish(conn);
exit(1);
/*
- * $Header: /cvsroot/pgsql/src/test/regress/regress.c,v 1.12 1997/09/08 20:59:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/test/regress/regress.c,v 1.13 1997/09/08 21:56:01 momjian Exp $
*/
#include <float.h> /* faked on sunos */
typedef void *TUPLE;
-extern double *regress_dist_ptpath(Point * pt, PATH * path);
-extern double *regress_path_dist(PATH * p1, PATH * p2);
-extern PATH *poly2path(POLYGON * poly);
-extern Point *interpt_pp(PATH * p1, PATH * p2);
-extern void regress_lseg_construct(LSEG * lseg, Point * pt1, Point * pt2);
+extern double *regress_dist_ptpath(Point *pt, PATH *path);
+extern double *regress_path_dist(PATH *p1, PATH *p2);
+extern PATH *poly2path(POLYGON *poly);
+extern Point *interpt_pp(PATH *p1, PATH *p2);
+extern void regress_lseg_construct(LSEG *lseg, Point *pt1, Point *pt2);
extern char overpaid(TUPLE tuple);
extern int boxarea(BOX *box);
extern char *reverse_c16(char *string);
WIDGET *widget_in(char *str);
char *widget_out(WIDGET * widget);
-int pt_in_widget(Point * point, WIDGET * widget);
+int pt_in_widget(Point *point, WIDGET * widget);
#define NARGS 3
fflush(stderr);
/* call one clean up function if defined */
- if ((sig_func = signal(SIGTERM, SIG_DFL)) != SIG_DFL &&
- sig_func != SIG_IGN)
+ if ((sig_func = signal(SIGTERM, SIG_DFL)) !=SIG_DFL &&
+ sig_func !=SIG_IGN)
(*sig_func) (0);
- else if ((sig_func = signal(SIGHUP, SIG_DFL)) != SIG_DFL &&
- sig_func != SIG_IGN)
+ else if ((sig_func = signal(SIGHUP, SIG_DFL)) !=SIG_DFL &&
+ sig_func !=SIG_IGN)
(*sig_func) (0);
- else if ((sig_func = signal(SIGINT, SIG_DFL)) != SIG_DFL &&
- sig_func != SIG_IGN)
+ else if ((sig_func = signal(SIGINT, SIG_DFL)) !=SIG_DFL &&
+ sig_func !=SIG_IGN)
(*sig_func) (0);
- else if ((sig_func = signal(SIGQUIT, SIG_DFL)) != SIG_DFL &&
- sig_func != SIG_IGN)
+ else if ((sig_func = signal(SIGQUIT, SIG_DFL)) !=SIG_DFL &&
+ sig_func !=SIG_IGN)
(*sig_func) (0);
exit(1);
}
*/
int add_one(int arg);
-char16 *concat16(char16 * arg1, char16 * arg2);
-text *copytext(text * t);
+char16 *concat16(char16 *arg1, char16 *arg2);
+text *copytext(text *t);
bool
c_overpaid(TUPLE t, /* the current instance of EMP */
}
char16 *
-concat16(char16 * arg1, char16 * arg2)
+concat16(char16 *arg1, char16 *arg2)
{
char16 *new_c16 = (char16 *) palloc(sizeof(char16));
}
text *
-copytext(text * t)
+copytext(text *t)
{
/*