/* Copyright (C) 2003, 2004 Dave Bayer. Subject to the terms and conditions of the MIT License. */ /* system includes */ #include #include #include #include #include #include "memory.h" /*. BOOL */ typedef enum bool { NO, YES } BOOL; /*. TESTCODE */ #define TESTCODE 1 /*. DEBUG */ #define DEBUG 1 /*. assert */ #if DEBUG #define assert(C) ((C) ? ((void) 0) : assertFailed( #C, __FILE__, __LINE__ )) #else #define assert(C) ((void) 0) #endif /*. NULL */ #undef NULL /*. LEN */ #define LEN 256 /*. PRIME */ #define PRIME 4093 /*. HASH */ #define HASH(G,H,X) ( H <<= 4, H += (X), G = H & 0xf0000000, H ^= G >> 28, H ^= G ) /*. HASHN */ #define HASHN(H,X) ( H <<= 4, H += (X) ) /*. MAX */ #define MAX(A,B) ((A)>(B) ? (A) : (B)) /* function prototypes */ void executionError( char *s, BOOL abort ); void assertFailed( char *condition, char *fileName, int lineNo );