home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
sa104os2.zip
/
SATHR104.ZIP
/
SATHER
/
SYSTEM
/
HEADER.H
< prev
next >
Wrap
Text File
|
1995-01-31
|
4KB
|
125 lines
/*
* Copyright (C) International Computer Science Institute, 1994. COPYRIGHT
* NOTICE: This code is provided "AS IS" WITHOUT ANY WARRANTY and is subject
* to the terms of the SATHER LIBRARY GENERAL PUBLIC LICENSE contained in
* the file "Doc/License" of the Sather distribution. The license is also
* available from ICSI, 1947 Center St., Suite 600, Berkeley CA 94704, USA.
* -----> Please email comments to "sather-bugs@icsi.berkeley.edu". <-----
*/
/* This file is included at the head of the compiler-generated header file. */
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <setjmp.h>
#include <signal.h>
#include <limits.h>
#include <stdlib.h> /* -- NLP */
#include <direct.h> /* -- NLP */
#include <process.h> /* -- NLP */
/* Determine the machine type: */
# if defined(sun) && defined(sparc)
# define SPARC
/* Test for SunOS 5.x */
# include <errno.h>
# ifdef ECHRNG
# define SUNOS5
# else
# define SUNOS4
# endif
# endif
# if defined(NeXT) && defined(mc68000)
# define M68K
# define NEXT
# endif
# if defined(vax)
# define VAX
# ifdef ultrix
# define ULTRIX
# else
# define BSD
# endif
# endif
/* ALLOCATE(x) returns a zeroed memory region of size and type x.
* The Boehm GC_malloc, unlike regular malloc, zeros memory.
* The compiler emits typedefs such that "x_struct" is the name
* of the struct type that *x refers to.
*/
#define ALLOCATE(x) ((x) GC_malloc(sizeof(struct x##_struct)))
/* These may be defined as appropriate to the target system */
typedef char BOOL;
#define FALSE 0
#define TRUE 1
#ifdef ALPHA
typedef int INT;
#define SINT_MAX INT_MAX
#define SINT_MIN INT_MIN
#else
typedef long INT;
#define SINT_MAX LONG_MAX
#define SINT_MIN LONG_MIN
#endif
typedef char CHAR;
typedef float FLT;
typedef double FLTD;
typedef double FLTX; /* This is a hack */
typedef double FLTDX; /* This is a hack */
typedef void* EXT_OB;
/* Little boxes made of ticky-tacky */
typedef struct BOOL_boxed_struct { INT tag; BOOL value_part; } *BOOL_boxed;
typedef struct CHAR_boxed_struct { INT tag; CHAR value_part; } *CHAR_boxed;
typedef struct INT_boxed_struct { INT tag; INT value_part; } *INT_boxed;
typedef struct FLT_boxed_struct { INT tag; FLT value_part; } *FLT_boxed;
typedef struct FLTD_boxed_struct { INT tag; FLTD value_part; } *FLTD_boxed;
typedef struct FLTX_boxed_struct { INT tag; FLTX value_part; } *FLTX_boxed;
typedef struct FLTDX_boxed_struct { INT tag; FLTDX value_part; } *FLTDX_boxed;
/* Layouts for the Sather classes which are built-in */
#ifdef DETERMINISTIC
typedef struct { INT tag; INT id; } OB_HEADER;
#else
typedef struct { INT tag; } OB_HEADER;
#endif
typedef struct STR_struct {
OB_HEADER header;
INT asize;
CHAR arr_part[1];
} *STR;
typedef struct OB_struct {
OB_HEADER header;
} *OB;
#undef ferror
#undef feof
/* We use bzero and bcopy internally. They may not be available. */
# if defined(SPARC) && defined(SUNOS4)
# define BCOPY_EXISTS
# endif
# if defined(M68K) && defined(NEXT)
# define BCOPY_EXISTS
# endif
# if defined(VAX)
# define BCOPY_EXISTS
# endif
# ifndef BCOPY_EXISTS
# include <string.h>
# define bcopy(x,y,n) memcpy(y, x, (size_t)(n))
# define bzero(x,n) memset(x, 0, (size_t)(n))
# endif