| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
#ifndef _SYSDEP_H_ |
| 19 |
#define _SYSDEP_H_ |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#ifdef AZTEC_C |
| 24 |
#define __amiga__ |
| 25 |
#endif |
| 26 |
|
| 27 |
#ifndef __sun__ |
| 28 |
#ifdef sun |
| 29 |
#define __sun__ |
| 30 |
#endif |
| 31 |
#endif |
| 32 |
|
| 33 |
#ifdef _INCLUDE_HPUX_SOURCE |
| 34 |
#define __hp__ |
| 35 |
#endif |
| 36 |
|
| 37 |
#ifndef __unix__ |
| 38 |
#ifdef unix |
| 39 |
#define __unix__ |
| 40 |
#endif |
| 41 |
#endif |
| 42 |
|
| 43 |
#ifdef vax |
| 44 |
#define __vms__ |
| 45 |
#endif |
| 46 |
|
| 47 |
#ifdef THINK_C |
| 48 |
#define __mac__ |
| 49 |
#endif |
| 50 |
|
| 51 |
#ifdef __MWERKS__ |
| 52 |
#ifdef macintosh |
| 53 |
#define __mac__ |
| 54 |
#else |
| 55 |
#define __dos__ |
| 56 |
#endif |
| 57 |
#endif |
| 58 |
|
| 59 |
#ifdef DOS |
| 60 |
#define __dos__ |
| 61 |
#endif |
| 62 |
|
| 63 |
#ifdef __BORLANDC__ |
| 64 |
#define __dos__ |
| 65 |
#endif |
| 66 |
|
| 67 |
#ifdef __CYGWIN__ |
| 68 |
#define __win__ |
| 69 |
#endif |
| 70 |
|
| 71 |
#ifdef __MINGW32__ |
| 72 |
#define __win__ |
| 73 |
#endif |
| 74 |
|
| 75 |
#ifdef __PACIFIC__ |
| 76 |
#define __dos__ |
| 77 |
#define HAVE_SHORT_FILENAMES |
| 78 |
#endif |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
#include <stdio.h> |
| 94 |
#include <ctype.h> |
| 95 |
|
| 96 |
#ifdef __STDC__ |
| 97 |
#define _PROTOTYPES_ |
| 98 |
#include <stdlib.h> |
| 99 |
#include <string.h> |
| 100 |
#endif |
| 101 |
|
| 102 |
#ifdef __vms__ |
| 103 |
|
| 104 |
#define _PROTOTYPES_ |
| 105 |
#include <stdlib.h> |
| 106 |
#include <string.h> |
| 107 |
#endif |
| 108 |
|
| 109 |
#ifdef _MSC_VER |
| 110 |
|
| 111 |
#define _PROTOTYPES_ |
| 112 |
#include <stdlib.h> |
| 113 |
#include <string.h> |
| 114 |
#endif |
| 115 |
|
| 116 |
|
| 117 |
#ifdef __mac__ |
| 118 |
#define _PROTOTYPES_ |
| 119 |
#include <stdlib.h> |
| 120 |
#include <string.h> |
| 121 |
#include <unix.h> |
| 122 |
#endif |
| 123 |
|
| 124 |
#ifdef __MWERKS__ |
| 125 |
#define strdup _strdup |
| 126 |
#endif |
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
#define ISO 1 |
| 134 |
#define NATIVECHARSET 0 |
| 135 |
|
| 136 |
#ifdef GLK |
| 137 |
#undef ISO |
| 138 |
#define ISO 1 |
| 139 |
#undef NATIVECHARSET |
| 140 |
#define NATIVECHARSET 0 |
| 141 |
#else |
| 142 |
|
| 143 |
#ifdef __dos__ |
| 144 |
#undef ISO |
| 145 |
#define ISO 0 |
| 146 |
#undef NATIVECHARSET |
| 147 |
#define NATIVECHARSET 2 |
| 148 |
#endif |
| 149 |
|
| 150 |
#ifdef __win__ |
| 151 |
#undef ISO |
| 152 |
#define ISO 1 |
| 153 |
#undef NATIVECHARSET |
| 154 |
#define NATIVECHARSET 2 |
| 155 |
#endif |
| 156 |
|
| 157 |
#ifdef __mac__ |
| 158 |
#undef ISO |
| 159 |
#define ISO 0 |
| 160 |
#undef NATIVECHARSET |
| 161 |
#define NATIVECHARSET 1 |
| 162 |
#endif |
| 163 |
|
| 164 |
#endif |
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
#define READ_MODE "r" |
| 170 |
#define WRITE_MODE "w" |
| 171 |
|
| 172 |
#ifdef __mac__ |
| 173 |
|
| 174 |
#undef READ_MODE |
| 175 |
#define READ_MODE "rb" |
| 176 |
#undef WRITE_MODE |
| 177 |
#define WRITE_MODE "wb" |
| 178 |
#endif |
| 179 |
|
| 180 |
#ifdef __dos__ |
| 181 |
|
| 182 |
#undef READ_MODE |
| 183 |
#define READ_MODE "rb" |
| 184 |
#undef WRITE_MODE |
| 185 |
#define WRITE_MODE "wb" |
| 186 |
#endif |
| 187 |
|
| 188 |
#ifdef __win__ |
| 189 |
|
| 190 |
#undef READ_MODE |
| 191 |
#define READ_MODE "rb" |
| 192 |
#undef WRITE_MODE |
| 193 |
#define WRITE_MODE "wb" |
| 194 |
#endif |
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
#ifdef __dos__ |
| 201 |
#define REVERSED |
| 202 |
#endif |
| 203 |
|
| 204 |
#ifdef __vms__ |
| 205 |
#define REVERSED |
| 206 |
#endif |
| 207 |
|
| 208 |
#ifdef __win__ |
| 209 |
#ifndef REVERSED |
| 210 |
#define REVERSED |
| 211 |
#endif |
| 212 |
#endif |
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
#ifdef __CYGWIN__ |
| 220 |
#define NOTCALLOC |
| 221 |
#endif |
| 222 |
|
| 223 |
#ifdef __MINGW32__ |
| 224 |
#define NOTCALLOC |
| 225 |
#endif |
| 226 |
|
| 227 |
#ifdef __unix__ |
| 228 |
#define NOTCALLOC |
| 229 |
#endif |
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
#ifdef GLK |
| 237 |
|
| 238 |
#else |
| 239 |
|
| 240 |
#ifdef __CYGWIN__ |
| 241 |
#define HAVE_TERMIO |
| 242 |
#endif |
| 243 |
|
| 244 |
#ifdef __unix__ |
| 245 |
#define HAVE_TERMIO |
| 246 |
#endif |
| 247 |
|
| 248 |
#endif |
| 249 |
|
| 250 |
|
| 251 |
|
| 252 |
|
| 253 |
|
| 254 |
#ifdef GLK |
| 255 |
|
| 256 |
#else |
| 257 |
|
| 258 |
#ifdef __CYGWIN__ |
| 259 |
#define HAVE_ANSI |
| 260 |
#endif |
| 261 |
|
| 262 |
#endif |
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
#ifdef GLK |
| 269 |
|
| 270 |
#define USE_READLINE |
| 271 |
#else |
| 272 |
|
| 273 |
#ifdef __unix__ |
| 274 |
#define USE_READLINE |
| 275 |
#endif |
| 276 |
|
| 277 |
#ifdef x__dos__ |
| 278 |
#define USE_READLINE |
| 279 |
#endif |
| 280 |
|
| 281 |
#ifdef __win__ |
| 282 |
#define USE_READLINE |
| 283 |
#endif |
| 284 |
|
| 285 |
#endif |
| 286 |
|
| 287 |
|
| 288 |
#ifdef __unix__ |
| 289 |
#define MULTI |
| 290 |
#endif |
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
#ifdef __vms__ |
| 296 |
|
| 297 |
#define MULTI |
| 298 |
|
| 299 |
extern char *strdup(char str[]); |
| 300 |
|
| 301 |
|
| 302 |
extern size_t strftime (char *, size_t, const char *, const struct tm *); |
| 303 |
|
| 304 |
#endif |
| 305 |
|
| 306 |
#ifdef __mac__ |
| 307 |
|
| 308 |
extern char *strdup(char *str); |
| 309 |
|
| 310 |
#endif |
| 311 |
|
| 312 |
|
| 313 |
#ifdef __dos__ |
| 314 |
|
| 315 |
|
| 316 |
#define EXIT_SUCCESS 0 |
| 317 |
#define EXIT_FAILURE 1 |
| 318 |
|
| 319 |
#endif |
| 320 |
|
| 321 |
|
| 322 |
#ifdef _PROTOTYPES_ |
| 323 |
|
| 324 |
|
| 325 |
extern int isSpace(int c); |
| 326 |
extern int isLower(int c); |
| 327 |
extern int isUpper(int c); |
| 328 |
extern int isLetter(int c); |
| 329 |
extern int toLower(int c); |
| 330 |
extern int toUpper(int c); |
| 331 |
extern char *strlow(char str[]); |
| 332 |
extern char *strupp(char str[]); |
| 333 |
|
| 334 |
|
| 335 |
extern int isISOLetter(int c); |
| 336 |
extern char toLowerCase(int c); |
| 337 |
extern char toUpperCase(int c); |
| 338 |
extern char *stringLower(char str[]); |
| 339 |
extern char *stringUpper(char str[]); |
| 340 |
|
| 341 |
|
| 342 |
extern void toIso(char copy[], |
| 343 |
char original[], |
| 344 |
int charset); |
| 345 |
|
| 346 |
extern void fromIso(char copy[], |
| 347 |
char original[]); |
| 348 |
|
| 349 |
extern void toNative(char copy[], |
| 350 |
char original[], |
| 351 |
int charset); |
| 352 |
#else |
| 353 |
extern int isSpace(); |
| 354 |
extern int isLower(); |
| 355 |
extern int isUpper(); |
| 356 |
extern int isLetter(); |
| 357 |
extern int toLower(); |
| 358 |
extern int toUpper(); |
| 359 |
extern char *strlow(); |
| 360 |
extern char *strupp(); |
| 361 |
|
| 362 |
extern int isISOLetter(); |
| 363 |
extern char toLowerCase(); |
| 364 |
extern char toUpperCase(); |
| 365 |
extern char *stringLower(); |
| 366 |
extern char *stringUpper(); |
| 367 |
|
| 368 |
extern void toIso(); |
| 369 |
extern void fromIso(); |
| 370 |
#endif |
| 371 |
|
| 372 |
#endif |
| 373 |
|