Commit 4e8a8be4 authored by Kevin Cozens's avatar Kevin Cozens Committed by Kevin Cozens
Browse files

Removed some items from here... tinyscheme/scheme-private.h ... and added

2004-10-29  Kevin Cozens  <kcozens@cvs.gimp.org>

	* tinyscheme/scheme.c: Removed some items from here...
	* tinyscheme/scheme-private.h ... and added them here so they
	could be used in the ts-wrapper.c file.
parent fad244f7
......@@ -7,10 +7,43 @@
/*------------------ Ugly internals -----------------------------------*/
/*------------------ Of interest only to FFI users --------------------*/
enum scheme_types {
T_STRING=1,
T_NUMBER=2,
T_SYMBOL=3,
T_PROC=4,
T_PAIR=5,
T_CLOSURE=6,
T_CONTINUATION=7,
T_FOREIGN=8,
T_CHARACTER=9,
T_PORT=10,
T_VECTOR=11,
T_MACRO=12,
T_PROMISE=13,
T_ENVIRONMENT=14,
T_ARRAY=15,
T_LAST_SYSTEM_TYPE=15
};
#define arrayvalue(p) ((p)->_object._array._avalue)
#define arraylength(p) ((p)->_object._array._length)
#define arraytype(p) ((p)->_object._array._type)
/* ADJ is enough slack to align cells in a TYPE_BITS-bit boundary */
#define ADJ 32
#define TYPE_BITS 5
#define T_MASKTYPE 31 /* 0000000000011111 */
#define T_SYNTAX 4096 /* 0001000000000000 */
#define T_IMMUTABLE 8192 /* 0010000000000000 */
#define T_ATOM 16384 /* 0100000000000000 */ /* only for gc */
#define CLRATOM 49151 /* 1011111111111111 */ /* only for gc */
#define MARK 32768 /* 1000000000000000 */
#define UNMARK 32767 /* 0111111111111111 */
/* macros for cell operations */
#define typeflag(p) ((p)->_flag)
#define type(p) (typeflag(p)&T_MASKTYPE)
#define arrayvalue(p) ((p)->_object._array._avalue)
#define arraylength(p) ((p)->_object._array._length)
#define arraytype(p) ((p)->_object._array._type)
enum array_type {
array_int32=0,
......
......@@ -114,37 +114,6 @@ static const char *strlwr(char *s) {
void (*ts_output_routine) (FILE *, char *, int);
enum scheme_types {
T_STRING=1,
T_NUMBER=2,
T_SYMBOL=3,
T_PROC=4,
T_PAIR=5,
T_CLOSURE=6,
T_CONTINUATION=7,
T_FOREIGN=8,
T_CHARACTER=9,
T_PORT=10,
T_VECTOR=11,
T_MACRO=12,
T_PROMISE=13,
T_ENVIRONMENT=14,
T_ARRAY=15,
T_LAST_SYSTEM_TYPE=15
};
/* ADJ is enough slack to align cells in a TYPE_BITS-bit boundary */
#define ADJ 32
#define TYPE_BITS 5
#define T_MASKTYPE 31 /* 0000000000011111 */
#define T_SYNTAX 4096 /* 0001000000000000 */
#define T_IMMUTABLE 8192 /* 0010000000000000 */
#define T_ATOM 16384 /* 0100000000000000 */ /* only for gc */
#define CLRATOM 49151 /* 1011111111111111 */ /* only for gc */
#define MARK 32768 /* 1000000000000000 */
#define UNMARK 32767 /* 0111111111111111 */
static num num_add(num a, num b);
static num num_mul(num a, num b);
static num num_div(num a, num b);
......@@ -167,9 +136,6 @@ static num num_zero;
static num num_one;
/* macros for cell operations */
#define typeflag(p) ((p)->_flag)
#define type(p) (typeflag(p)&T_MASKTYPE)
INTERFACE INLINE int is_string(pointer p) { return (type(p)==T_STRING); }
#define strvalue(p) ((p)->_object._string._svalue)
#define strlength(p) ((p)->_object._string._length)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment