MACHINE.H C-5

NAME

machine.h - include file for system environment

SYNOPSIS

#include <machine.h>

DESCRIPTION

This include file defines the current machine environment. It is used by one routine, align(C-3), to determine the proper data field alignment for the hardware.

The file shown below is the master version of machine.h. Note that this file is made up of different categories (Operating System, Hardware, Manufacturers, etc). One item in each category should be set to "1" to define the machine being used. Examine \cbase\include\cbase\machine.h for the appropriate settings for your system.

CONTENTS

/*

* @(#)machine.mas 16.2

*

* machine.h Machine / Operating System definitions

*

* C/Base include file

* Copyright (c) 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, * 1993, 1994, 1995

* Conetic Software Systems Inc.

*/

#ifndef _MACHINE_

#define _MACHINE_ 1

#ifndef RC

#include <string.h>

#endif

#define _INO_T_DEFINED

#define TVERSION "V3.8" /* C/Base version number */

#define BVERSION "V3.8" /* C/Books version number */

/* PORT Names */

#define P_MVAXBSD 0 /* Dec Micro Vax BSD - currently BSD4.2 */

#define P_MVAXV5 0 /* Dec Micro Vax System V - current 5.2 */

#define P_NCRV3 0 /* NCR Tower System V - Rel 3.xx */

#define P_3B2V5 0 /* AT&T 3B2 System V - current 5.2 */

#define P_3B1V5 0 /* AT&T 7300 System V - current Rel 3.0 */

#define P_AT286V5 0 /* 80286 System V - current V.2 */

#define P_AT286XEN 0 /* 80286 Xenix */

#define P_FORT3216 0 /* Fortune 32:16 Version VII - cur. Rel 1.8 */

#define P_ICMV5 0 /* National 3216 System V */

#define P_MSDOS 1 /* MSDOS 3.0 */

#define P_CONVGT 0 /* Previous CTMINI & CTMEGA Ports */

#define P_CADMUS 0 /* Previous Cadmus Ports */

#define P_TRS80_16 0 /* Previous Tandy Port

#define P_ALT586 0 /* Previous Altos 586 port */

#define P_INT386 0 /* Previous INTEL port */

#define P_MAC 0 /* Development Macintosh port */

#define P_AT386V5 0 /* 80386 System V - current V.3 */

#define P_IBMRT 0 /* IMB RT PC System */

#define P_ARIXSYS5 0 /* ARIX 68000 System V Rel 3 port */

#define P_MOTOROLA 0 /* MOTOROLA */

#define P_AT386SCO 0 /* 80386 SCO UNIX/XENIX Cross Development */

/* Operating Systems */

#define UNIXV7 0

#define UNIXS3 0

#define UNIXS50 0

#define UNIXS52 0

#define UNIXS53 0

#define BSD41 0

#define BSD42 0

#define MSDOS2 1

#define XENIX3 0

#define XENIX5 0

#define COHERENT 0

#define MAC 0

#define AIX2 0

#define DOSWIN 0

char *CBalloc();

#define UNIXS5 (UNIXS50 | UNIXS52 | UNIXS53 | AIX2)

#define BSD (BSD41 | BSD42 | BSD43)

#define XENIX (XENIX3 | XENIX5)

#define UNIX (UNIXV7 | UNIXS3 | UNIXS5 | BSD | XENIX)

/* Hardware */

#define M_PDP11 0

#define M_LSI11 0

#define M_VAX 0

#define M_I8086 0

#define M_80286 0 /* to be used in protective mode */

#define M_80386 1 /* to be used in protective mode */

#define M_M68000 0

#define M_M68010 0

#define M_M68020 0

#define M_3B2 0 /* WE 32000 */

#define M_NS32000 0

#define M_RTRISC 0 /* IBM RISC RT PC computer */

/* Manufacturers */

#define M_DEC 0

#define M_NCR 0

#define M_FORTUNE 0

#define M_IBM 1

#define M_ALTOS 0

#define M_INTEL 0

#define M_ATT 0

#define M_ICM3216 0

#define M_APPLE 0

#define M_AT386 0 /* generic 80386 AT Box */

#define M_ARIX 0 /* UNISYS/ARIX box */

#define M_MOTOROLA 0

/*

* Compilers:

* C_UNIX: Unix C compiler (PCC)

* C_LATTICE: Lattice C compiler (MS-DOS)

* C_MSC: Microsoft C compiler

* C_LSC: LightSpeed C compiler (MAC)

*/

#define C_UNIX 0

#define C_LATTICE 2

#define C_MSC 0

#define C_LSC 0

/* determine version of Lattice compiler */

#if C_LATTICE & I8086

#undef C_LATTICE

#define C_LATTICE 2 /* version 2 Lattice compiler */

#endif

#if C_LATTICE

#define LATTICEC_LATTICE /* define LATTICE for backwards compatibility */

#endif

/*

* Networks:

* N_NONE No network

* N_MSNET MS-DOS 3.x networking

*/

#define N_NONE 0

#define N_MSNET 1

#define INTERNATCHAR 1

#define MOUSE 0

#if UNIX | COHERENT

#define AREAD "r"

#define AWRITE "w"

#define AAPEND "a"

#define BREAD "r"

#define BWRITE "w"

#define BAPEND "a"

#define CREATMASK 0666

#endif

#if C_LATTICE

#define AREAD "r"

#define AWRITE "w"

#define AAPEND "a"

#define BREAD "rb"

#define BWRITE "wb"

#define BAPEND "ab"

#if C_LATTICE == 1

#define CREATMASK 0

#endif

#if C_LATTICE == 2

#define CREATMASK O_BINARY|S_IREAD|S_IWRITE

#endif

#endif

#if C_MSC & MSDOS2

#define AREAD "rt"

#define AWRITE "wt"

#define AAPEND "at"

#define BREAD "rb"

#define BWRITE "wb"

#define BAPEND "ab"

#define CREATMASK 0666

#endif

#if MAC

#define AREAD "rt"

#define AWRITE "wt"

#define AAPEND "at"

#define BREAD "rb"

#define BWRITE "wb"

#define BAPEND "ab"

#define CREATMASK 0

#endif

#if C_LATTICE == 2

typedef short ino_t;

#endif

#if COHERENT | UNIXV7 | BSD41 | C_LATTICE == 1

#define O_RDONLY 0

#define O_WRONLY 1

#define O_RDWR 2

#define O_RAW 0

#define O_TEXT 0

#endif

#if UNIXS3 | UNIXS5 | BSD42

#include <fcntl.h>

#define O_RAW 0

#define O_TEXT 0

#endif

#if C_LATTICE == 2

#include <fcntl.h>

#include <sys/stat.h>

#define O_RAW O_BINARY

#endif

#if C_MSC & MSDOS2

#include <fcntl.h>

#define O_RAW O_BINARY

#endif

#if MAC

#include <io.h>

#define O_RAW O_BINARY

#endif

/*

* define sharing versions of open(), creat(), and fopen()

* for MS-DOS networking

*/

#if UNIX | COHERENT | MAC

#define SH_COMPAT 0

#define SH_DENYRW 0

#define SH_DENYWR 0

#define SH_DENYRD 0

#define SH_DENYNO 0

#define sopen(name,oflag,shflag) open(name,oflag)

#define screat(name,oflag,shflag,pmode) creat(name,pmode)

#endif

#if MSDOS2

#include <share.h>

#if N_NONE

#define sopen(name,oflag,shflag) open(name,oflag)

#define screat(name,oflag,shflag,pmode) open(name,oflag,pmode)

#endif

#if N_MSNET

#define screat(name,oflag,shflag,pmode) sopen(name,oflag,shflag,pmode)

#endif

#endif

/*

* access() function parameters

*/

#define A_EXIST 0

#if UNIX | COHERENT

#define A_EXEC 1

#endif

#define A_WRONLY 2

#define A_RDONLY 4

/*

* Version 7 cbautil00000001.gif System III

* ------------ --------------

* index() cbautil00000001.gif strchr()

* rindex() cbautil00000001.gif strrchr()

*/

#if UNIXV7 | BSD41 | BSD42 | COHERENT | C_LATTICE == 1

#define strchr index

#define strrchr rindex

#endif

/*

* The following defines macros to test for path separator characters

* and to generate them. They are designed to work with "bizarre"

* systems that have more that one valid path separator character

* (like MS-DOS). They are described below:

*

* PATHCHAR the "preferred" path separator character. Use this

* whenever you are generating a file name with a path

* separator character in it

*

* PATHSTR like PATHCHAR but a string constant rather than a

* character constant

*

* PATHSET a string containing all the valid path separator

* characters. The first character is the same as

* PATHCHAR

*

* ISPATH(c) returns true (!= 0) if the character is path separator,

* false (0) otherwise

*

* LASTPATH(s) returns a pointer to the last path separator character

* in s, or NULL if there are no path separator characters

* in s

*

* FIRSTPATH(s) returns a pointer to the first path separator character

* in s, or NULL if there are no path separator characters

* in s

*

* ISABSPATH(s) returns true (!= 0) if the string s represents an

* absolute path, or false (0) otherwise

*

*/

#if UNIX

#define PATHCHAR '/'

#define PATHSTR "/"

#define PATHSET "/"

#endif

#if MSDOS2

#define PATHCHAR '\\'

#define PATHSTR "\\"

#define PATHSET "\\/"

#define MSDRIVE ':'

#endif

#if MAC

#define PATHCHAR ':'

#define PATHSTR ":"

#define PATHSET ":"

#endif

char *strrpbrk();

#define ISPATH(c) (strchr (PATHSET, (c)) != NULL)

#define LASTPATH(s) (strrpbrk ((s), PATHSET))

#define FIRSTPATH(s) (strpbrk ((s), PATHSET))

#if UNIX

#define ISABSPATH(s) (ISPATH((s)[0]))

#endif

#if MSDOS2

#define ISABSPATH(s) (ISPATH((s)[0]) || ((s)[0] && (s)[1] ==

MSDRIVE && ISPATH((s)[2])))

#endif

/*

char *strchr ();

char *strpbrk ();

char *strrpbrk ();

*/

#define L_tempname 64

/*

* RMS now has a limited ability to read files across systems.

* If this feature is desired, it must be enabled by setting

* FOREIGNFILE to 1; otherwise, the code is not compiled in.

*/

#define FOREIGNFILE 1

#if UNIXV7 | MSDOS2

#define VOID char

#else

#define VOID void

#endif

#define MkInt(a, b) ((int)(((unsigned char)(a)) | (((int)

((unsigned char)(b))) << 8)))

#define LoByte(w) ((unsigned char)(w))

#define HiByte(w) ((unsigned char)((int)(w) >> 8))

#endif /* _MACHINE_ */

#if DOSWIN

#define exit(a) CSSexit(a);

#endif