Source:NetHack 3.3.0/macconf.h

From NetHackWiki
Jump to navigation Jump to search

Below is the full text to macconf.h from the source code of NetHack 3.3.0. To link to a particular line, write [[NetHack 3.3.0/macconf.h#line123]], for example.

Warning! This is the source code from an old release. For the latest release, see Source code

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

1.    /*	SCCS Id: @(#)macconf.h	3.3	99/10/25	*/
2.    /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3.    /* NetHack may be freely redistributed.  See license for details. */
4.    
5.    #ifdef MAC
6.    # ifndef MACCONF_H
7.    #  define MACCONF_H
8.    
9.    /*
10.    * Compiler selection is based on the following symbols:
11.    *
12.    *	applec			MPW compiler
13.    *	THINK_C			Think C compiler
14.    *	__MWERKS__		Metrowerks compiler
15.    *
16.    * We use these early in config.h to define some needed symbols,
17.    * including MAC.
18.    #
19.    # The Metrowerks compiler defines __STDC__ (which sets NHSTC) and uses
20.    # WIDENED_PROTOTYPES (defined if UNWIDENED_PROTOTYPES is undefined and
21.    # NHSTDC is defined).
22.    */
23.   #  ifdef applec
24.   #   define MAC_MPW32		/* Headers, and for avoiding a bug */
25.   #  endif
26.   
27.   #  ifndef __powerc
28.   #   define MAC68K		/* 68K mac (non-powerpc) */
29.   #  endif
30.   
31.   #  define RANDOM
32.   #  define NO_SIGNAL		/* You wouldn't believe our signals ... */
33.   #  define FILENAME 256
34.   #  define NO_TERMS		/* For tty port (see wintty.h) */
35.   
36.   #  define TEXTCOLOR		/* For Mac TTY interface */
37.   #  define CHANGE_COLOR
38.   
39.   /* Use these two includes instead of system.h. */
40.   #include <string.h>
41.   #include <stdlib.h>
42.   
43.   /* Uncomment this line if your headers don't already define off_t */
44.   /*typedef long off_t;*/
45.   
46.   /*
47.    * Try and keep the number of files here to an ABSOLUTE minimum !
48.    * include the relevant files in the relevant .c files instead !
49.    */
50.   #include <segload.h>
51.   #include <stdlib.h>
52.   #include <windows.h>
53.   #include <memory.h>
54.   #include <quickdraw.h>
55.   #include <events.h>
56.   #include <controls.h>
57.   #include <dialogs.h>
58.   #include <fonts.h>
59.   #include <TextUtils.h>
60.   
61.   /*
62.    * Turn off the Macsbug calls for the production version.
63.    */
64.   #if 0
65.   #  undef Debugger
66.   #  undef DebugStr
67.   #  define Debugger()
68.   #  define DebugStr(aStr)
69.   #endif
70.   
71.   /*
72.    * We could use the PSN under sys 7 here ...
73.    */
74.   #ifndef __CONDITIONALMACROS__	/* universal headers */
75.   #  define getpid() 1
76.   #  define getuid() 1
77.   #endif
78.   #  define index strchr
79.   #  define rindex strrchr
80.   
81.   #  define Rand random
82.   extern void error(const char *,...);
83.   
84.   # if !defined(O_WRONLY)
85.   #  ifdef __MWERKS__
86.   #include <unix.h>
87.   #   ifndef O_EXCL
88.        /* MW 4.5 doesn't have this, so just use a bogus value */
89.   #    define O_EXCL 0x80000000
90.   #   endif
91.   #  else
92.   #include <fcntl.h>
93.   #  endif
94.   # endif
95.   
96.   /*
97.    * Don't redefine these Unix IO functions when making LevComp or DgnComp for
98.    * MPW.  With MPW, we make them into MPW tools, which use unix IO.  SPEC_LEV
99.    * and DGN_COMP are defined when compiling for LevComp and DgnComp respectively.
100.   */
101.  #if !(defined(applec) && (defined(SPEC_LEV) || defined(DGN_COMP)))
102.  # define creat maccreat
103.  # define open macopen
104.  # define close macclose
105.  # define read macread
106.  # define write macwrite
107.  # define lseek macseek
108.  #endif
109.  
110.  # define TEXT_TYPE 'TEXT'
111.  # define LEVL_TYPE 'LEVL'
112.  # define BONE_TYPE 'BONE'
113.  # define SAVE_TYPE 'SAVE'
114.  # define PREF_TYPE 'PREF'
115.  # define DATA_TYPE 'DATA'
116.  # define MAC_CREATOR 'nh31' /* Registered with DTS ! */
117.  
118.  typedef struct macdirs {
119.  	Str32		dataName ;
120.  	short		dataRefNum ;
121.  	long		dataDirID ;
122.  
123.  	Str32		saveName ;
124.  	short		saveRefNum ;
125.  	long		saveDirID ;
126.  
127.  	Str32		levelName ;
128.  	short		levelRefNum ;
129.  	long		levelDirID ;
130.  } MacDirs ;
131.  
132.  typedef struct macflags {
133.  	Bitfield ( processes , 1 ) ;
134.  	Bitfield ( color , 1 ) ;
135.  	Bitfield ( folders , 1 ) ;
136.  	Bitfield ( tempMem , 1 ) ;
137.  	Bitfield ( help , 1 ) ;
138.  	Bitfield ( fsSpec , 1 ) ;
139.  	Bitfield ( trueType , 1 ) ;
140.  	Bitfield ( aux , 1 ) ;
141.  	Bitfield ( alias , 1 ) ;
142.  	Bitfield ( standardFile , 1 ) ;
143.  	Bitfield ( hasDebugger , 1 ) ;
144.  	Bitfield ( hasAE , 1 ) ;
145.  	Bitfield ( gotOpen, 1 );
146.  } MacFlags ;
147.  
148.  extern MacDirs theDirs ;		/* used in files.c */
149.  extern MacFlags macFlags ;
150.  
151.  /*
152.   * Define PORT_HELP to be the name of the port-specfic help file.
153.   * This file is included into the resource fork of the application.
154.   */
155.  #define PORT_HELP "MacHelp"
156.  
157.  #define MAC_GRAPHICS_ENV
158.  
159.  # endif /* ! MACCONF_H */
160.  #endif /* MAC */