home *** CD-ROM | disk | FTP | other *** search
- /*
- * c-tree PLUS(tm) Version 6.0
- * Release A4
- * September 12, 1991
- */
-
- #ifndef ctCMPLH
- #define ctCMPLH
-
- /* Macintosh ctcmpl.h */
-
- #define ctMACINTOSH
- #define PROTOTYPE
- #ifdef THINK_C
- #define ctSTRICTANSI
- #endif
-
- #include <stddef.h>
- #include <stdlib.h>
- #include <stdarg.h>
- #include <stdio.h>
- #ifdef __MWERKS__
- #include <unix.h>
- #else
- #include <fcntl.h>
- #endif
- #include <ctype.h>
- #include <string.h>
-
- #define BUPDATE (O_RDWR | O_BINARY)
- #define BCREATE (O_CREAT | O_TRUNC | O_BINARY | O_RDWR)
-
- /* #define ctEXCLCREAT */
- #define C255 -1
- #define ct_NULL (char *) 0
- #define far
- #define _far
- #define _export
- #define _loadds
-
-
-
- /*
- ** runtime mapping
- */
- /*#define ctrt_scanf scanf */
- #undef ctrt_fprintf
- #undef ctrt_sprintf
- #undef ctrt_printf
- #undef ctrt_fopen
- #undef ctrt_fclose
- #undef ctrt_strcpy
- #undef ctrt_strcat
- #undef ctrt_strcmp
- #undef ctrt_strlen
- #undef ctrt_strncpy
- #undef ctrt_fscanf
- #undef ctrt_memcmp
- #undef ctrt_memcpy
- #undef ctrt_tmpnam
- #undef ctrt_memset
- #undef ctrt_toupper
- #define ctrt_strcpy strcpy
- #define ctrt_strcat strcat
- #define ctrt_strcmp strcmp
- #define ctrt_strncmp(s1,s2,n) strncmp(((pTEXT)(s1)),((pTEXT)(s2)),((size_t)(n)))
- #define ctrt_strlen strlen
- #define ctrt_strncpy(d,s,n) strncpy(((pTEXT)(d)),((pTEXT)(s)),((size_t)(n)))
- #define ctrt_exit exitMac
- #define ctrt_memcmp(s1,s2,n) memcmp(((pTEXT)(s1)),((pTEXT)(s2)),((size_t)(n)))
- #define ctrt_memchr(s,c,n) memchr(((pTEXT)(s)),((NINT)(c)),((size_t)(n)))
- #define ctrt_tmpnam tmpnam
- #define ctrt_toupper toupper
- #define ctrt_memset(s,c,n) memset(((pTEXT)(s)),((NINT)(c)),((size_t)(n)))
-
- #ifdef makeCtSrvr
- #define OWNER ((int)((Threads_ *)getThreadCtl())->current->refcon)
- #define ctrt_fprintf fprintfMac
- #define ctrt_sprintf sprintfMac
- #define ctrt_printf printfMac
- #define ctrt_fopen fopenMac
- #define ctrt_fclose fcloseMac
- #define ctrt_fscanf fscanfMac
- #define calloc ct_alloc
- #define free ctafree
- #else
- #define OWNER (1)
- #define ctrt_fprintf fprintf
- #define ctrt_sprintf sprintf
- #define ctrt_printf printf
- #define ctrt_fopen fopen
- #define ctrt_fclose fclose
- #define ctrt_fscanf fscanf
- #define calloc calloc
- #define free free
- #endif
-
- #define apOWNER OWNER
-
-
-
- /*
- ** SYSTEM INDEPENDENT
- */
- #define icpylng(dp,sp,n) *dp++=*sp++; *dp++=*sp++; *dp++=*sp++; *dp++=*sp++;
- #define cpylng(dp,sp,n) cpy4bf(dp,sp)
-
- /*
- ** SYSTEM DEPENDENT: memcpy should perform high speed copy. It does NOT have to
- ** check for overlapped memory regions. memset should perform high speed
- ** buffer fill. CHECK THE ORDER OF THE PARAMETERS: dp is the destination,
- ** sp is the source.
- */
- #define ctrt_memcpy(s1,s2,n) memcpy(((pTEXT)(s1)),((pTEXT)(s2)),((VRLEN)(n)))
-
- #define cpy4bf(dp,sp) memcpy(dp,sp,((size_t)(4)))
- #define cpybuf(dp,sp,n) memcpy(dp,sp,((size_t)(n)))
- #define cpybig(dp,sp,n) memcpy(dp,sp,((size_t)(n)))
- #define ctsfill(dp,ch,n) memset(dp,ch,((size_t)(n)))
- #define ctbfill(dp,ch,n) memset(dp,ch,((size_t)(n)))
-
-
- #define bigadr(tp,off) (((pTEXT)tp) + off)
-
- /*
- ** If FASTCOMP is defined, then your system must support CTCOMP(k1,k2,len)
- ** where k1 points to a key value, k2 points to a key value, len is the key
- ** length, and CTCOMP returns a zero if equal, or +n if k1 differs from k2
- ** in the nth byte and k1 > k2, or -n if k1 differs in the nth byte and
- ** k1 < k2.
- **
- ** If a different run time name is needed, use an additional #define
- ** here to change CTCOMP to the appropriate function name.
-
- #define FASTCOMP
-
- **
- */
-
- #define FASTRIGHT
- #define SIZET
-
- #define ctDECL
- #define ctMEM
-
- #define cpymsg cpybuf
- #define cpymbuf cpybuf
- #define ctmfill ctbfill
- #define cpysrcm cpysrcl
-
- #ifndef ctCONV
- #define ctCONV
- #endif
-
- void *ct_alloc(size_t n,size_t s);
- void ctafree(void *p);
-
- #define ctALLOC
-
-
- #define ctMILLISECOND(t) ((t < 1)? 0: (t+16) / 17)
-
- #endif
- /* end of ctcmpl.h */
-