1995-02-06 15:33:45 +00:00
|
|
|
/* p4port.h (c)Copyright Sequiter Software Inc., 1990-1994. All rights reserved.
|
|
|
|
|
|
|
|
Declarations for non-standard C runtime library functions.
|
|
|
|
|
|
|
|
CB 5.1 MULTI-PLATFORM RELEASE DATE: JULY 15/94
|
|
|
|
*/
|
1995-02-17 09:46:50 +00:00
|
|
|
#ifdef XVT_OS
|
|
|
|
#include <xvt.h>
|
|
|
|
#endif
|
1995-02-06 15:33:45 +00:00
|
|
|
#ifdef S4UNIX
|
|
|
|
|
|
|
|
#define S4OPTIMIZE_OFF
|
|
|
|
|
|
|
|
#ifdef S4MACINTOSH
|
|
|
|
#define S4BYTEORDER_3210
|
|
|
|
#define S4NO_ATOF
|
|
|
|
#define S4NO_FCVT
|
|
|
|
#define S4NO_ECVT
|
|
|
|
#else
|
|
|
|
#define S4LOCKF /* use function lockf() for locking */
|
1995-02-17 09:46:50 +00:00
|
|
|
/* #define S4NO_MEMMOVE */ /* use if memmove() not found */
|
1995-02-06 15:33:45 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* CodeBase Multi-Platform defines */
|
|
|
|
#define S4ERRNO /* use global variable, 'errno' */
|
|
|
|
#define S4NO_CHSIZE /* use if chsize() not found */
|
|
|
|
#define S4NO_DUP /* use if dup() not found/not required */
|
|
|
|
#define S4NO_FILELENGTH /* use if filelength() not found */
|
|
|
|
#define S4NO_NEGATIVE_LOCK /* use if negative locking not supported */
|
|
|
|
#define S4NO_POW /* use if pow() not found */
|
1995-02-17 09:46:50 +00:00
|
|
|
/* #define S4NO_REMOVE */ /* use if remove() not found */
|
|
|
|
/* #define S4NO_RENAME */ /* use if rename() not found */
|
1995-02-06 15:33:45 +00:00
|
|
|
#define S4NO_STRLWR /* use if strlwr() not found */
|
|
|
|
#define S4NO_STRNICMP /* use if strnicmp() not found */
|
|
|
|
#define S4NO_STRUPR /* use if strupr() not found */
|
|
|
|
|
|
|
|
/* #define S4BYTEORDER_2301 */ /* use for 2301 systems */
|
|
|
|
/* #define S4BYTEORDER_3210 */ /* use for 3210 systems */
|
|
|
|
/* #define S464BIT */ /* use for 64 bit systems */
|
|
|
|
/* #define S4BYTE_SWAP */ /* use for swapping bytes on 3210 or 2301 systems */
|
1995-02-17 09:46:50 +00:00
|
|
|
#define S4MEMCMP /* use if memcmp() uses signed byte comparison */
|
1995-02-06 15:33:45 +00:00
|
|
|
/* #define S4LSEEK */ /* use if lseek() cannot seek past EOF */
|
|
|
|
/* #define S4NO_ATOF */ /* use if atof() not found */
|
|
|
|
/* #define S4NO_ECVT */ /* use if ecvt() not found */
|
|
|
|
/* #define S4NO_FCVT */ /* use if fcvt() not found */
|
|
|
|
/* #define S4NO_SIZE_T */ /* use if variable size_t not found */
|
1995-02-17 09:46:50 +00:00
|
|
|
/* #define S4NO_STDLIB */ /* use if no stdlib include file */
|
|
|
|
/* #define S4NO_UNISTD */ /* use if no unistd include file */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef S4NO_SIZE_T
|
|
|
|
typedef unsigned size_t ;
|
1995-02-06 15:33:45 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef S4UNIX
|
|
|
|
#define S4CMP_PARM void * /* These functions are usually declared */
|
|
|
|
#ifndef S4MACINTOSH /* in other system header files, and */
|
1995-02-17 09:46:50 +00:00
|
|
|
extern long filelength(int hand) ; /* therefore most of these declarations */
|
|
|
|
#ifdef S4NO_STDLIB
|
|
|
|
extern int atoi(char * nptr) ; /* are redundant. Sometimes, however, */
|
|
|
|
extern long atol(char * nptr) ; /* the declaration is in a header file */
|
|
|
|
#endif
|
|
|
|
extern int chsize(int fildes, long size) ; /* not included in the compile. In that */
|
|
|
|
extern int close(int fildes) ; /* case, compile and/or run-time errors */
|
|
|
|
extern void exit(int status) ; /* will be avoided because of these */
|
|
|
|
extern int lock(int flag) ; /* declarations. */
|
|
|
|
extern int locking(int fildes, int mode, long size) ;
|
|
|
|
extern void *malloc(size_t size) ; /* malloc(), calloc() and realloc() may */
|
|
|
|
extern void *calloc(size_t nelem, size_t size) ; /* return a 'char *' in some compilers. */
|
|
|
|
extern void *realloc(void * ptr, size_t size) ; /* if so, change 'void *' to 'char *' */
|
|
|
|
extern void free(void * ptr) ;
|
|
|
|
extern long time(long * tloc) ;
|
|
|
|
#ifdef S4NO_UNISTD
|
|
|
|
extern int read(int fildes, char * buf, unsigned nbyte) ;
|
|
|
|
extern int unlink(char * path) ;
|
|
|
|
extern int write(int fildes, char * buf, unsigned nbyte) ;
|
|
|
|
#endif
|
1995-02-06 15:33:45 +00:00
|
|
|
#ifndef S4NO_ECVT
|
1995-02-17 09:46:50 +00:00
|
|
|
extern char *ecvt(double value, int ndigit, int * decpt, int * sign) ;
|
1995-02-06 15:33:45 +00:00
|
|
|
#ifndef S4NO_FCVT
|
1995-02-17 09:46:50 +00:00
|
|
|
extern char *fcvt(double value, int ndigit, int * decpt, int * sign) ;
|
1995-02-06 15:33:45 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#ifndef S4LSEEK
|
1995-02-17 09:46:50 +00:00
|
|
|
extern long lseek(int fildes, long offset, int whence) ;
|
1995-02-06 15:33:45 +00:00
|
|
|
#endif
|
|
|
|
#ifndef S4MEMCMP
|
1995-02-17 09:46:50 +00:00
|
|
|
extern int memcmp(const void * s1, const void * s2, size_t n) ;
|
1995-02-06 15:33:45 +00:00
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
long filelength(int) ;
|
|
|
|
long MAClseek(int, long, int, int) ;
|
|
|
|
|
|
|
|
#include <errors.h>
|
|
|
|
#include <files.h>
|
|
|
|
#endif
|
|
|
|
|
1995-02-17 09:46:50 +00:00
|
|
|
/* #define USHRT_MAX 0xFFFF */ /* may comment these out if compiler */
|
|
|
|
/* #define INT_MAX 0x7FFF */ /* error occurs */
|
|
|
|
/* #define UINT_MAX 0xFFFF */
|
1995-02-06 15:33:45 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef S4LOCKF
|
|
|
|
#define S4LOCKING
|
1995-02-17 09:46:50 +00:00
|
|
|
int lockf(int fildes, int locking, long size);
|
1995-02-06 15:33:45 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef S4NO_STRNICMP
|
1995-02-17 09:46:50 +00:00
|
|
|
int strnicmp(char *a, char *b, size_t n );
|
1995-02-06 15:33:45 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef S4NO_MEMMOVE
|
1995-02-17 09:46:50 +00:00
|
|
|
void *memmove(void *dest, void *src, size_t count );
|
1995-02-06 15:33:45 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef S4LSEEK
|
|
|
|
#define S4OFF_OPTIMIZE
|
|
|
|
long f4seek() ;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef S4NO_FCVT
|
1995-02-17 09:46:50 +00:00
|
|
|
char *f4fcvt( double value, int numdigits, int *dec_ptr, int *sign_ptr );
|
1995-02-06 15:33:45 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef S4NO_ECVT
|
1995-02-17 09:46:50 +00:00
|
|
|
char *f4ecvt( double value, int numdigits, int *dec_ptr, int *sign_ptr );
|
1995-02-06 15:33:45 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef S4NO_ATOF
|
1995-02-17 09:46:50 +00:00
|
|
|
double c4atof( char * buf );
|
1995-02-06 15:33:45 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef S4BYTEORDER_3210
|
|
|
|
#define S4DO_BYTEORDER
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef S4BYTEORDER_2301
|
|
|
|
#define S4DO_BYTEORDER
|
|
|
|
#endif
|