head	1.36;
access;
symbols
	release_4_2:1.36
	aix_ok:1.34
	Version_2_1:1.23
	Version_2:1.18
	C_Demo_1:1.13;
locks; strict;
comment	@ * @;


1.36
date	94.02.07.11.50.32;	author aoki;	state Exp;
branches;
next	1.35;

1.35
date	93.10.25.23.15.24;	author aoki;	state Exp;
branches;
next	1.34;

1.34
date	93.07.10.03.36.47;	author aoki;	state Exp;
branches;
next	1.33;

1.33
date	91.11.14.14.57.25;	author jolly;	state Exp;
branches;
next	1.32;

1.32
date	91.10.01.16.27.39;	author glass;	state Exp;
branches;
next	1.31;

1.31
date	91.08.09.02.48.21;	author glass;	state Exp;
branches;
next	1.30;

1.30
date	91.05.01.18.15.28;	author kemnitz;	state Exp;
branches;
next	1.29;

1.29
date	91.04.29.17.17.19;	author kemnitz;	state Exp;
branches;
next	1.28;

1.28
date	91.04.29.17.15.53;	author kemnitz;	state Exp;
branches;
next	1.27;

1.27
date	91.04.29.17.13.22;	author kemnitz;	state Exp;
branches;
next	1.26;

1.26
date	91.04.29.11.35.50;	author kemnitz;	state Exp;
branches;
next	1.25;

1.25
date	91.04.28.09.15.38;	author cimarron;	state Exp;
branches;
next	1.24;

1.24
date	91.04.27.14.16.00;	author hong;	state Exp;
branches;
next	1.23;

1.23
date	91.02.05.15.45.27;	author sp;	state Exp;
branches;
next	1.22;

1.22
date	90.10.15.14.51.12;	author choi;	state Exp;
branches;
next	1.21;

1.21
date	90.10.01.07.46.21;	author cimarron;	state Exp;
branches;
next	1.20;

1.20
date	90.10.01.01.15.30;	author cimarron;	state Exp;
branches;
next	1.19;

1.19
date	90.08.17.08.52.39;	author cimarron;	state Exp;
branches;
next	1.18;

1.18
date	90.05.25.13.03.43;	author cimarron;	state Version_2;
branches;
next	1.17;

1.17
date	90.04.25.13.27.27;	author cimarron;	state Exp;
branches;
next	1.16;

1.16
date	89.10.06.06.36.29;	author hirohama;	state Exp;
branches;
next	1.14;

1.14
date	89.10.05.23.13.50;	author hirohama;	state Exp;
branches;
next	1.13;

1.13
date	89.09.05.17.09.45;	author mao;	state C_Demo_1;
branches;
next	1.12;

1.12
date	89.08.29.22.38.00;	author cimarron;	state Exp;
branches;
next	1.11;

1.11
date	89.08.23.21.13.54;	author ong;	state Exp;
branches;
next	1.10;

1.10
date	89.08.01.16.16.45;	author goh;	state Exp;
branches;
next	1.9;

1.9
date	89.07.31.11.13.00;	author goh;	state Exp;
branches;
next	1.8;

1.8
date	89.07.30.10.39.02;	author goh;	state Exp;
branches;
next	1.7;

1.7
date	89.07.21.10.42.22;	author ong;	state Exp;
branches;
next	1.6;

1.6
date	89.07.20.17.37.23;	author ong;	state Exp;
branches;
next	1.5;

1.5
date	89.07.20.16.43.55;	author ong;	state Exp;
branches;
next	1.4;

1.4
date	89.07.20.10.47.37;	author ong;	state Exp;
branches;
next	1.3;

1.3
date	89.07.20.09.03.34;	author goh;	state Exp;
branches;
next	1.2;

1.2
date	89.07.18.16.10.07;	author ong;	state Exp;
branches;
next	1.1;

1.1
date	89.07.18.16.07.59;	author goh;	state Exp;
branches;
next	;


desc
@pseudo lisp stuff, only for lisp port, will go away soon
@


1.36
log
@remove ppreserve stuff (wow.. back to the lisp days)
@
text
@/* ----------------------------------------------------------------
 *   FILE
 *	pg_lisp.h
 *	
 *   DESCRIPTION
 *	C definitions to simulate LISP structures
 *
 *   NOTES
 *	Prior to version 1, this file was only used by the C portions
 *	of the postgres code (esp. the parser) to allow that code to
 *	function independently of allegro common lisp.  When V1 was
 *	ported to C, this file became the place where portions of
 *	the allegro lisp functionality was moved.  More specifically,
 *	the lisp list structure simulation stuff is here.
 *
 *   IDENTIFICATION
 *	$Header: /import/faerie/faerie/aoki/postgres/src/backend/nodes/RCS/pg_lisp.h,v 1.35 1993/10/25 23:15:24 aoki Exp aoki $
 * ----------------------------------------------------------------
 */

#ifndef	LispDepIncluded
#define	LispDepIncluded

#include <stdio.h>
#include "tmp/c.h"
#include "nodes/nodes.h"
#include "tmp/stringinfo.h"

/* ----------------------------------------------------------------
 *	Node Function Declarations
 *
 *  All of these #defines indicate that we have written print/equal/copy
 *  support for the classes named.  The print routines are in
 *  lib/C/printfuncs.c, the equal functions are in lib/C/equalfincs.c and
 *  the copy functions can be found in lib/C/copyfuncs.c
 *
 *  An interface routine is generated automatically by Gen_creator.sh for
 *  each node type.  This routine will call either do nothing or call
 *  an _print, _equal or _copy function defined in one of the above
 *  files, depending on whether or not the appropriate #define is specified.
 *
 *  Thus, when adding a new node type, you have to add a set of
 *  _print, _equal and _copy functions to the above files and then
 *  add some #defines below.
 *
 *  This is pretty complicated, and a better-designed system needs to be
 *  implemented.
 * ----------------------------------------------------------------
 */

/* ----------------
 *	Node Copy Function declarations
 * ----------------
 */
#define	CopyLispValueExists
#define	CopyLispSymbolExists
#define	CopyLispListExists
#define	CopyLispIntExists
#define	CopyLispFloatExists
#define	CopyLispVectorExists
#define	CopyLispStrExists

extern bool	CopyLispValue();
extern bool	CopyLispSymbol();
extern bool	CopyLispList();
extern bool	CopyLispInt();
extern bool	CopyLispFloat();
extern bool	CopyLispVector();
extern bool	CopyLispStr();

/* ----------------------------------------------------------------
 *			node definitions
 * ----------------------------------------------------------------
 */

/* ----------------
 *	vectori definition used in LispValue
 * ----------------
 */
struct vectori {
	int	size;
	char	data[1];		/* variable length array */
};

/* ----------------
 *	LispValue definition -- class used to support lisp structures
 *	in C.  This is here because we did not want to totally rewrite
 *	planner and executor code which depended on lisp structures when
 *	we ported postgres V1 from lisp to C. -cim 4/23/90
 * ----------------
 */
typedef union { 
    char			*name;	/* symbol */
    char   			*str;	/* string */ 
    long    			fixnum; 
    double 			flonum; 
    struct _LispValue		*car;	/* dotted pair */ 
    struct vectori		*veci; 
} LispValueUnion;
    
class (LispValue) public (Node) {
#define LispValueDefs \
    inherits0(Node); \
    LispValueUnion	val; \
    struct _LispValue	*cdr 
/* private: */
    LispValueDefs;	
/* public: */
};

/* ----------------
 *	"List" abbreviation for LispValue -- basically used anywhere
 *	we expect to deal with list data.
 * ----------------
 */
#define List LispValue

/* ----------------
 *	arrays of LispValues are needed in execnodes.h
 *	-cim 8/29/89
 * ----------------
 */
typedef LispValue *LispValuePtr;
#define	ListPtr	 LispValuePtr

/*
 * 	Global declaration for LispNil.
 */
#define LispNil 	((LispValue) NULL)

/*
 *	Global declaration for LispTrue.
 */
#define LispTrue 	((LispValue) 1)

/* ----------------
 *	dummy classes
 *
 *	these next node classes are actually only used for
 *	the tags generated.. the classes themselves are bogus.
 * ----------------
 */
class (LispSymbol) public (Node) {
    inherits0(Node);
};

class (LispList) public (Node) {
    inherits0(Node);
};

class (LispInt) public (Node) {
    inherits0(Node);
};

class (LispFloat) public (Node) {
    inherits0(Node);
};

class (LispVector) public (Node) {
    inherits0(Node);
};

class (LispStr) public (Node) {
    inherits0(Node);
};

/* ----------------
 *	macros and defines which depend on dummy class tags
 * ----------------
 */
#define	PGLISP_ATOM	classTag(LispSymbol)
#define	PGLISP_DTPR	classTag(LispList)
#define	PGLISP_FLOAT	classTag(LispFloat)
#define	PGLISP_INT	classTag(LispInt)
#define	PGLISP_STR	classTag(LispStr)
#define	PGLISP_VECI	classTag(LispVector)

#define	LISP_BYTEVECTOR	classTag(LispVector)
#define	LISP_DOUBLE	classTag(LispFloat)
#define	LISP_INTEGER	classTag(LispInt)
#define	LISP_STRING	classTag(LispStr)

/* ----------------
 *	lisp value accessor macros
 * ----------------
 */
#define	CAR(LISPVALUE)			((LISPVALUE)->val.car)
#define	CDR(LISPVALUE)			((LISPVALUE)->cdr)
#define CAAR(lv)                	(CAR(CAR(lv)))
#define CADR(lv)			(CAR(CDR(lv)))
#define CADDR(lv)			(CAR(CDR(CDR(lv))))
#define	LISPVALUE_DOUBLE(LISPVALUE)	((LISPVALUE)->val.flonum)
#define	LISPVALUE_INTEGER(LISPVALUE)	((LISPVALUE)->val.fixnum)
#define	LISPVALUE_STRING(LISPVALUE)	((LISPVALUE)->val.str)
#define	LISPVALUE_SYMBOL(LISPVALUE)	((LISPVALUE)->val.name)
#define	LISPVALUE_VECI(LISPVALUE)	((LISPVALUE)->val.veci)
#define	LISPVALUE_BYTEVECTOR(LISPVALUE)	((LISPVALUE)->val.veci->data)
#define	LISPVALUE_VECTORSIZE(LISPVALUE)	((LISPVALUE)->val.veci->size)

#define	LISP_TYPE(LISPVALUE)		((LISPVALUE)->type)

/* ----------------
 *	predicates
 * ----------------
 */
#define lispNullp(p) ((List)(p) == LispNil)

#define null(p) \
    ((bool) lispNullp(p))

#define consp(x) \
    ((x) ? (bool)(LISP_TYPE(x) == PGLISP_DTPR) : false)

#define listp(x) (lispNullp(x) || consp(x))

#define lispStringp(x) \
    ((x) ? (bool)(LISP_TYPE(x) == PGLISP_STR) : false)

#define stringp(foo) lispStringp(foo)

#define lispIntegerp(x) \
    ((x) ? (bool)(LISP_TYPE(x) == PGLISP_INT) : false)

#define integerp(foo) lispIntegerp(foo)

#define lispAtomp(x) \
    ((x) ? (bool)(LISP_TYPE(x) == PGLISP_ATOM) : false)

#define atom(foo) lispAtomp(foo)

#define floatp(x) \
    ((x) ? (bool)(LISP_TYPE(x) == PGLISP_FLOAT) : false)

#define numberp(foo) \
   ((bool) (integerp(foo) || floatp(foo)))

/* ----------------
 *	lispAlloc
 * ----------------
 */
#define lispAlloc() (LispValue) palloc(sizeof(classObj(LispValue)))

/* ----------------
 *	lisp support macros
 * ----------------
 */
#define eq(foo,bar) ((bool)((foo) == (bar)))

#define nth(index,list)         CAR(nthCdr(index,list))

#define foreach(_elt_,_list_)	for(_elt_=(LispValue)_list_; \
_elt_!=LispNil;_elt_=CDR(_elt_))

/* sigh, used so often, I'm lazy to do global search & replace -jeff*/
#define cons(x,y) lispCons(x,y)

/* ----------------
 *	extern definitions
 * ----------------
 */
extern LispValue lispAtom ARGS((char *atomName ));
extern LispValue lispDottedPair ARGS((void ));
extern LispValue lispFloat ARGS((double floatValue ));
extern LispValue lispInteger ARGS((long integerValue ));
extern LispValue lispName ARGS((char *string ));
extern LispValue lispString ARGS((char *string ));
extern LispValue lispVectori ARGS((int nBytes ));
extern LispValue evalList ARGS((LispValue list ));
extern LispValue quote ARGS((LispValue lispObject ));

extern LispValue lispList ARGS((void ));
extern LispValue lispCons ARGS((LispValue lispObject1 , LispValue lispObject2 ));
extern LispValue nappend1 ARGS((LispValue list , LispValue lispObject ));
extern LispValue append1 ARGS((LispValue list , LispValue lispObject ));
extern LispValue car ARGS((LispValue dottedPair ));
extern LispValue cdr ARGS((LispValue dottedPair ));
extern LispValue rplaca ARGS((LispValue dottedPair , LispValue newValue ));
extern LispValue rplacd ARGS((LispValue dottedPair , LispValue newValue ));

extern int init_list ARGS((LispValue list , LispValue newValue ));
extern LispValue append ARGS((LispValue list , LispValue lispObject ));
extern int length ARGS((LispValue list ));
extern LispValue nthCdr ARGS((int index , LispValue list ));
extern LispValue nconc ARGS((LispValue list1 , LispValue list2 ));
extern LispValue nreverse ARGS((LispValue list ));
extern int position ARGS((LispValue foo , List bar ));
extern bool member ARGS((LispValue foo , List bar ));
extern LispValue remove_duplicates ARGS((List foo , bool (*test )()));
extern LispValue find_if_not ARGS((bool (*pred )(), LispValue bar ));
extern LispValue LispDelete ARGS((LispValue foo , List bar ));
extern LispValue setf ARGS((LispValue foo , LispValue bar ));
extern LispValue LispRemove ARGS((LispValue foo , List bar ));
extern List nLispRemove ARGS((List foo , LispValue bar ));
extern LispValue set_difference ARGS((LispValue foo , LispValue bar ));
extern List nset_difference ARGS((List foo , List bar ));
extern LispValue push ARGS((LispValue foo , List bar ));
extern LispValue last ARGS((LispValue foo ));
extern LispValue LispUnion ARGS((LispValue foo , LispValue bar ));
extern LispValue mapcar ARGS((void (*foo )(), LispValue bar ));
extern bool zerop ARGS((LispValue foo ));
extern LispValue lispArray ARGS((int foo ));
extern List number_list ARGS((int start , int n ));
extern LispValue apply ARGS((LispValue (*foo )(), LispValue bar ));
extern LispValue find_if ARGS((bool (*pred )(), LispValue bar ));
extern LispValue find ARGS((LispValue foo , LispValue bar , bool (*test )(), Node (*key )()));
extern LispValue some ARGS((bool (*foo )(), LispValue bar ));
extern LispValue sort ARGS((LispValue foo ));
extern double expt ARGS((double foo ));
extern bool same ARGS((LispValue foo , LispValue bar ));

extern bool equal ARGS((Node a , Node b ));

extern LispValue collect ARGS((bool (*pred )(), LispValue list ));
extern LispValue last_element ARGS((LispValue list ));

extern char *CString ARGS((LispValue lstr ));
extern int CAtom ARGS((LispValue lv ));
extern double CDouble ARGS((LispValue lval ));
extern long CInteger ARGS((LispValue lval ));

/*===============================
 * in/out print/read functions...
 *===============================
 */

/*---------------------------
 * lispDisplayFp
 * print a lisp structure in the given file.
 */
extern 
void
lispDisplayFp ARGS((
	FILE		*fp,
	LispValue	lispObject
));

/*---------------------------
 * lispDisplay
 * print a lisp structure in stdout, & flush it!
 */
extern
void
lispDisplay ARGS((
	LispValue	lispObject
));

/*---------------------------
 * lispOut
 * given a lisp structure create & return a string holding
 * its ascii representation
 */
extern
char *
lispOut ARGS((
	LispValue	lispObject
));

/*---------------------------
 * lispToStringInfo
 * given a lisp structure, fill the given 'StringInfo' with its
 * ascii representation.
 */
extern
void
_outLispValue  ARGS((
	StringInfo	str,
	LispValue	lispObject
));

#endif /* !LispDepIncluded */
@


1.35
log
@int/long problem.   LispInteger was being used to store pointers.
@
text
@d17 1
a17 1
 *	$Header: /faerie/aoki/postgres/src/backend/nodes/RCS/pg_lisp.h,v 1.34 1993/07/10 03:36:47 aoki Exp aoki $
a320 5
extern LispValue ppreserve ARGS((char *pallocObject ));
extern LispValue lppreserve ARGS((LispValue pallocObject ));
extern char *prestore ARGS((char *ppreservedObject ));
extern LispValue lprestore ARGS((LispValue ppreservedObject ));

@


1.34
log
@i can't stand seeing LISP_GC_* anymore..
@
text
@d17 1
a17 1
 *	$Header: /home2/aoki/postgres/src/backend/nodes/RCS/pg_lisp.h,v 1.33 1991/11/14 14:57:25 jolly Exp aoki $
d95 1
a95 1
    int    			fixnum; 
d264 1
a264 1
extern LispValue lispInteger ARGS((int integerValue ));
d319 1
a319 1
extern int CInteger ARGS((LispValue lval ));
@


1.33
log
@added function prototypes
@
text
@d17 1
a17 1
 *	$Header: nodes/RCS/pg_lisp.h,v 1.32 91/10/01 16:27:39 glass Exp Locker: jolly $
a255 8

/* ----------------
 *	obsolete garbage.  this should go away -cim 4/23/90
 * ----------------
 */
#define	LISP_GC_OFF		/* yow! */
#define	LISP_GC_ON		/* yow! */
#define	LISP_GC_PROTECT(X)	/* yow! */
@


1.32
log
@initial ansi c compatibility checkin
@
text
@d17 1
a17 1
 *	$Header: RCS/pg_lisp.h,v 1.31 91/08/09 02:48:21 glass Exp Locker: kemnitz $
d269 9
a277 8
extern LispValue	lispAtom();
extern LispValue	lispDottedPair();
extern LispValue	lispFloat();
extern LispValue	lispInteger();
extern LispValue	lispString();
extern LispValue	lispVectori();
extern LispValue	evalList();
extern LispValue	quote();
d279 8
a286 11
extern LispValue	lispList();
extern LispValue        lispCons();
extern LispValue	nappend1();
extern LispValue 	car();
extern LispValue 	cdr();
extern LispValue 	rplaca();
extern LispValue 	rplacd();
extern LispValue 	find_if_not();
extern LispValue 	find_if();
extern LispValue 	rplacd();
extern			init_list();
d288 30
a317 7
/*
 *	Defined in fmgr/ppreserve.c
 */
extern LispValue	ppreserve();
extern LispValue	lppreserve();
extern char		*prestore();
extern LispValue	lprestore();
d319 1
a319 10
/* 
 * as yet undefined, but should be defined soon
 */
extern LispValue nthCdr();
extern LispValue lispArray();
/* extern LispValue list(); /* XXX - varargs ??? */
extern LispValue setf();
extern LispValue find();
extern LispValue nconc();
extern LispValue nreverse();
d321 2
a322 6
extern int length();
extern LispValue LispRemove();
extern LispValue nLispRemove();
extern LispValue remove_duplicates();
extern LispValue setf();
extern bool equal();
d324 4
a327 10
extern LispValue  LispUnion();
extern LispValue set_difference();
extern LispValue nset_difference();
extern LispValue append();
extern LispValue LispDelete();
extern LispValue push();
extern LispValue collect();
extern LispValue last_element();
extern LispValue last();
extern bool same();
d329 4
a332 8
extern int CAtom();
extern double CDouble();
extern char *CString();
extern int CInteger();

/* temporary functions */

extern LispValue mapcar();
@


1.31
log
@bad prototype fixed
@
text
@d17 1
a17 1
 *	$Header: RCS/pg_lisp.h,v 1.30 91/05/01 18:15:28 kemnitz Exp Locker: glass $
d103 1
a103 1
    inherits(Node); \
d144 1
a144 1
    inherits(Node);
d148 1
a148 1
    inherits(Node);
d152 1
a152 1
    inherits(Node);
d156 1
a156 1
    inherits(Node);
d160 1
a160 1
    inherits(Node);
d164 1
a164 1
    inherits(Node);
@


1.30
log
@fixed parenthesis in integerp
@
text
@d17 1
a17 1
 *	$Header: RCS/pg_lisp.h,v 1.29 91/04/29 17:17:19 kemnitz Exp Locker: kemnitz $
d348 1
a348 1
	FILE		*fp;
@


1.29
log
@god dammit - lispNullP != lispNullp
@
text
@d17 1
a17 1
 *	$Header: RCS/pg_lisp.h,v 1.28 91/04/29 17:15:53 kemnitz Exp Locker: kemnitz $
d222 1
a222 1
    ((x) ? ((bool)LISP_TYPE(x) == PGLISP_INT) : false)
@


1.28
log
@fixed syntax error.
@
text
@d17 1
a17 1
 *	$Header: RCS/pg_lisp.h,v 1.27 91/04/29 17:13:22 kemnitz Exp Locker: kemnitz $
d214 1
a214 1
#define listp(x) (lispNullP(x) || consp(x))
@


1.27
log
@listp(nil) should be true.
@
text
@d17 1
a17 1
 *	$Header: RCS/pg_lisp.h,v 1.26 91/04/29 11:35:50 kemnitz Exp Locker: kemnitz $
d214 1
a214 1
#define listp(x) ((lispNullP(x) || consp(x))
@


1.26
log
@bool(x) != x
@
text
@d17 1
a17 1
 *	$Header: RCS/pg_lisp.h,v 1.25 91/04/28 09:15:38 cimarron Exp Locker: kemnitz $
d214 1
a214 1
#define listp(x) consp(x)
@


1.25
log
@Converted IsValid code into macros and added an improved NodeIsType scheme
@
text
@d17 1
a17 1
 *	$Header: RCS/pg_lisp.h,v 1.24 91/04/27 14:16:00 hong Exp Locker: cimarron $
d212 1
a212 1
    ((bool) (x) ? (bool)(LISP_TYPE(x) == PGLISP_DTPR) : false)
d217 1
a217 1
    ((bool) (x) ? (bool)(LISP_TYPE(x) == PGLISP_STR) : false)
d222 1
a222 1
    ((bool) (x) ? ((bool)LISP_TYPE(x) == PGLISP_INT) : false)
d227 1
a227 1
    ((bool) (x) ? (bool)(LISP_TYPE(x) == PGLISP_ATOM) : false)
d232 1
a232 1
    ((bool) (x) ? (bool)(LISP_TYPE(x) == PGLISP_FLOAT) : false)
@


1.24
log
@added two new functions
@
text
@d17 1
a17 1
 *	$Header: RCS/pg_lisp.h,v 1.23 91/02/05 15:45:27 sp Exp Locker: hong $
d126 10
a182 4
#define lispStringp(x) ((bool)(LISP_TYPE(x)==PGLISP_STR))
#define lispIntegerp(x) ((bool)(LISP_TYPE(x)==PGLISP_INT))
#define lispAtomp(x) ((bool)(LISP_TYPE(x)==PGLISP_ATOM))

a183 6
 *	lispAlloc
 * ----------------
 */
#define lispAlloc() (LispValue) palloc(sizeof(classObj(LispValue)))

/* ----------------
d194 3
d198 1
d202 3
a204 2
/*
 *	Defined in lisplib/lispdep.c
d206 1
a206 1
#define LispTrue 	((LispValue)1)
d208 29
d238 6
d247 2
a268 1
extern LispValue 	LispNil;
a321 1
extern bool null();
a326 1
extern bool listp();
@


1.23
log
@The 'printFunc's (associated with every POSTGRES node) have been
replaced by the 'outFunc's which instead of printing the ascii
representation of an node to a file, they store it in a string.
@
text
@d17 1
a17 1
 *	$Header: RCS/pg_lisp.h,v 1.22 90/10/15 14:51:12 choi Exp $
d270 1
d277 1
@


1.22
log
@changed remove() to LispRemove() to have compile on ultrix 4.0 (Posix)
@
text
@d17 1
a17 1
 *	$Header: RCS/pg_lisp.h,v 1.21 90/10/01 07:46:21 cimarron Exp Locker: choi $
d25 1
d27 1
d294 49
@


1.21
log
@converted everything to use the new TupleTableSlot abstractions
@
text
@d17 1
a17 1
 *	$Header: RCS/pg_lisp.h,v 1.20 90/10/01 01:15:30 cimarron Exp $
d267 1
a267 1
extern LispValue remove();
@


1.20
log
@*** empty log message ***
@
text
@d17 1
a17 1
 *	$Header: RCS/pg_lisp.h,v 1.19 90/08/17 08:52:39 cimarron Exp Locker: cimarron $
@


1.19
log
@added pathnames to #include statements
@
text
@d17 1
a17 1
 *	$Header: RCS/pg_lisp.h,v 1.18 90/05/25 13:03:43 cimarron Version_2 Locker: cimarron $
d90 9
d100 7
a106 12
    /* private: */
    inherits(Node);
    union {
	char			*name;	/* symbol */
	char   			*str;	/* string */
	int    			fixnum;
	double 			flonum;
	struct _LispValue	*car;	/* dotted pair */
	struct vectori		*veci;
    } 			val;
    struct _LispValue	*cdr;
    /* public: */
d159 6
a164 6
#define	PGLISP_ATOM	T_LispSymbol
#define	PGLISP_DTPR	T_LispList
#define	PGLISP_FLOAT	T_LispFloat
#define	PGLISP_INT	T_LispInt
#define	PGLISP_STR	T_LispStr
#define	PGLISP_VECI	T_LispVector
d166 4
a169 4
#define	LISP_BYTEVECTOR			T_LispVector
#define	LISP_DOUBLE			T_LispFloat
#define	LISP_INTEGER			T_LispInt
#define	LISP_STRING			T_LispStr
@


1.18
log
@made changes to support node copy functions
@
text
@d17 1
a17 1
 *	$Header: RCS/pg_lisp.h,v 1.17 90/04/25 13:27:27 cimarron Exp $
d25 1
a25 1
#include "nodes.h"
@


1.17
log
@reorganized nodes to eliminate dead lisp node types
,
@
text
@d17 1
a17 1
 *	$Header$
d27 48
a74 1
/* ----------------
d172 6
d183 1
a183 1
#define CAAR(lv)                (CAR(CAR(lv)))
@


1.16
log
@added find_if{,_not}
@
text
@d1 6
a6 3
/*
 * lispdep.h --
 *	LISP-dependent declarations.
d8 11
a18 2
 * Identification:
 *	$Header: RCS/pg_lisp.h,v 1.15 89/10/06 05:36:50 hirohama Exp Locker: hirohama $
d24 1
a25 3
#include <stdio.h>
#include "tags.h"
#include "c.h"
d27 3
a29 3
/* ==========================================================================
 *	POSTGRES "LISP"
 *		A hack to let the parser run standalone.
d36 7
d58 5
d73 9
a81 12
/*
struct lisp_atom {
	int 			type;
	union {
		char			*name;
		char   			*str;
		int    			fixnum;
		double 			flonum;
		struct lisp_atom	*car;
		struct vectori		*veci;
	} 			val;
	struct lisp_atom	*cdr;
d84 3
a86 2
typedef struct lisp_atom	*LispValue;
*/
d88 3
a90 3
#define	LISP_GC_OFF		/* yow! */
#define	LISP_GC_ON		/* yow! */
#define	LISP_GC_PROTECT(X)	/* yow! */
d92 3
a94 8
#define	CAR(LISPVALUE)			((LISPVALUE)->val.car)
#define	CDR(LISPVALUE)			((LISPVALUE)->cdr)
#define CAAR(lv)                (CAR(CAR(lv)))
#define CADR(lv)			(CAR(CDR(lv)))
#define CADDR(lv)			(CAR(CDR(CDR(lv))))
#define	LISPVALUE_DOUBLE(LISPVALUE)	((LISPVALUE)->val.flonum)
#define	LISPVALUE_INTEGER(LISPVALUE)	((LISPVALUE)->val.fixnum)
#define	LISPVALUE_BYTEVECTOR(LISPVALUE)	((LISPVALUE)->val.veci->data)
d96 3
a98 1
#define	LISP_TYPE(LISPVALUE)		((LISPVALUE)->type)
d100 8
d124 15
d144 24
a200 3

#define nth(index,list)         CAR(nthCdr(index,list))

a234 6
#define foreach(_elt_,_list_)	for(_elt_=(LispValue)_list_; \
_elt_!=LispNil;_elt_=CDR(_elt_))

/* sigh, used so often, I'm lazy to do global search & replace */
#define cons(x,y) lispCons(x,y)

@


1.14
log
@defined car and cdr functions
@
text
@d6 1
a6 1
 *	$Header: RCS/pg_lisp.h,v 1.13 89/09/05 17:09:45 mao C_Demo_1 Locker: hirohama $
d120 3
@


1.13
log
@Working version of C-only demo
@
text
@d6 1
a6 1
 *	$Header: RCS/pg_lisp.h,v 1.12 89/08/29 22:38:00 cimarron Exp $
d117 2
@


1.12
log
@update queries checkin..
@
text
@d6 1
a6 1
 *	$Header: RCS/pg_lisp.h,v 1.11 89/08/23 21:13:54 ong Exp Locker: ong $
@


1.11
log
@added externs for CDouble etc.
@
text
@d6 1
a6 1
 *	$Header: /n/postgres/a/postgres/ong/postgres/src/lib/H/RCS/pg_lisp.h,v 1.10 89/08/01 16:16:45 goh Exp $
d42 9
@


1.10
log
@*** empty log message ***
@
text
@d6 1
a6 1
 *	$Header: /usr6/postgres/goh/newpost/src/lib/H/RCS/pg_lisp.h,v 1.9 89/07/31 11:13:00 goh Exp $
d149 1
d153 3
d160 2
a161 1
#define foreach(elt,list)	for(elt=list;elt!=LispNil;elt=CDR(elt))
@


1.9
log
@*** empty log message ***
@
text
@d6 1
a6 1
 *	$Header: /usr6/postgres/goh/newpost/src/lib/H/RCS/pg_lisp.h,v 1.7 89/07/21 10:42:22 ong Exp $
d156 5
@


1.8
log
@*** empty log message ***
@
text
@d14 1
d74 6
a79 6
#define	PGLISP_ATOM	255
#define	PGLISP_DTPR	254
#define	PGLISP_FLOAT	253
#define	PGLISP_INT	252
#define	PGLISP_STR	251
#define	PGLISP_VECI	250
d81 4
a84 4
#define	LISP_BYTEVECTOR			250
#define	LISP_DOUBLE			253
#define	LISP_INTEGER			252
#define	LISP_STRING			251
@


1.7
log
@added last_element()
@
text
@d6 1
a6 1
 *	$Header: pg_lisp.h,v 1.3 89/07/20 09:03:34 ong Locked $
d12 1
d25 17
d45 2
a46 2
		char			*name;	/* symbol */
		char   			*str;	/* string */
d49 1
a49 1
		struct lisp_atom	*car;	/* dotted pair */
d56 1
d64 1
d73 6
a78 6
#define	PGLISP_ATOM	0
#define	PGLISP_DTPR	1
#define	PGLISP_FLOAT	2
#define	PGLISP_INT	3
#define	PGLISP_STR	4
#define	PGLISP_VECI	5
d80 4
a83 4
#define	LISP_BYTEVECTOR			5
#define	LISP_DOUBLE			2
#define	LISP_INTEGER			3
#define	LISP_STRING			4
d92 2
a94 1
extern LispValue	LispTrue;
d123 3
a125 1
extern LispValue nth();
d127 1
a127 1
extern LispValue list(); /* XXX - varargs ??? */
d147 8
@


1.6
log
@added collect
@
text
@d123 1
@


1.5
log
@added the null function.
@
text
@d122 1
@


1.4
log
@added LispDelete
@
text
@d120 2
@


1.3
log
@*** empty log message ***
@
text
@d6 1
a6 1
 *	$Header: pg_lisp.h,v 1.2 89/07/18 16:10:07 ong Exp $
d118 2
@


1.2
log
@*** empty log message ***
@
text
@d6 1
a6 1
 *	$Header: pg_lisp.h,v 1.1 89/07/18 16:07:59 goh Locked $
d13 1
d108 1
d114 4
@


1.1
log
@Initial revision
@
text
@d6 1
a6 1
 *	$Header: pg_lisp.h,v 1.2 89/06/30 12:06:07 goh Locked $
d109 3
@
