macconf.h

Go to the documentation of this file.
00001 /*      SCCS Id: @(#)macconf.h  3.4     1999/10/25      */
00002 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
00003 /* NetHack may be freely redistributed.  See license for details. */
00004 
00005 #ifdef MAC
00006 # ifndef MACCONF_H
00007 #  define MACCONF_H
00008 
00009 /*
00010  * Compiler selection is based on the following symbols:
00011  *
00012  *  __SC__                      sc, a MPW 68k compiler
00013  *  __MRC__                     mrc, a MPW PowerPC compiler
00014  *      THINK_C                 Think C compiler
00015  *      __MWERKS__              Metrowerks' Codewarrior compiler
00016  *
00017  * We use these early in config.h to define some needed symbols,
00018  * including MAC.
00019  #
00020  # The Metrowerks compiler defines __STDC__ (which sets NHSTC) and uses
00021  # WIDENED_PROTOTYPES (defined if UNWIDENED_PROTOTYPES is undefined and
00022  # NHSTDC is defined).
00023  */
00024 
00025 #ifndef __powerc
00026 # define MAC68K         /* 68K mac (non-powerpc) */
00027 #endif
00028 #ifndef TARGET_API_MAC_CARBON
00029 # define TARGET_API_MAC_CARBON 0
00030 #endif
00031 
00032 
00033 #ifndef __MACH__
00034 #define RANDOM
00035 #endif
00036 #define NO_SIGNAL               /* You wouldn't believe our signals ... */
00037 #define FILENAME 256
00038 #define NO_TERMS                /* For tty port (see wintty.h) */
00039 
00040 #define TEXTCOLOR               /* For Mac TTY interface */
00041 #define CHANGE_COLOR
00042 
00043 /* Use these two includes instead of system.h. */
00044 #include <string.h>
00045 #include <stdlib.h>
00046 
00047 /* Uncomment this line if your headers don't already define off_t */
00048 /*typedef long off_t;*/
00049 #include <time.h>       /* for time_t */
00050 
00051 /*
00052  * Try and keep the number of files here to an ABSOLUTE minimum !
00053  * include the relevant files in the relevant .c files instead !
00054  */
00055 #if TARGET_API_MAC_CARBON
00056   /* Avoid including <CarbonCore/fp.h> -- it has a conflicting expl() */
00057 # define __FP__
00058 # include <Carbon/Carbon.h>
00059 #else
00060 # include <MacTypes.h>
00061 #endif
00062 
00063 /*
00064  * We could use the PSN under sys 7 here ...
00065  * ...but it wouldn't matter...
00066  */
00067 #define getpid() 1
00068 #define getuid() 1
00069 #define index strchr
00070 #define rindex strrchr
00071 
00072 #define Rand random
00073 extern void error(const char *,...);
00074 
00075 #if !defined(O_WRONLY)
00076 # ifdef __MWERKS__
00077 #  include <unix.h>
00078 # endif
00079 # include <fcntl.h>
00080 #endif
00081 
00082 /*
00083  * Don't redefine these Unix IO functions when making LevComp or DgnComp for
00084  * MPW.  With MPW, we make them into MPW tools, which use unix IO.  SPEC_LEV
00085  * and DGN_COMP are defined when compiling for LevComp and DgnComp respectively.
00086  */
00087 #if !((defined(__SC__) || defined(__MRC__) || defined(__MACH__)) && (defined(SPEC_LEV) || defined(DGN_COMP)))
00088 # define creat maccreat
00089 # define open macopen
00090 # define close macclose
00091 # define read macread
00092 # define write macwrite
00093 # define lseek macseek
00094 #ifdef __MWERKS__
00095 # define unlink _unlink
00096 #endif
00097 #endif
00098 
00099 #define YY_NEVER_INTERACTIVE 1
00100 
00101 # define TEXT_TYPE 'TEXT'
00102 # define LEVL_TYPE 'LEVL'
00103 # define BONE_TYPE 'BONE'
00104 # define SAVE_TYPE 'SAVE'
00105 # define PREF_TYPE 'PREF'
00106 # define DATA_TYPE 'DATA'
00107 # define MAC_CREATOR 'nh31' /* Registered with DTS ! */
00108 # define TEXT_CREATOR 'ttxt' /* Something the user can actually edit */
00109 
00110 /*
00111  * Define PORT_HELP to be the name of the port-specfic help file.
00112  * This file is included into the resource fork of the application.
00113  */
00114 #define PORT_HELP "MacHelp"
00115 
00116 #define MAC_GRAPHICS_ENV
00117 
00118 # endif /* ! MACCONF_H */
00119 #endif /* MAC */