Annotation of early-roguelike/rogue3/mdport.h, Revision 1.1.1.1
1.1 rubenllo 1: /*
2: mdport.h - Machine Dependent Code for Porting Unix/Curses games
3:
4: Copyright (C) 2008 Nicholas J. Kisseberth
5: All rights reserved.
6:
7: Redistribution and use in source and binary forms, with or without
8: modification, are permitted provided that the following conditions
9: are met:
10: 1. Redistributions of source code must retain the above copyright
11: notice, this list of conditions and the following disclaimer.
12: 2. Redistributions in binary form must reproduce the above copyright
13: notice, this list of conditions and the following disclaimer in the
14: documentation and/or other materials provided with the distribution.
15: 3. Neither the name(s) of the author(s) nor the names of other contributors
16: may be used to endorse or promote products derived from this software
17: without specific prior written permission.
18:
19: THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTORS ``AS IS'' AND
20: ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21: IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22: ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTORS BE LIABLE
23: FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24: DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25: OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27: LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28: OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29: SUCH DAMAGE.
30: */
31:
32: #ifdef HAVE_CONFIG_H
33: #ifdef PDCURSES
34: #undef HAVE_UNISTD_H
35: #undef HAVE_LIMITS_H
36: #undef HAVE_MEMORY_H
37: #undef HAVE_STRING_H
38: #endif
39: #include "config.h"
40:
41: #elif defined(__DJGPP__)
42: #define HAVE_SYS_TYPES_H 1
43: #define HAVE_PROCESS_H 1
44: #define HAVE_PWD_H 1
45: #define HAVE_TERMIOS_H 1
46: #define HAVE_SETGID 1
47: #define HAVE_GETGID 1
48: #define HAVE_SETUID 1
49: #define HAVE_GETUID 1
50: #define HAVE_GETPASS 1
51: #define HAVE_SPAWNL 1
52: #define HAVE_ALARM 1
53: #define HAVE_ERASECHAR 1
54: #define HAVE_KILLCHAR 1
55: #define HAVE_CRYPT
56:
57: #elif defined(_WIN32)
58: #define HAVE_CURSES_H
59: #define HAVE_TERM_H
60: #define HAVE__SPAWNL
61: #define HAVE_SYS_TYPES_H
62: #define HAVE_PROCESS_H
63: #define HAVE_ERASECHAR 1
64: #define HAVE_KILLCHAR 1
65: #ifndef uid_t
66: typedef unsigned int uid_t;
67: #endif
68:
69: #elif defined(__CYGWIN__)
70: #define HAVE_SYS_TYPES_H 1
71: #define HAVE_PWD_H 1
72: #define HAVE_PWD_H 1
73: #define HAVE_SYS_UTSNAME_H 1
74: #define HAVE_ARPA_INET_H 1
75: #define HAVE_UNISTD_H 1
76: #define HAVE_TERMIOS_H 1
77: #define HAVE_NCURSES_TERM_H 1
78: #define HAVE_ESCDELAY
79: #define HAVE_SETGID 1
80: #define HAVE_GETGID 1
81: #define HAVE_SETUID 1
82: #define HAVE_GETUID 1
83: #define HAVE_GETPASS 1
84: #define HAVE_GETPWUID 1
85: #define HAVE_WORKING_FORK 1
86: #define HAVE_ALARM 1
87: #define HAVE_SPAWNL 1
88: #define HAVE__SPAWNL 1
89: #define HAVE_ERASECHAR 1
90: #define HAVE_KILLCHAR 1
91: #define HAVE_CRYPT 1
92:
93: #else /* standards based unix */
94: #define HAVE_SYS_TYPES_H 1
95: #define HAVE_PWD_H 1
96: #define HAVE_SYS_UTSNAME_H 1
97: #define HAVE_ARPA_INET_H 1
98: #define HAVE_UNISTD_H 1
99: #define HAVE_CRYPT_H 1
100: #define HAVE_LIMITS_H 1
101: #define HAVE_TERMIOS_H 1
102: #define HAVE_UTMPX_H 1
103: #define HAVE_ERRNO_H 1
104: #define HAVE_TERM_H 1
105: #define HAVE_SETGID 1
106: #define HAVE_GETGID 1
107: #define HAVE_SETUID 1
108: #define HAVE_GETUID 1
109: #define HAVE_SETREUID 1
110: #define HAVE_SETREGID 1
111: #define HAVE_CRYPT 1
112: #define HAVE_GETPASS 1
113: #define HAVE_GETPWUID 1
114: #define HAVE_WORKING_FORK 1
115: #define HAVE_ERASECHAR 1
116: #define HAVE_KILLCHAR 1
117: #ifndef _AIX
118: #define HAVE_GETLOADAVG 1
119: #endif
120: #define HAVE_ALARM 1
121: #endif
122:
123: #ifdef __DJGPP__
124: #undef HAVE_GETPWUID /* DJGPP's limited version doesn't even work as documented */
125: #endif
126:
127: #define MD_STRIP_CTRL_KEYPAD 1
128:
129: #ifdef HAVE_SYS_TYPES_H
130: #include <sys/types.h>
131: #endif
132:
133: #ifdef HAVE_LIMITS_H
134: #include <limits.h>
135: #endif
136:
137: #if !defined(PATH_MAX) && defined(_MAX_PATH)
138: #define PATH_MAX _MAX_PATH
139: #endif
140:
141: #if !defined(PATH_MAX) && defined(_PATH_MAX)
142: #define PATH_MAX _PATH_MAX
143: #endif
144:
145: #ifndef HAVE_CRYPT
146: char * crypt(const char *key, const char *setting);
147: #else
148: #ifdef HAVE_UNISTD_H
149: #include <unistd.h>
150: #endif
151: #ifdef HAVE_CRYPT_H
152: #include <crypt.h>
153: #endif
154: #endif
155:
156: int md_chmod(const char *filename, int mode);
157: int md_dsuspchar(void);
158: int md_erasechar(void);
159: char * md_gethomedir(void);
160: char * md_getusername(void);
161: uid_t md_getuid(void);
162: char * md_getpass(char *prompt);
163: char * md_getrealname(uid_t uid);
164: void md_init(int options);
165: int md_killchar(void);
166: void md_normaluser(void);
167: void md_raw_standout(void);
168: void md_raw_standend(void);
169: int md_readchar(WINDOW *win);
170: int md_setdsuspchar(int c);
171: int md_shellescape(void);
172: void md_sleep(int s);
173: int md_suspchar(void);
174: int md_unlink(char *file);
175: int md_unlink_open_file(const char *file, FILE *inf);
176: void md_tstpsignal(void);
177: void md_tstphold(void);
178: void md_tstpresume(void (*tstp)(int));
179: void md_ignoreallsignals(void);
180: void md_onsignal_autosave(void);
181: void md_onsignal_exit(void);
182: void md_onsignal_default(void);
183: int md_issymlink(char *sp);
184: int md_loadav(double *avg);
185: void md_start_checkout_timer(int time);
186: void md_stop_checkout_timer(void);
187: long md_memused(void);
188: int md_ucount(void);
189: int md_unlockfile(FILE *fp);
190: int md_lockfile(FILE *fp);
191: unsigned int md_random_seed(void);
CVSweb