internal.h revision 5dfecf96
15dfecf96Smrg/* $XdotOrg: app/xedit/lisp/internal.h,v 1.3 2004/12/04 00:43:13 kuhn Exp $ */
25dfecf96Smrg/*
35dfecf96Smrg * Copyright (c) 2001 by The XFree86 Project, Inc.
45dfecf96Smrg *
55dfecf96Smrg * Permission is hereby granted, free of charge, to any person obtaining a
65dfecf96Smrg * copy of this software and associated documentation files (the "Software"),
75dfecf96Smrg * to deal in the Software without restriction, including without limitation
85dfecf96Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
95dfecf96Smrg * and/or sell copies of the Software, and to permit persons to whom the
105dfecf96Smrg * Software is furnished to do so, subject to the following conditions:
115dfecf96Smrg *
125dfecf96Smrg * The above copyright notice and this permission notice shall be included in
135dfecf96Smrg * all copies or substantial portions of the Software.
145dfecf96Smrg *
155dfecf96Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
165dfecf96Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
175dfecf96Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
185dfecf96Smrg * THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
195dfecf96Smrg * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
205dfecf96Smrg * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
215dfecf96Smrg * SOFTWARE.
225dfecf96Smrg *
235dfecf96Smrg * Except as contained in this notice, the name of the XFree86 Project shall
245dfecf96Smrg * not be used in advertising or otherwise to promote the sale, use or other
255dfecf96Smrg * dealings in this Software without prior written authorization from the
265dfecf96Smrg * XFree86 Project.
275dfecf96Smrg *
285dfecf96Smrg * Author: Paulo César Pereira de Andrade
295dfecf96Smrg */
305dfecf96Smrg
315dfecf96Smrg/* $XFree86: xc/programs/xedit/lisp/internal.h,v 1.50tsi Exp $ */
325dfecf96Smrg
335dfecf96Smrg#ifndef Lisp_internal_h
345dfecf96Smrg#define Lisp_internal_h
355dfecf96Smrg
365dfecf96Smrg#include <stdio.h>
375dfecf96Smrg#include "lisp/lisp.h"
385dfecf96Smrg
395dfecf96Smrg#include "mp.h"
405dfecf96Smrg#include "re.h"
415dfecf96Smrg
425dfecf96Smrg/*
435dfecf96Smrg * Defines
445dfecf96Smrg */
455dfecf96Smrgtypedef struct _LispMac LispMac;
465dfecf96Smrg
475dfecf96Smrg#define STREAM_READ		0x01
485dfecf96Smrg#define STREAM_WRITE		0x02
495dfecf96Smrg#define STREAM_BINARY		0x20
505dfecf96Smrg
515dfecf96Smrg#define RPLACA(cons, object)	(CAR(cons) = object)
525dfecf96Smrg#define RPLACD(cons, object)	(CDR(cons) = object)
535dfecf96Smrg
545dfecf96Smrg#define	CAR(list)		((list)->data.cons.car)
555dfecf96Smrg#define	CAAR(list)		((list)->data.cons.car->data.cons.car)
565dfecf96Smrg#define	CADR(list)		((list)->data.cons.cdr->data.cons.car)
575dfecf96Smrg#define CDR(list)		((list)->data.cons.cdr)
585dfecf96Smrg#define CDAR(list)		((list)->data.cons.car->data.cons.cdr)
595dfecf96Smrg#define CDDR(list)		((list)->data.cons.cdr->data.cons.cdr)
605dfecf96Smrg#define CONS(car, cdr)		LispNewCons(car, cdr)
615dfecf96Smrg#define EVAL(list)		LispEval(list)
625dfecf96Smrg#define APPLY(fun, args)	LispFuncall(fun, args, 0)
635dfecf96Smrg#define APPLY1(fun, arg)	LispApply1(fun, arg)
645dfecf96Smrg#define APPLY2(fun, arg1, arg2)	LispApply2(fun, arg1, arg2)
655dfecf96Smrg#define APPLY3(f, a1, a2, a3)	LispApply3(f, a1, a2, a3)
665dfecf96Smrg#define EXECUTE(string)		LispExecute(string)
675dfecf96Smrg#define SYMBOL(atom)		LispNewSymbol(atom)
685dfecf96Smrg#define ATOM(string)		LispNewAtom(string, 1)
695dfecf96Smrg#define UNINTERNED_ATOM(string)	LispNewAtom(string, 0)
705dfecf96Smrg#define FUNCTION(symbol)	LispNewFunction(symbol)
715dfecf96Smrg#define FUNCTION_QUOTE(symbol)	LispNewFunctionQuote(symbol)
725dfecf96Smrg
735dfecf96Smrg	/* atom string is a static variable */
745dfecf96Smrg#define ATOM2(string)		LispNewSymbol(LispGetPermAtom(string))
755dfecf96Smrg
765dfecf96Smrg	/* make a gc never released variable with a static string argument */
775dfecf96Smrg#define STATIC_ATOM(string)	LispNewStaticAtom(string)
785dfecf96Smrg
795dfecf96Smrg#define STRING(str)		LispNewString(str, strlen(str), 0)
805dfecf96Smrg#define LSTRING(str, size)	LispNewString(str, size, 0)
815dfecf96Smrg
825dfecf96Smrg	/* string must be from the LispXXX allocation functions,
835dfecf96Smrg	 * and LispMused not yet called on it */
845dfecf96Smrg#define STRING2(str)		LispNewString(str, strlen(str), 1)
855dfecf96Smrg#define LSTRING2(str, size)	LispNewString(str, size, 1)
865dfecf96Smrg
875dfecf96Smrg#define VECTOR(objects)		LispNewVector(objects)
885dfecf96Smrg
895dfecf96Smrg	/* STRINGSTREAM2 and LSTRINGSTREAM2 require that the
905dfecf96Smrg	 * string be allocated from the LispXXX allocation functions,
915dfecf96Smrg	 * and LispMused not yet called on it */
925dfecf96Smrg#define STRINGSTREAM(str, flag)			\
935dfecf96Smrg	LispNewStringStream(str, flag, strlen(str), 0)
945dfecf96Smrg#define STRINGSTREAM2(str, flag)		\
955dfecf96Smrg	LispNewStringStream(str, flag, strlen(str), 1)
965dfecf96Smrg#define LSTRINGSTREAM(str, flag, length)	\
975dfecf96Smrg	LispNewStringStream(str, flag, length, 0)
985dfecf96Smrg#define LSTRINGSTREAM2(str, flag, length)	\
995dfecf96Smrg	LispNewStringStream(str, flag, length, 1)
1005dfecf96Smrg
1015dfecf96Smrg#define FILESTREAM(file, path, flag)	\
1025dfecf96Smrg	LispNewFileStream(file, path, flag)
1035dfecf96Smrg#define PIPESTREAM(file, path, flag)	\
1045dfecf96Smrg	LispNewPipeStream(file, path, flag)
1055dfecf96Smrg
1065dfecf96Smrg#define CHECKO(obj, typ)						\
1075dfecf96Smrg	((obj)->type == LispOpaque_t && 				\
1085dfecf96Smrg	 ((obj)->data.opaque.type == typ || (obj)->data.opaque.type == 0))
1095dfecf96Smrg#define PROTECT(key, list)	LispProtect(key, list)
1105dfecf96Smrg#define UPROTECT(key, list)	LispUProtect(key, list)
1115dfecf96Smrg
1125dfecf96Smrg/* create a new unique static atom string */
1135dfecf96Smrg#define GETATOMID(string)	LispGetAtomString(string, 1)
1145dfecf96Smrg
1155dfecf96Smrg#define	GCDisable()		++gcpro
1165dfecf96Smrg#define	GCEnable()		--gcpro
1175dfecf96Smrg
1185dfecf96Smrg
1195dfecf96Smrg/* pointer to something unique to all atoms with the same print representation */
1205dfecf96Smrg#define ATOMID(object)		(object)->data.atom->string
1215dfecf96Smrg
1225dfecf96Smrg
1235dfecf96Smrg
1245dfecf96Smrg#define NIL_BIT			0x01
1255dfecf96Smrg#define FIXNUM_BIT		0x02
1265dfecf96Smrg#define FIXNUM_MASK		0x03
1275dfecf96Smrg#define SCHAR_BIT		0x04
1285dfecf96Smrg#define SCHAR_MASK		0x05
1295dfecf96Smrg#define BIT_COUNT		4
1305dfecf96Smrg#define BIT_MASK		0x0f
1315dfecf96Smrg#define POINTERP(object)						\
1325dfecf96Smrg    (((unsigned long)(object) & NIL_BIT) == 0)
1335dfecf96Smrg
1345dfecf96Smrg#define MOST_POSITIVE_FIXNUM	((1L << (sizeof(long) * 8 - 5)) - 1)
1355dfecf96Smrg#define MOST_NEGATIVE_FIXNUM	(-1L << (sizeof(long) * 8 - 5))
1365dfecf96Smrg
1375dfecf96Smrg#define SCHAR(value)							\
1385dfecf96Smrg    ((LispObj*)(((long)(value) << BIT_COUNT) | SCHAR_MASK))
1395dfecf96Smrg#define SCHAR_VALUE(object)	FIXNUM_VALUE(object)
1405dfecf96Smrg#define SCHARP(object)							\
1415dfecf96Smrg    (((unsigned long)(object) & BIT_MASK) == SCHAR_MASK)
1425dfecf96Smrg#define CHECK_SCHAR(object)						\
1435dfecf96Smrg    if (!SCHARP(object))						\
1445dfecf96Smrg	LispDestroy("%s: %s is not a character",			\
1455dfecf96Smrg		    STRFUN(builtin), STROBJ(object))
1465dfecf96Smrg
1475dfecf96Smrg#define XOBJECT_TYPE(object)	((object)->type)
1485dfecf96Smrg#define OBJECT_TYPE(object)	(POINTERP(object) ?			\
1495dfecf96Smrg				XOBJECT_TYPE(object) :			\
1505dfecf96Smrg				(LispType)((long)(object) & BIT_MASK))
1515dfecf96Smrg
1525dfecf96Smrg
1535dfecf96Smrg#define NIL			(LispObj*)0x00000001
1545dfecf96Smrg#define T			(LispObj*)0x00000011
1555dfecf96Smrg#define DOT			(LispObj*)0x00000021
1565dfecf96Smrg/* unmatched ')' */
1575dfecf96Smrg#define	EOLIST			(LispObj*)0x00000031
1585dfecf96Smrg#define READLABEL_MASK		0x00000041
1595dfecf96Smrg/* unspecified argument */
1605dfecf96Smrg#define UNSPEC			(LispObj*)0x00000051
1615dfecf96Smrg#define INVALIDP(object)						\
1625dfecf96Smrg    ((object) == NULL || (object) == EOLIST || (object) == DOT)
1635dfecf96Smrg
1645dfecf96Smrg
1655dfecf96Smrg/* cons */
1665dfecf96Smrg#define XCONSP(object)		((object)->type == LispCons_t)
1675dfecf96Smrg#define CONSP(object)		(POINTERP(object) && XCONSP(object))
1685dfecf96Smrg#define CHECK_CONS(object)						\
1695dfecf96Smrg    if (!CONSP(object))							\
1705dfecf96Smrg	LispDestroy("%s: %s is not of type cons",			\
1715dfecf96Smrg		    STRFUN(builtin), STROBJ(object))
1725dfecf96Smrg#define LISTP(object)		(object == NIL || CONSP(object))
1735dfecf96Smrg#define CHECK_LIST(object)						\
1745dfecf96Smrg    if (!LISTP(object))							\
1755dfecf96Smrg	LispDestroy("%s: %s is not a list",				\
1765dfecf96Smrg		    STRFUN(builtin), STROBJ(object))
1775dfecf96Smrg
1785dfecf96Smrg/* fixnum */
1795dfecf96Smrg#define FIXNUM(value)							\
1805dfecf96Smrg    ((LispObj*)(((long)(value) << BIT_COUNT) | FIXNUM_MASK))
1815dfecf96Smrg#define FIXNUM_VALUE(object)	((long)(object) >> BIT_COUNT)
1825dfecf96Smrg#define FIXNUMP(object)							\
1835dfecf96Smrg    (((unsigned long)(object) & BIT_MASK) == FIXNUM_MASK)
1845dfecf96Smrg#define CHECK_FIXNUM(object)						\
1855dfecf96Smrg    if (!FIXNUMP(object))						\
1865dfecf96Smrg	LispDestroy("%s: %s is not a fixnum",				\
1875dfecf96Smrg		    STRFUN(builtin), STROBJ(object))
1885dfecf96Smrg#define INDEXP(object)							\
1895dfecf96Smrg    (FIXNUMP(object) && FIXNUM_VALUE(object) >= 0)
1905dfecf96Smrg#define CHECK_INDEX(object)						\
1915dfecf96Smrg    if (!INDEXP(object))						\
1925dfecf96Smrg	LispDestroy("%s: %s is not a positive fixnum",			\
1935dfecf96Smrg		    STRFUN(builtin), STROBJ(object))
1945dfecf96Smrg
1955dfecf96Smrg
1965dfecf96Smrg/* long int integer */
1975dfecf96Smrg#define XINTP(object)		((object)->type == LispInteger_t)
1985dfecf96Smrg#define INTP(objet)		(POINTERP(object) && XINTP(object))
1995dfecf96Smrg#define INT_VALUE(object)	(object)->data.integer
2005dfecf96Smrg
2015dfecf96Smrg
2025dfecf96Smrg/* values that fit in a machine long int but not in a fixnum */
2035dfecf96Smrg#define LONGINTP(object)						\
2045dfecf96Smrg    (POINTERP(object) ? XINTP(object) : FIXNUMP(object))
2055dfecf96Smrg#define LONGINT_VALUE(object)						\
2065dfecf96Smrg    (POINTERP(object) ? INT_VALUE(object) : FIXNUM_VALUE(object))
2075dfecf96Smrg#define CHECK_LONGINT(object)						\
2085dfecf96Smrg    if (!LONGINTP(object))						\
2095dfecf96Smrg	LispDestroy("%s: %s is not an integer",				\
2105dfecf96Smrg		    STRFUN(builtin), STROBJ(object))
2115dfecf96Smrg
2125dfecf96Smrg
2135dfecf96Smrg/* bignum */
2145dfecf96Smrg#define XBIGNUMP(object)	((object)->type == LispBignum_t)
2155dfecf96Smrg#define BIGNUMP(object)		(POINTERP(object) && XBIGNUMP(object))
2165dfecf96Smrg#define BIGNUM(object)		LispNewBignum(object)
2175dfecf96Smrg
2185dfecf96Smrg
2195dfecf96Smrg/* generic integer */
2205dfecf96Smrg#define INTEGER(integer)	LispNewInteger(integer)
2215dfecf96Smrg#define INTEGERP(object)						\
2225dfecf96Smrg    (POINTERP(object) ? XINTP(object) || XBIGNUMP(object) : FIXNUMP(object))
2235dfecf96Smrg#define CHECK_INTEGER(object)						\
2245dfecf96Smrg    if (!INTEGERP(object))						\
2255dfecf96Smrg	LispDestroy("%s: %s is not an integer",				\
2265dfecf96Smrg		    STRFUN(builtin), STROBJ(object))
2275dfecf96Smrg
2285dfecf96Smrg
2295dfecf96Smrg/* ratio */
2305dfecf96Smrg#define XRATIOP(object)		((object)->type == LispRatio_t)
2315dfecf96Smrg#define RATIOP(object)		(POINTERP(object) && XRATIOP(object))
2325dfecf96Smrg#define RATIO(num, den)		LispNewRatio(num, den)
2335dfecf96Smrg
2345dfecf96Smrg
2355dfecf96Smrg/* bigratio */
2365dfecf96Smrg#define XBIGRATIOP(object)	((object)->type == LispBigratio_t)
2375dfecf96Smrg#define BIGRATIOP(object)	(POINTERP(object) && XBIGRATIOP(object))
2385dfecf96Smrg#define BIGRATIO(ratio)		LispNewBigratio(ratio)
2395dfecf96Smrg
2405dfecf96Smrg
2415dfecf96Smrg/* generic rational */
2425dfecf96Smrg#define RATIONALP(object)						\
2435dfecf96Smrg    (POINTERP(object) ? XINTP(object) || XRATIOP(object) ||		\
2445dfecf96Smrg			XBIGNUMP(object) || XBIGRATIOP(object) :	\
2455dfecf96Smrg			FIXNUMP(object))
2465dfecf96Smrg
2475dfecf96Smrg
2485dfecf96Smrg/* double float */
2495dfecf96Smrg#define XDFLOATP(object)	((object)->type == LispDFloat_t)
2505dfecf96Smrg#define DFLOATP(object)		(POINTERP(object) && XDFLOATP(object))
2515dfecf96Smrg#define DFLOAT_VALUE(object)	(object)->data.dfloat
2525dfecf96Smrg#define CHECK_DFLOAT(object)						\
2535dfecf96Smrg    if (!DFLOATP(object))						\
2545dfecf96Smrg	LispDestroy("%s: %s is not a float number",			\
2555dfecf96Smrg		    STRFUN(builtin), STROBJ(object))
2565dfecf96Smrg#define DFLOAT(value)		LispNewDFloat(value)
2575dfecf96Smrg
2585dfecf96Smrg
2595dfecf96Smrg/* generic float - currently only double float supported */
2605dfecf96Smrg#define FLOATP(object)		DFLOATP(object)
2615dfecf96Smrg
2625dfecf96Smrg
2635dfecf96Smrg/* real number */
2645dfecf96Smrg#define REALP(object)							\
2655dfecf96Smrg    (POINTERP(object) ? XINTP(object) || XDFLOATP(object) ||		\
2665dfecf96Smrg			XRATIOP(object) || XBIGNUMP(object) ||		\
2675dfecf96Smrg			XBIGRATIOP(object) :				\
2685dfecf96Smrg			FIXNUMP(object))
2695dfecf96Smrg#define CHECK_REAL(object)						\
2705dfecf96Smrg    if (!REALP(object))							\
2715dfecf96Smrg	LispDestroy("%s: %s is not a real number",			\
2725dfecf96Smrg		    STRFUN(builtin), STROBJ(object))
2735dfecf96Smrg
2745dfecf96Smrg
2755dfecf96Smrg/* complex */
2765dfecf96Smrg#define XCOMPLEXP(object)	((object)->type == LispComplex_t)
2775dfecf96Smrg#define COMPLEXP(object)	(POINTERP(object) && XCOMPLEXP(object))
2785dfecf96Smrg#define COMPLEX(real, imag)	LispNewComplex(real, imag)
2795dfecf96Smrg
2805dfecf96Smrg
2815dfecf96Smrg/* generic number */
2825dfecf96Smrg#define NUMBERP(object)							\
2835dfecf96Smrg    (POINTERP(object) ? XINTP(object) || XDFLOATP(object) ||		\
2845dfecf96Smrg			XRATIOP(object) || XBIGNUMP(object) ||		\
2855dfecf96Smrg			XBIGRATIOP(object) || XCOMPLEXP(object) :	\
2865dfecf96Smrg			FIXNUMP(object))
2875dfecf96Smrg#define CHECK_NUMBER(object)						\
2885dfecf96Smrg    if (!NUMBERP(object))						\
2895dfecf96Smrg	LispDestroy("%s: %s is not a number",				\
2905dfecf96Smrg		    STRFUN(builtin), STROBJ(object))
2915dfecf96Smrg
2925dfecf96Smrg
2935dfecf96Smrg/* symbol */
2945dfecf96Smrg#define XSYMBOLP(object)	((object)->type == LispAtom_t)
2955dfecf96Smrg#define SYMBOLP(object)		(POINTERP(object) && XSYMBOLP(object))
2965dfecf96Smrg#define CHECK_SYMBOL(object)						\
2975dfecf96Smrg    if (!SYMBOLP(object))						\
2985dfecf96Smrg	LispDestroy("%s: %s is not a symbol",				\
2995dfecf96Smrg		    STRFUN(builtin), STROBJ(object))
3005dfecf96Smrg
3015dfecf96Smrg
3025dfecf96Smrg/* keyword */
3035dfecf96Smrg#define XKEYWORDP(object)						\
3045dfecf96Smrg    ((object)->data.atom->package == lisp__data.keyword)
3055dfecf96Smrg#define KEYWORDP(object)						\
3065dfecf96Smrg    (POINTERP(object) && XSYMBOLP(object) && XKEYWORDP(object))
3075dfecf96Smrg#define KEYWORD(string)		LispNewKeyword(string)
3085dfecf96Smrg#define CHECK_KEYWORD(object)						\
3095dfecf96Smrg    if (!KEYWORDP(object))						\
3105dfecf96Smrg	LispDestroy("%s: %s is not a keyword",				\
3115dfecf96Smrg		    STRFUN(builtin), STROBJ(object))
3125dfecf96Smrg#define CHECK_CONSTANT(object)						\
3135dfecf96Smrg    if ((object)->data.atom->constant)					\
3145dfecf96Smrg	LispDestroy("%s: %s is a constant",				\
3155dfecf96Smrg		    STRFUN(builtin), STROBJ(object))
3165dfecf96Smrg
3175dfecf96Smrg#define SETVALUE(atom, object)	((atom)->property->value = object)
3185dfecf96Smrg
3195dfecf96Smrg
3205dfecf96Smrg/* function */
3215dfecf96Smrg#define XFUNCTIONP(object)	((object)->type == LispFunction_t)
3225dfecf96Smrg#define FUNCTIONP(object)	(POINTERP(object) && XFUNCTIONP(object))
3235dfecf96Smrg
3245dfecf96Smrg
3255dfecf96Smrg/* lambda */
3265dfecf96Smrg#define XLAMBDAP(object)	((object)->type == LispLambda_t)
3275dfecf96Smrg#define LAMBDAP(object)		(POINTERP(object) && XLAMBDAP(object))
3285dfecf96Smrg
3295dfecf96Smrg
3305dfecf96Smrg/* string - currently only simple 8 bit characters */
3315dfecf96Smrg#define XSTRINGP(object)	((object)->type == LispString_t)
3325dfecf96Smrg#define STRINGP(object)		(POINTERP(object) && XSTRINGP(object))
3335dfecf96Smrg#define THESTR(object)		(object)->data.string.string
3345dfecf96Smrg#define STRLEN(object)		(object)->data.string.length
3355dfecf96Smrg#define CHECK_STRING(object)						\
3365dfecf96Smrg    if (!STRINGP(object))						\
3375dfecf96Smrg	LispDestroy("%s: %s is not a string",				\
3385dfecf96Smrg		    STRFUN(builtin), STROBJ(object))
3395dfecf96Smrg#define CHECK_STRING_WRITABLE(object)					\
3405dfecf96Smrg    if (!object->data.string.writable)					\
3415dfecf96Smrg	LispDestroy("%s: %s is readonly",				\
3425dfecf96Smrg		    STRFUN(builtin), STROBJ(object))
3435dfecf96Smrg
3445dfecf96Smrg
3455dfecf96Smrg/* array/vector */
3465dfecf96Smrg#define XARRAYP(object)		((object)->type == LispArray_t)
3475dfecf96Smrg#define ARRAYP(object)		(POINTERP(object) && XARRAYP(object))
3485dfecf96Smrg#define CHECK_ARRAY(object)						\
3495dfecf96Smrg    if (!ARRAYP(object))						\
3505dfecf96Smrg	LispDestroy("%s: %s is not an array",				\
3515dfecf96Smrg		    STRFUN(builtin), STROBJ(object))
3525dfecf96Smrg
3535dfecf96Smrg
3545dfecf96Smrg/* quote */
3555dfecf96Smrg#define XQUOTEP(object)		((object)->type == LispQuote_t)
3565dfecf96Smrg#define QUOTEP(object)		(POINTERP(object) && XQUOTEP(object))
3575dfecf96Smrg#define QUOTE(object)		LispNewQuote(object)
3585dfecf96Smrg
3595dfecf96Smrg#define XBACKQUOTEP(object)	((object)->type == LispBackquote_t)
3605dfecf96Smrg#define BACKQUOTEP(object)	(POINTERP(object) && XBACKQUOTEP(object))
3615dfecf96Smrg#define BACKQUOTE(object)	LispNewBackquote(object)
3625dfecf96Smrg
3635dfecf96Smrg#define XCOMMAP(object)		((object)->type == LispComma_t)
3645dfecf96Smrg#define COMMAP(object)		(POINTERP(object) && XCOMMAP(object))
3655dfecf96Smrg#define COMMA(object, at)	LispNewComma(object, at)
3665dfecf96Smrg
3675dfecf96Smrg
3685dfecf96Smrg/* package */
3695dfecf96Smrg#define XPACKAGEP(object)	((object)->type == LispPackage_t)
3705dfecf96Smrg#define PACKAGEP(object)	(POINTERP(object) && XPACKAGEP(object))
3715dfecf96Smrg
3725dfecf96Smrg
3735dfecf96Smrg/* pathname */
3745dfecf96Smrg#define XPATHNAMEP(object)	((object)->type == LispPathname_t)
3755dfecf96Smrg#define PATHNAMEP(object)	(POINTERP(object) && XPATHNAMEP(object))
3765dfecf96Smrg#define PATHNAME(object)	LispNewPathname(object)
3775dfecf96Smrg#define CHECK_PATHNAME(object)						\
3785dfecf96Smrg    if (!PATHNAMEP(object))						\
3795dfecf96Smrg	LispDestroy("%s: %s is not a pathname",				\
3805dfecf96Smrg		    STRFUN(builtin), STROBJ(object))
3815dfecf96Smrg
3825dfecf96Smrg
3835dfecf96Smrg/* stream */
3845dfecf96Smrg#define XSTREAMP(object)	((object)->type == LispStream_t)
3855dfecf96Smrg#define STREAMP(object)		(POINTERP(object) && XSTREAMP(object))
3865dfecf96Smrg#define CHECK_STREAM(object)						\
3875dfecf96Smrg    if (!STREAMP(object))						\
3885dfecf96Smrg	LispDestroy("%s: %s is not a stream",				\
3895dfecf96Smrg		    STRFUN(builtin), STROBJ(object))
3905dfecf96Smrg
3915dfecf96Smrg
3925dfecf96Smrg/* hastable */
3935dfecf96Smrg#define XHASHTABLEP(object)	((object)->type == LispHashTable_t)
3945dfecf96Smrg#define HASHTABLEP(object)	(POINTERP(object) && XHASHTABLEP(object))
3955dfecf96Smrg#define CHECK_HASHTABLE(object)						\
3965dfecf96Smrg    if (!HASHTABLEP(object))						\
3975dfecf96Smrg	LispDestroy("%s: %s is not a hash-table",			\
3985dfecf96Smrg		    STRFUN(builtin), STROBJ(object))
3995dfecf96Smrg
4005dfecf96Smrg
4015dfecf96Smrg/* regex */
4025dfecf96Smrg#define XREGEXP(object)		((object)->type == LispRegex_t)
4035dfecf96Smrg#define REGEXP(object)		(POINTERP(object) && XREGEXP(object))
4045dfecf96Smrg#define CHECK_REGEX(object)						\
4055dfecf96Smrg    if (!REGEXP(object))						\
4065dfecf96Smrg	LispDestroy("%s: %s is not a regexp",				\
4075dfecf96Smrg		    STRFUN(builtin), STROBJ(object))
4085dfecf96Smrg
4095dfecf96Smrg
4105dfecf96Smrg/* bytecode */
4115dfecf96Smrg#define XBYTECODEP(object)	((object)->type == LispBytecode_t)
4125dfecf96Smrg#define BYTECODEP(object)	(POINTERP(object) && XBYTECODEP(object))
4135dfecf96Smrg
4145dfecf96Smrg
4155dfecf96Smrg/* opaque */
4165dfecf96Smrg#define XOPAQUEP(object)	((object)->type == LispOpaque_t)
4175dfecf96Smrg#define OPAQUEP(object)		(POINTERP(object) && XOPAQUEP(object))
4185dfecf96Smrg#define OPAQUE(data, type)	LispNewOpaque((void*)((long)data), type)
4195dfecf96Smrg
4205dfecf96Smrg
4215dfecf96Smrg
4225dfecf96Smrg#define SSTREAMP(str)		((str)->data.stream.source.string)
4235dfecf96Smrg
4245dfecf96Smrg#define FSTREAMP(str)		((str)->data.stream.source.file)
4255dfecf96Smrg
4265dfecf96Smrg#define PSTREAMP(str)		((str)->data.stream.source.program)
4275dfecf96Smrg#define PIDPSTREAMP(str)	((str)->data.stream.source.program->pid)
4285dfecf96Smrg#define IPSTREAMP(str)		((str)->data.stream.source.program->input)
4295dfecf96Smrg#define OPSTREAMP(str)		((str)->data.stream.source.program->output)
4305dfecf96Smrg#define EPSTREAMP(str)		\
4315dfecf96Smrg	FSTREAMP((str)->data.stream.source.program->errorp)
4325dfecf96Smrg
4335dfecf96Smrg#define LispFileno(file)	((file)->descriptor)
4345dfecf96Smrg
4355dfecf96Smrg#define STRFUN(builtin)		ATOMID(builtin->symbol)
4365dfecf96Smrg#define STROBJ(obj)		LispStrObj(obj)
4375dfecf96Smrg
4385dfecf96Smrg/* fetch builtin function/macro argument value
4395dfecf96Smrg */
4405dfecf96Smrg#define ARGUMENT(index)							\
4415dfecf96Smrg	lisp__data.stack.values[lisp__data.stack.base + (index)]
4425dfecf96Smrg
4435dfecf96Smrg#define RETURN(index)	lisp__data.returns.values[(index)]
4445dfecf96Smrg#define RETURN_COUNT	lisp__data.returns.count
4455dfecf96Smrg#define RETURN_CHECK(value)						\
4465dfecf96Smrg    value < MULTIPLE_VALUES_LIMIT ?					\
4475dfecf96Smrg	value : MULTIPLE_VALUES_LIMIT
4485dfecf96Smrg
4495dfecf96Smrg#define GC_ENTER()		int gc__protect = lisp__data.protect.length
4505dfecf96Smrg
4515dfecf96Smrg#define GC_PROTECT(object)						\
4525dfecf96Smrg    if (lisp__data.protect.length >= lisp__data.protect.space)		\
4535dfecf96Smrg	LispMoreProtects();						\
4545dfecf96Smrg    lisp__data.protect.objects[lisp__data.protect.length++] = object
4555dfecf96Smrg
4565dfecf96Smrg#define GC_LEAVE()		lisp__data.protect.length = gc__protect
4575dfecf96Smrg
4585dfecf96Smrg
4595dfecf96Smrg#define ERROR_CHECK_SPECIAL_FORM(atom)					\
4605dfecf96Smrg    if (atom->property->fun.builtin->compile)				\
4615dfecf96Smrg	LispDestroy("%s: the special form %s cannot be redefined",	\
4625dfecf96Smrg		    STRFUN(builtin), atom->string)
4635dfecf96Smrg
4645dfecf96Smrg
4655dfecf96Smrg
4665dfecf96Smrg#define CONSTANTP(object)						\
4675dfecf96Smrg    (!POINTERP(object) ||						\
4685dfecf96Smrg     XOBJECT_TYPE(object) < LispAtom_t ||				\
4695dfecf96Smrg     (XSYMBOLP(object) && XKEYWORDP(object)))
4705dfecf96Smrg
4715dfecf96Smrg/* slightly faster test, since keywords are very uncommon as eval arguments */
4725dfecf96Smrg#define NCONSTANTP(object)						\
4735dfecf96Smrg    (OBJECT_TYPE(object) >= LispAtom_t)
4745dfecf96Smrg
4755dfecf96Smrg
4765dfecf96Smrg/*
4775dfecf96Smrg * Types
4785dfecf96Smrg */
4795dfecf96Smrgtypedef struct _LispObj LispObj;
4805dfecf96Smrgtypedef struct _LispAtom LispAtom;
4815dfecf96Smrgtypedef struct _LispBuiltin LispBuiltin;
4825dfecf96Smrgtypedef struct _LispModuleData LispModuleData;
4835dfecf96Smrgtypedef struct _LispFile LispFile;
4845dfecf96Smrgtypedef struct _LispString LispString;
4855dfecf96Smrgtypedef struct _LispPackage LispPackage;
4865dfecf96Smrgtypedef struct _LispBytecode LispBytecode;
4875dfecf96Smrgtypedef struct _LispHashTable LispHashTable;
4885dfecf96Smrg
4895dfecf96Smrg/* Bytecode compiler data */
4905dfecf96Smrgtypedef struct _LispCom LispCom;
4915dfecf96Smrg
4925dfecf96Smrgtypedef char *Atom_id;
4935dfecf96Smrg
4945dfecf96Smrgtypedef enum _LispType {
4955dfecf96Smrg    /* objects encoded in the LispObj pointer */
4965dfecf96Smrg    LispNil_t = 1,
4975dfecf96Smrg    LispFixnum_t = 3,
4985dfecf96Smrg    LispSChar_t = 5,
4995dfecf96Smrg
5005dfecf96Smrg    /* objects that have a structure */
5015dfecf96Smrg    LispInteger_t = 16,
5025dfecf96Smrg    LispDFloat_t,
5035dfecf96Smrg    LispString_t,
5045dfecf96Smrg    LispRatio_t,
5055dfecf96Smrg    LispOpaque_t,
5065dfecf96Smrg
5075dfecf96Smrg    /* simple access for marking */
5085dfecf96Smrg    LispBignum_t,
5095dfecf96Smrg    LispBigratio_t,
5105dfecf96Smrg
5115dfecf96Smrg    LispAtom_t,
5125dfecf96Smrg    LispFunction_t,
5135dfecf96Smrg    LispFunctionQuote_t,
5145dfecf96Smrg
5155dfecf96Smrg    LispLambda_t,
5165dfecf96Smrg
5175dfecf96Smrg    LispComplex_t,
5185dfecf96Smrg    LispCons_t,
5195dfecf96Smrg    LispQuote_t,
5205dfecf96Smrg    LispArray_t,
5215dfecf96Smrg    LispStruct_t,
5225dfecf96Smrg    LispStream_t,
5235dfecf96Smrg    LispBackquote_t,
5245dfecf96Smrg    LispComma_t,
5255dfecf96Smrg    LispPathname_t,
5265dfecf96Smrg    LispPackage_t,
5275dfecf96Smrg    LispRegex_t,
5285dfecf96Smrg    LispBytecode_t,
5295dfecf96Smrg    LispHashTable_t
5305dfecf96Smrg} LispType;
5315dfecf96Smrg
5325dfecf96Smrgtypedef enum _LispFunType {
5335dfecf96Smrg    LispLambda,
5345dfecf96Smrg    LispFunction,
5355dfecf96Smrg    LispMacro,
5365dfecf96Smrg    LispSetf
5375dfecf96Smrg} LispFunType;
5385dfecf96Smrg
5395dfecf96Smrgtypedef enum _LispStreamType {
5405dfecf96Smrg    LispStreamString,
5415dfecf96Smrg    LispStreamFile,
5425dfecf96Smrg    LispStreamStandard,
5435dfecf96Smrg    LispStreamPipe
5445dfecf96Smrg} LispStreamType;
5455dfecf96Smrg
5465dfecf96Smrgtypedef struct {
5475dfecf96Smrg    int pid;			/* process id of program */
5485dfecf96Smrg    LispFile *input;		/* if READABLE: stdout of program */
5495dfecf96Smrg    LispFile *output;		/* if WRITABLE: stdin of program */
5505dfecf96Smrg    LispObj *errorp;		/* ALWAYS (ONLY) READABLE: stderr of program */
5515dfecf96Smrg} LispPipe;
5525dfecf96Smrg
5535dfecf96Smrg/* silly IBM compiler */
5545dfecf96Smrg#ifdef AIXV5 /* probably want !gcc too */
5555dfecf96Smrg#define LispType int
5565dfecf96Smrg#define LispFunType int
5575dfecf96Smrg#define LispStreamType int
5585dfecf96Smrg#endif
5595dfecf96Smrg
5605dfecf96Smrgstruct _LispObj {
5615dfecf96Smrg    LispType type : 6;
5625dfecf96Smrg    unsigned int mark : 1;	/* gc protected */
5635dfecf96Smrg    unsigned int prot: 1;	/* protection for constant/unamed variables */
5645dfecf96Smrg    LispFunType funtype : 4;	/* this is subject to change in the future */
5655dfecf96Smrg    union {
5665dfecf96Smrg	LispAtom *atom;
5675dfecf96Smrg	struct {
5685dfecf96Smrg	    char *string;
5695dfecf96Smrg	    long length;
5705dfecf96Smrg	    unsigned int writable : 1;
5715dfecf96Smrg	} string;
5725dfecf96Smrg	long integer;
5735dfecf96Smrg	double dfloat;
5745dfecf96Smrg	LispObj *quote;
5755dfecf96Smrg	LispObj *pathname;	/* don't use quote generic name,
5765dfecf96Smrg				 * to avoid confusing code */
5775dfecf96Smrg	struct {
5785dfecf96Smrg	    long numerator;
5795dfecf96Smrg	    long denominator;
5805dfecf96Smrg	} ratio;
5815dfecf96Smrg	union {
5825dfecf96Smrg	    mpi *integer;
5835dfecf96Smrg	    mpr *ratio;
5845dfecf96Smrg	} mp;
5855dfecf96Smrg	struct {
5865dfecf96Smrg	    LispObj *real;
5875dfecf96Smrg	    LispObj *imag;
5885dfecf96Smrg	} complex;
5895dfecf96Smrg	struct {
5905dfecf96Smrg	    LispObj *car;
5915dfecf96Smrg	    LispObj *cdr;
5925dfecf96Smrg	} cons;
5935dfecf96Smrg	struct {
5945dfecf96Smrg	    LispObj *name;
5955dfecf96Smrg	    LispObj *code;
5965dfecf96Smrg	    LispObj *data;		/* extra data to protect */
5975dfecf96Smrg	} lambda;
5985dfecf96Smrg	struct {
5995dfecf96Smrg	    LispObj *list;		/* stored as a linear list */
6005dfecf96Smrg	    LispObj *dim;		/* dimensions of array */
6015dfecf96Smrg	    unsigned int rank : 8;	/* i.e. array-rank-limit => 256 */
6025dfecf96Smrg	    unsigned int type : 7;	/* converted to LispType, if not
6035dfecf96Smrg					 * Lisp_Nil_t only accepts given
6045dfecf96Smrg					 * type in array fields */
6055dfecf96Smrg	    unsigned int zero : 1;	/* at least one of the dimensions
6065dfecf96Smrg					 * is zero */
6075dfecf96Smrg	} array;
6085dfecf96Smrg	struct {
6095dfecf96Smrg	    LispObj *fields;	/* structure fields */
6105dfecf96Smrg	    LispObj *def;	/* structure definition */
6115dfecf96Smrg	} struc;
6125dfecf96Smrg	struct {
6135dfecf96Smrg	    union {
6145dfecf96Smrg		LispFile *file;
6155dfecf96Smrg		LispPipe *program;
6165dfecf96Smrg		LispString *string;
6175dfecf96Smrg	    } source;
6185dfecf96Smrg	    LispObj *pathname;
6195dfecf96Smrg	    LispStreamType type : 6;
6205dfecf96Smrg	    unsigned int readable : 1;
6215dfecf96Smrg	    unsigned int writable : 1;
6225dfecf96Smrg	} stream;
6235dfecf96Smrg	struct {
6245dfecf96Smrg	    void *data;
6255dfecf96Smrg	    int type;
6265dfecf96Smrg	} opaque;
6275dfecf96Smrg	struct {
6285dfecf96Smrg	    LispObj *eval;
6295dfecf96Smrg	    int atlist;
6305dfecf96Smrg	} comma;
6315dfecf96Smrg	struct {
6325dfecf96Smrg	    LispObj *name;
6335dfecf96Smrg	    LispObj *nicknames;
6345dfecf96Smrg	    LispPackage *package;
6355dfecf96Smrg	} package;
6365dfecf96Smrg	struct {
6375dfecf96Smrg	    re_cod *regex;
6385dfecf96Smrg	    LispObj *pattern;		/* regex string */
6395dfecf96Smrg	    int options;		/* regex compile flags */
6405dfecf96Smrg	} regex;
6415dfecf96Smrg	struct {
6425dfecf96Smrg	    LispBytecode *bytecode;
6435dfecf96Smrg	    LispObj *code;		/* object used to generate bytecode */
6445dfecf96Smrg	    LispObj *name;		/* name of function, or NIL */
6455dfecf96Smrg	} bytecode;
6465dfecf96Smrg	struct {
6475dfecf96Smrg	    LispHashTable *table;
6485dfecf96Smrg	    LispObj *test;
6495dfecf96Smrg	} hash;
6505dfecf96Smrg    } data;
6515dfecf96Smrg};
6525dfecf96Smrg#ifdef AIXV5
6535dfecf96Smrg#undef LispType
6545dfecf96Smrg#undef LispFunType
6555dfecf96Smrg#undef LispStreamType
6565dfecf96Smrg#endif
6575dfecf96Smrg
6585dfecf96Smrgtypedef	LispObj *(*LispFunPtr)(LispBuiltin*);
6595dfecf96Smrgtypedef void (*LispComPtr)(LispCom*, LispBuiltin*);
6605dfecf96Smrg
6615dfecf96Smrgstruct _LispBuiltin {
6625dfecf96Smrg    /* these fields must be set */
6635dfecf96Smrg    LispFunType type;
6645dfecf96Smrg    LispFunPtr function;
6655dfecf96Smrg    char *declaration;
6665dfecf96Smrg
6675dfecf96Smrg    /* this field is optional, set if the function returns multiple values */
6685dfecf96Smrg    int multiple_values;
6695dfecf96Smrg
6705dfecf96Smrg    /* this field is also optional, set if the function should not be exported */
6715dfecf96Smrg    int internal;
6725dfecf96Smrg
6735dfecf96Smrg    /* this optional field points to a function of the bytecode compiler */
6745dfecf96Smrg    LispComPtr compile;
6755dfecf96Smrg
6765dfecf96Smrg    /* this field is set at runtime */
6775dfecf96Smrg    LispObj *symbol;
6785dfecf96Smrg};
6795dfecf96Smrg
6805dfecf96Smrgtypedef int (*LispLoadModule)(void);
6815dfecf96Smrgtypedef int (*LispUnloadModule)(void);
6825dfecf96Smrg
6835dfecf96Smrg#define LISP_MODULE_VERSION		1
6845dfecf96Smrgstruct _LispModuleData {
6855dfecf96Smrg    int version;
6865dfecf96Smrg    LispLoadModule load;
6875dfecf96Smrg    LispUnloadModule unload;
6885dfecf96Smrg};
6895dfecf96Smrg
6905dfecf96Smrg/*
6915dfecf96Smrg * Prototypes
6925dfecf96Smrg */
6935dfecf96SmrgLispObj *LispEval(LispObj*);
6945dfecf96SmrgLispObj *LispFuncall(LispObj*, LispObj*, int);
6955dfecf96SmrgLispObj *LispApply1(LispObj*, LispObj*);
6965dfecf96SmrgLispObj *LispApply2(LispObj*, LispObj*, LispObj*);
6975dfecf96SmrgLispObj *LispApply3(LispObj*, LispObj*, LispObj*, LispObj*);
6985dfecf96Smrg
6995dfecf96SmrgLispObj *LispNew(LispObj*, LispObj*);
7005dfecf96SmrgLispObj *LispNewSymbol(LispAtom*);
7015dfecf96SmrgLispObj *LispNewAtom(char*, int);
7025dfecf96SmrgLispObj *LispNewFunction(LispObj*);
7035dfecf96SmrgLispObj *LispNewFunctionQuote(LispObj*);
7045dfecf96SmrgLispObj *LispNewStaticAtom(char*);
7055dfecf96SmrgLispObj *LispNewDFloat(double);
7065dfecf96SmrgLispObj *LispNewString(char*, long, int);
7075dfecf96SmrgLispObj *LispNewInteger(long);
7085dfecf96SmrgLispObj *LispNewRatio(long, long);
7095dfecf96SmrgLispObj *LispNewVector(LispObj*);
7105dfecf96SmrgLispObj *LispNewQuote(LispObj*);
7115dfecf96SmrgLispObj *LispNewBackquote(LispObj*);
7125dfecf96SmrgLispObj *LispNewComma(LispObj*, int);
7135dfecf96SmrgLispObj *LispNewCons(LispObj*, LispObj*);
7145dfecf96SmrgLispObj *LispNewLambda(LispObj*, LispObj*, LispObj*, LispFunType);
7155dfecf96SmrgLispObj *LispNewStruct(LispObj*, LispObj*);
7165dfecf96SmrgLispObj *LispNewComplex(LispObj*, LispObj*);
7175dfecf96SmrgLispObj *LispNewOpaque(void*, int);
7185dfecf96SmrgLispObj *LispNewKeyword(char*);
7195dfecf96SmrgLispObj *LispNewPathname(LispObj*);
7205dfecf96SmrgLispObj *LispNewStringStream(char*, int, long, int);
7215dfecf96SmrgLispObj *LispNewFileStream(LispFile*, LispObj*, int);
7225dfecf96SmrgLispObj *LispNewPipeStream(LispPipe*, LispObj*, int);
7235dfecf96SmrgLispObj *LispNewBignum(mpi*);
7245dfecf96SmrgLispObj *LispNewBigratio(mpr*);
7255dfecf96Smrg
7265dfecf96SmrgLispAtom *LispGetAtom(char*);
7275dfecf96Smrg
7285dfecf96Smrg/* This function does not allocate a copy of it's argument, but the argument
7295dfecf96Smrg * itself. The argument string should never change. */
7305dfecf96SmrgLispAtom *LispGetPermAtom(char*);
7315dfecf96Smrg
7325dfecf96Smrgvoid *LispMalloc(size_t);
7335dfecf96Smrgvoid *LispCalloc(size_t, size_t);
7345dfecf96Smrgvoid *LispRealloc(void*, size_t);
7355dfecf96Smrgchar *LispStrdup(char*);
7365dfecf96Smrgvoid LispFree(void*);
7375dfecf96Smrg/* LispMused means memory is now safe from LispDestroy, and should not be
7385dfecf96Smrg * freed in case of an error */
7395dfecf96Smrgvoid LispMused(void*);
7405dfecf96Smrg
7415dfecf96Smrgvoid LispGC(LispObj*, LispObj*);
7425dfecf96Smrg
7435dfecf96Smrgchar *LispStrObj(LispObj*);
7445dfecf96Smrg
7455dfecf96Smrg#ifdef __GNUC__
7465dfecf96Smrg#define PRINTF_FORMAT	__attribute__ ((format (printf, 1, 2)))
7475dfecf96Smrg#else
7485dfecf96Smrg#define PRINTF_FORMAT	/**/
7495dfecf96Smrg#endif
7505dfecf96Smrgvoid LispDestroy(char *fmt, ...) PRINTF_FORMAT;
7515dfecf96Smrg	/* continuable error */
7525dfecf96Smrgvoid LispContinuable(char *fmt, ...) PRINTF_FORMAT;
7535dfecf96Smrgvoid LispMessage(char *fmt, ...) PRINTF_FORMAT;
7545dfecf96Smrgvoid LispWarning(char *fmt, ...) PRINTF_FORMAT;
7555dfecf96Smrg#undef PRINTF_FORMAT
7565dfecf96Smrg
7575dfecf96SmrgLispObj *LispSetVariable(LispObj*, LispObj*, char*, int);
7585dfecf96Smrg
7595dfecf96Smrgint LispRegisterOpaqueType(char*);
7605dfecf96Smrg
7615dfecf96Smrgint LispPrintString(LispObj*, char*);
7625dfecf96Smrg
7635dfecf96Smrgvoid LispProtect(LispObj*, LispObj*);
7645dfecf96Smrgvoid LispUProtect(LispObj*, LispObj*);
7655dfecf96Smrg
7665dfecf96Smrg/* this function should be called when a module is loaded, and is called
7675dfecf96Smrg * when loading the interpreter */
7685dfecf96Smrgvoid LispAddBuiltinFunction(LispBuiltin*);
7695dfecf96Smrg
7705dfecf96Smrg/*
7715dfecf96Smrg * Initialization
7725dfecf96Smrg */
7735dfecf96Smrgextern LispObj *UNBOUND;
7745dfecf96Smrgextern int gcpro;
7755dfecf96Smrg
7765dfecf96Smrgextern LispObj *Okey, *Orest, *Ooptional, *Oaux, *Olambda;
7775dfecf96Smrgextern Atom_id Snil, St, Skey, Srest, Soptional, Saux;
7785dfecf96Smrgextern Atom_id Sand, Sor, Snot;
7795dfecf96Smrgextern Atom_id Satom, Ssymbol, Sinteger, Scharacter, Sstring, Slist,
7805dfecf96Smrg	       Scons, Svector, Sarray, Sstruct, Skeyword, Sfunction, Spathname,
7815dfecf96Smrg	       Srational, Sfloat, Scomplex, Sopaque, Sdefault;
7825dfecf96Smrg
7835dfecf96Smrgextern LispObj *Ocomplex, *Oformat, *Kunspecific;
7845dfecf96Smrg
7855dfecf96Smrgextern LispObj *Omake_array, *Kinitial_contents, *Osetf;
7865dfecf96Smrgextern Atom_id Svariable, Sstructure, Stype, Ssetf;
7875dfecf96Smrg
7885dfecf96Smrgextern Atom_id Smake_struct, Sstruct_access, Sstruct_store, Sstruct_type;
7895dfecf96Smrgextern LispObj *Omake_struct, *Ostruct_access, *Ostruct_store, *Ostruct_type;
7905dfecf96Smrg
7915dfecf96Smrgextern LispObj *Oparse_namestring, *Kerror, *Kabsolute, *Krelative, *Oopen,
7925dfecf96Smrg	       *Oclose, *Kif_does_not_exist;
7935dfecf96Smrg
7945dfecf96Smrgextern LispObj *Oequal_;
7955dfecf96Smrg
7965dfecf96Smrgextern LispFile *Stdout, *Stdin, *Stderr;
7975dfecf96Smrg
7985dfecf96Smrg#endif /* Lisp_internal_h */
799