#ifndef __FACTOR_H__ #define __FACTOR_H__ #include "platform.h" #if defined(WIN32) #define DLLEXPORT __declspec(dllexport) #else #define DLLEXPORT #endif /* CELL must be 32 bits and your system must have 32-bit pointers */ typedef unsigned long int CELL; #define CELLS ((signed)sizeof(CELL)) /* raw pointer to datastack bottom */ CELL ds_bot; /* raw pointer to datastack top */ #if defined(FACTOR_X86) register CELL ds asm("esi"); #elif defined(FACTOR_PPC) register CELL ds asm("r14"); #else CELL ds; #endif /* raw pointer to callstack bottom */ CELL cs_bot; /* raw pointer to callstack top */ #if defined(FACTOR_PPC) register CELL cs asm("r15"); #else DLLEXPORT CELL cs; #endif /* TAGGED currently executing quotation */ CELL callframe; /* TAGGED pointer to currently executing word */ CELL executing; #include #include #include #include #include #include #include #include #include #include #include typedef unsigned char u8; typedef unsigned short u16; typedef unsigned int u32; typedef unsigned long long u64; typedef signed char s8; typedef signed short s16; typedef signed int s32; typedef signed long long s64; #include #ifdef WIN32 #include /* Difference between Jan 1 00:00:00 1601 and Jan 1 00:00:00 1970 */ #define EPOCH_OFFSET 0x019db1ded53e8000LL #else #include #include #include #include #include #include #endif #if !defined(WIN32) #include #endif #define INLINE inline static #define FIXNUM_MAX (LONG_MAX >> TAG_BITS) #define FIXNUM_MIN (LONG_MIN >> TAG_BITS) #define F_FIXNUM long int /* unboxed */ #define WORD_SIZE (CELLS*8) #define HALF_WORD_SIZE (CELLS*4) #define HALF_WORD_MASK (((unsigned long)1<