?? s-msdos.h
字號:
/* Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
This file is public domain and comes with NO WARRANTY of any kind */
#ifndef MSDOS
#define MSDOS 1
#endif
#ifdef WIN32
#define SYSTEM_TYPE "WIN32"
#else
#define SYSTEM_TYPE "MSDOS"
#endif
/* Set up defines for MSC */
#ifdef _MSC_VER
#if _MSC_VER <= 601
#define __fastcall _fastcall
#endif
#define inline
#endif
#define VOIDTYPE /* Compiler has void */
#define _A(X) X /* Have prototypes */
#define _D(X) X
#define _VARARGS(X) X
#define _STATIC_VARARGS(X) X
#define ASCII_BITS_USED 8 /* Bit char used */
#ifdef M_IC80386
#define NEAR_F __fastcall
#else
#ifdef DBUG_OFF
#define NEAR_F __fastcall NEAR /* static function */
#else
#define NEAR_F _pascal NEAR /* static function */
#endif /* DBUG_OFF */
#endif
#include <stdlib.h> /* Commonly used functions */
#include <time.h>
#undef min /* Defined in global.h */
#undef max /* -""- */
#include <fcntl.h> /* my_open flags */
#include <string.h> /* Used very often */
#include <io.h>
#ifndef __ZTC__
#include <malloc.h> /* Used very often */
#endif /* __ZTC__ */
#ifndef RC_INVOKED
#include <math.h>
#endif
/* Typdefs for easyier portability */
typedef int File; /* File descriptor */
typedef void sig_handler; /* Function to handle signals */
typedef void (*sig_return)(int);/* Returns type from signal */
#define Socket_defined
typedef int Socket;
typedef unsigned long my_off_t; /* for read/write */
#define MY_FILEPOS_ERROR (ulong) ~0L
#ifdef __ZTC__
typedef int pchar; /* Mixed prototypes can't take char */
typedef int pbool; /* Mixed prototypes can't take char */
typedef double pfloat; /* Mixed prototypes can't take float */
typedef int dev_t; /* For compatible stat */
typedef int ino_t;
typedef ulong off_t;
typedef ulong st_size;
#else
typedef char pchar; /* Mixed prototypes can't take char */
typedef char pbool; /* Mixed prototypes can't take char */
typedef float pfloat; /* Mixed prototypes can take float */
#endif
typedef int (*qsort_cmp)(const void *, const void *);
#define qsort_t void
#define QSORT_TYPE_IS_VOID
/* my_lock() flags */
#define O_SHARE 0x1000 /* Open file in sharing mode */
#define F_UNLCK 0 /* Unlock locked region */
#define F_WRLCK 1 /* Lock a region for exclusive use */
#define F_RDLCK 3 /* Lock region from writing */
#define F_EXCLUSIVE 1 /* We have only exclusive locking */
#define F_TO_EOF (INT_MAX32/2) /* size for lock of all file */
/* open flags */
#ifdef __ZTC__
#define FILE_BINARY 128 /* Fopen in binary mode, 128 is free */
#else
#define FILE_BINARY O_BINARY
#endif
/* Unsigned types supported by the compiler */
#define UNSINT8 /* unsigned int8 (char) */
#define UNSINT16 /* unsigned int16 */
#define UNSINT32 /* unsigned int32 */
/* General constants */
#ifdef WIN32
#define SC_MAXWIDTH 132 /* Max width of screen */
#define FN_LEN 256 /* Max file name len (+ null ) */
#define FN_HEADLEN 253
#define FN_EXTLEN 5 /* Max length of extension (part of FN_LEN) */
#define FN_REFLEN 256 /* Max length of full path-name */
#else
#define SC_MAXWIDTH 81 /* Max width of screen */
#define FN_LEN 13 /* Max file name len (+ null ) */
#define FN_HEADLEN 9
#define FN_EXTLEN 5 /* Max length of extension (part of FN_LEN) */
#define FN_REFLEN 65 /* Max length of full path-name */
#endif
#define FN_LIBCHAR '\\'
#define FN_EXTCHAR '.'
#define FN_DEVCHAR ':'
#define FN_HOMELIB '~' /* ~/ is used as abbrev for home dir */
#define FN_CURLIB '.' /* ./ is used as abbrev for current dir */
#define FN_PARENTDIR ".." /* Parentdirectory; Must be a string */
#define FN_ROOTDIR "\\"
#define MY_BASEDIR "\\"
#define DEFAULT_BASEDIR "\\" /* Program directorys is in root */
#ifdef _NFILE
#define MY_NFILE _NFILE
#else
#define MY_NFILE 20
#endif
#define FN_NO_CASE_SENCE /* Files are not case-sencety */
#define FN_UPPER_CASE TRUE /* Files are represented in upper case */
/* Must be a power of 2 and a multiple of 512 */
#define IO_SIZE 512
/* How much overhead does malloc have */
#ifdef SAFEMALLOC
#define MALLOC_OVERHEAD (24+20+4)
#else
#define MALLOC_OVERHEAD 24
#endif
#ifdef M_IC80386
#define ONCE_ALLOC_INIT (2048-MALLOC_OVERHEAD)
#define RECORD_CACHE_SIZE ((uint) (128*1024L-MALLOC_OVERHEAD))
#define KEY_CACHE_SIZE ((uint) (256*1024L-MALLOC_OVERHEAD))
#else
#define ONCE_ALLOC_INIT (1024-MALLOC_OVERHEAD)
#define RECORD_CACHE_SIZE ((uint) (64L*1024L-MALLOC_OVERHEAD))
#define KEY_CACHE_SIZE ((uint) 32768-MALLOC_OVERHEAD)
#endif
/* Some things that this system doesn't have */
#define NO_HASH
#define NO_HEAP
#define NO_PISAM
#define NO_MISAM
#define NO_BACKGROUND /* No background jobbs */
#define ONLY_OWN_DATABASES /* We are using only databases by monty */
#define NO_LISP /* We don't have room for lisp */
#define NO_DIR_LIBRARY /* Not standar dir-library */
#define USE_MY_STAT_STRUCT /* For my_lib */
/* Some things that this system does have */
#define HAVE_PERROR
#define HAVE_VFPRINT
#define HAVE_CHSIZE /* System has chsize() function */
#define HAVE_RENAME /* Have rename() as function */
#define HAVE_BINARY_STREAMS /* Have "b" flag in streams */
#define HAVE_LONG_JMP /* Have long jump function */
#define HAVE_LOCKING /* have locking() call */
#define HAVE_ERRNO_AS_DEFINE /* errno is a define */
#define HAVE_STDLIB /* everything is include in this file */
#define HAVE_MEMCPY
#define HAVE_GETCWD
#define HAVE_TELL
#ifdef _MSC_VER
#define HAVE_LDIV /* The optimizer breaks in zortech for ldiv */
#define HAVE_ANSI_INCLUDE
#define HAVE_SYS_UTIME_H
#endif
/* Some defines of functions for portability */
#define atod atof
#if defined(__ZTC__)
#define inline
#define __fastcall _pascal
#define _dos_setdrive dos_setdrive /* Fix name-convetion */
#define _dos_getdrive dos_getdrive
#define tell(fd) lseek(fd, 0l, MY_SEEK_CUR) /* No tell function */
#define strmov(a,b) stpcpy((a),(b))
#define EAGAIN 11
#define ulong_to_double(a) (((long) (a) >= 0L) ? (double) (a) : (double) (a-LONG_MIN) + 2147483648.0)
#define offsetof(t,i) ((size_t)((char *)&((t *)0)->i - (char *)0))
#ifdef M_IC80386
#define SET_STACK_SIZE(X) unsigned stack=X
#define X32VM /* Virtual manager */
#else
#define SET_STACK_SIZE(X)
#define int86_real int86
#endif
#elif defined(_MSC_VER)
#define SET_STACK_SIZE(X) /* Must be given to LINK */
#define ulong_to_double(a) ((double) (ulong) (a))
#define int86_real int86
#define offsetof(s,m) (size_t)( (char *)&(((s *)0)->m) - (char *)0 )
#define atoll(A) _atoi64(A)
#elif defined(__WATCOMC__)
#define __fastcall
#define SET_STACK_SIZE(X) /* Must be given to LINK */
#define EAGAIN 30 /* This should be free.. */
#define int86_real int386
#define ulong_to_double(a) ((double) (ulong) (a))
#define offsetof(s,m) (size_t)( (char *)&(((s *)0)->m) - (char *)0 )
#endif
#define __attribute__(A) /* Not gcc */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -