This repository has been archived by the owner on Apr 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PACMAN.H
1627 lines (1381 loc) · 53.8 KB
/
PACMAN.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* stdlib.h
Definitions for common types, variables, and functions.
Copyright (c) 1987, 1991 by Borland International
All Rights Reserved.
*/
#ifndef __STDLIB_H
#define __STDLIB_H
#if !defined( __DEFS_H )
#include <_defs.h>
#endif
#ifndef NULL
#include <_null.h>
#endif
#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned size_t;
#endif
#ifndef _DIV_T
#define _DIV_T
typedef struct {
int quot;
int rem;
} div_t;
#endif
#ifndef _LDIV_T
#define _LDIV_T
typedef struct {
long quot;
long rem;
} ldiv_t;
#endif
#ifndef _WCHAR_T
#define _WCHAR_T
typedef char wchar_t;
#endif
/* Old typedef
*/
typedef void _Cdecl (* atexit_t)(void);
/* Maximum value returned by "rand" function
*/
#define RAND_MAX 0x7FFFU
#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1
#define MB_CUR_MAX 1
#ifdef __cplusplus
extern "C" {
#endif
void _Cdecl abort(void);
int _Cdecl __abs__(int);
#ifdef __cplusplus
inline int _Cdecl abs(int __x) { return __abs__(__x); }
#else
int _CType abs(int __x);
# define abs(x) __abs__(x)
#endif
int _Cdecl atexit(void (_Cdecl *__func)(void));
double _Cdecl atof(const char *__s);
int _CType atoi(const char *__s);
long _CType atol(const char *__s);
void * _CType bsearch(const void *__key, const void *__base,
size_t __nelem, size_t __width,
int (_CType *fcmp)(const void *,
const void *));
void * _Cdecl calloc(size_t __nitems, size_t __size);
div_t _Cdecl div(int __numer, int __denom);
void _Cdecl exit(int __status);
void _Cdecl free(void *__block);
char * _CType getenv(const char *__name);
long _Cdecl labs(long __x);
ldiv_t _Cdecl ldiv(long __numer, long __denom);
void * _Cdecl malloc(size_t __size);
int _Cdecl mblen(const char *__s, size_t __n);
size_t _Cdecl mbstowcs(wchar_t *__pwcs, const char *__s,
size_t __n);
int _Cdecl mbtowc(wchar_t *__pwc, const char *__s, size_t __n);
void _CType qsort(void *__base, size_t __nelem, size_t __width,
int _CType (*__fcmp)(const void *, const void *));
int _Cdecl rand(void);
void *_Cdecl realloc(void *__block, size_t __size);
void _Cdecl srand(unsigned __seed);
double _Cdecl strtod(const char *__s, char **__endptr);
long _Cdecl strtol(const char *__s, char **__endptr,
int __radix);
long double _Cdecl _strtold(const char *__s, char **__endptr);
unsigned long _Cdecl strtoul(const char *__s, char **__endptr,
int __radix);
int _Cdecl system(const char *__command);
size_t _Cdecl wcstombs(char *__s, const wchar_t *__pwcs,
size_t __n);
int _Cdecl wctomb(char *__s, wchar_t __wc);
#ifdef __cplusplus
}
#endif
#if !__STDC__
/* Variables */
extern int _Cdecl _doserrno;
extern int _Cdecl errno;
/*
These 2 constants are defined in MS's stdlib.h. Rather than defining them
all the time and invading the ANSI programmers name space we'll only make
them visible when __STDC__ is *off*. Anybody using these constants ain't
writing standard C anyway!
*/
#define DOS_MODE 0
#define OS2_MODE 1
extern unsigned _Cdecl _psp;
extern char **_Cdecl environ;
extern int _Cdecl _fmode;
extern unsigned char _Cdecl _osmajor;
extern unsigned char _Cdecl _osminor;
extern unsigned int _Cdecl _version;
extern char *_Cdecl sys_errlist[];
extern int _Cdecl sys_nerr;
/* Constants for MSC pathname functions */
#define _MAX_PATH 80
#define _MAX_DRIVE 3
#define _MAX_DIR 66
#define _MAX_FNAME 9
#define _MAX_EXT 5
#ifdef __cplusplus
inline int _Cdecl random(int __num)
{ return(int)(((long)rand()*__num)/(RAND_MAX+1)); }
/* need prototype of time() for C++ randomize() */
extern "C" long _Cdecl time(long *);
inline void _Cdecl randomize(void) { srand((unsigned) time(NULL)); }
inline int _Cdecl atoi(const char *__s) { return (int) atol(__s); }
#else
#define random(num)(int)(((long)rand()*(num))/(RAND_MAX+1))
#define randomize() srand((unsigned)time(NULL))
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
#define atoi(s) ((int) atol(s))
#endif
#ifdef __cplusplus
extern "C" {
#endif
long double _Cdecl _atold(const char *__s);
char *_Cdecl ecvt(double __value, int __ndig, int *__dec,
int *__sign);
void _Cdecl _exit(int __status);
char *_Cdecl fcvt(double __value, int __ndig, int *__dec,
int *__sign);
char * _CType _fullpath( char *__buf,
const char *__path,
size_t __maxlen );
char *_Cdecl gcvt(double __value, int __ndec, char *__buf);
char *_CType itoa(int __value, char *__string, int __radix);
void *_Cdecl lfind(const void *__key, const void *__base,
size_t *__num, size_t __width,
int _Cdecl(*__fcmp)(const void *, const void *));
unsigned long _Cdecl _lrotl(unsigned long __val, int __count);
unsigned long _Cdecl _lrotr(unsigned long __val, int __count);
void *_Cdecl lsearch(const void *__key, void *__base,
size_t *__num, size_t __width,
int _Cdecl(*__fcmp)(const void *, const void *));
char * _CType ltoa(long __value, char *__string, int __radix);
void _Cdecl _makepath( char *__path,
const char *__drive,
const char *__dir,
const char *__name,
const char *__ext );
int _Cdecl putenv(const char *__name);
unsigned _Cdecl _rotl(unsigned __value, int __count);
unsigned _Cdecl _rotr(unsigned __value, int __count);
unsigned _Cdecl __rotl__(unsigned __value, int __count); /* intrinsic */
unsigned _Cdecl __rotr__(unsigned __value, int __count); /* intrinsic */
void _Cdecl _searchenv(const char *__file,
const char *__varname,
char *__pathname);
void _Cdecl _splitpath( const char *__path,
char *__drive,
char *__dir,
char *__name,
char *__ext );
void _Cdecl swab(char *__from, char *__to, int __nbytes);
char *_CType ultoa(unsigned long __value, char *__string,
int __radix);
#ifdef __cplusplus
}
#endif
#endif /* !__STDC__ */
#endif /* __STDLIB_H */
/* stdio.h
Definitions for stream input/output.
Copyright (c) 1987, 1991 by Borland International
All Rights Reserved.
*/
#ifndef __STDIO_H
#define __STDIO_H
#if !defined( __DEFS_H )
#include <_defs.h>
#endif
#ifndef NULL
#include <_null.h>
#endif
#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned size_t;
#endif
/* Definition of the file position type
*/
typedef long fpos_t;
/* Definition of the control structure for streams
*/
typedef struct {
int level; /* fill/empty level of buffer */
unsigned flags; /* File status flags */
char fd; /* File descriptor */
unsigned char hold; /* Ungetc char if no buffer */
int bsize; /* Buffer size */
unsigned char *buffer; /* Data transfer buffer */
unsigned char *curp; /* Current active pointer */
unsigned istemp; /* Temporary file indicator */
short token; /* Used for validity checking */
} FILE; /* This is the FILE object */
/* Bufferisation type to be used as 3rd argument for "setvbuf" function
*/
#define _IOFBF 0
#define _IOLBF 1
#define _IONBF 2
/* "flags" bits definitions
*/
#define _F_RDWR 0x0003 /* Read/write flag */
#define _F_READ 0x0001 /* Read only file */
#define _F_WRIT 0x0002 /* Write only file */
#define _F_BUF 0x0004 /* Malloc'ed Buffer data */
#define _F_LBUF 0x0008 /* line-buffered file */
#define _F_ERR 0x0010 /* Error indicator */
#define _F_EOF 0x0020 /* EOF indicator */
#define _F_BIN 0x0040 /* Binary file indicator */
#define _F_IN 0x0080 /* Data is incoming */
#define _F_OUT 0x0100 /* Data is outgoing */
#define _F_TERM 0x0200 /* File is a terminal */
/* End-of-file constant definition
*/
#define EOF (-1) /* End of file indicator */
/* Number of files that can be open simultaneously
*/
#if __STDC__
#define FOPEN_MAX 18 /* Able to have 18 files (20 - stdaux & stdprn) */
#else
#define FOPEN_MAX 20 /* Able to have 20 files */
#define SYS_OPEN 20
#endif
#define FILENAME_MAX 80
/* Default buffer size use by "setbuf" function
*/
#define BUFSIZ 512 /* Buffer size for stdio */
/* Size of an arry large enough to hold a temporary file name string
*/
#define L_ctermid 5 /* CON: plus null byte */
#define P_tmpdir "" /* temporary directory */
#define L_tmpnam 13 /* tmpnam buffer size */
/* Constants to be used as 3rd argument for "fseek" function
*/
#define SEEK_CUR 1
#define SEEK_END 2
#define SEEK_SET 0
/* Number of unique file names that shall be generated by "tmpnam" function
*/
#define TMP_MAX 0xFFFF
/* Standard I/O predefined streams
*/
#if !defined( _RTLDLL )
extern FILE _Cdecl _streams[];
extern unsigned _Cdecl _nfile;
#define stdin (&_streams[0])
#define stdout (&_streams[1])
#define stderr (&_streams[2])
#if !__STDC__
#define stdaux (&_streams[3])
#define stdprn (&_streams[4])
#endif
#else
#ifdef __cplusplus
extern "C" {
#endif
FILE far * far __getStream(int);
#ifdef __cplusplus
}
#endif
#define stdin __getStream(0)
#define stdout __getStream(1)
#define stderr __getStream(2)
#define stdaux __getStream(3)
#define stdprn __getStream(4)
#endif
#ifdef __cplusplus
extern "C" {
#endif
void _Cdecl clearerr(FILE *__stream);
int _Cdecl fclose(FILE *__stream);
int _Cdecl fflush(FILE *__stream);
int _Cdecl fgetc(FILE *__stream);
int _Cdecl fgetpos(FILE *__stream, fpos_t *__pos);
char *_Cdecl fgets(char *__s, int __n, FILE *__stream);
FILE *_Cdecl fopen(const char *__path, const char *__mode);
int _Cdecl fprintf(FILE *__stream, const char *__format, ...);
int _Cdecl fputc(int __c, FILE *__stream);
int _Cdecl fputs(const char *__s, FILE *__stream);
size_t _Cdecl fread(void *__ptr, size_t __size, size_t __n,
FILE *__stream);
FILE *_Cdecl freopen(const char *__path, const char *__mode,
FILE *__stream);
int _Cdecl fscanf(FILE *__stream, const char *__format, ...);
int _Cdecl fseek(FILE *__stream, long __offset, int __whence);
int _Cdecl fsetpos(FILE *__stream, const fpos_t *__pos);
long _Cdecl ftell(FILE *__stream);
size_t _Cdecl fwrite(const void *__ptr, size_t __size, size_t __n,
FILE *__stream);
char *_Cdecl gets(char *__s);
void _Cdecl perror(const char *__s);
int _Cdecl printf(const char *__format, ...);
int _Cdecl puts(const char *__s);
int _CType remove(const char *__path);
int _CType rename(const char *__oldname,const char *__newname);
void _Cdecl rewind(FILE *__stream);
int _Cdecl scanf(const char *__format, ...);
void _Cdecl setbuf(FILE *__stream, char *__buf);
int _Cdecl setvbuf(FILE *__stream, char *__buf,
int __type, size_t __size);
int _Cdecl sprintf(char *__buffer, const char *__format, ...);
int _Cdecl sscanf(const char *__buffer,
const char *__format, ...);
char *_Cdecl strerror(int __errnum);
FILE *_Cdecl tmpfile(void);
char *_Cdecl tmpnam(char *__s);
int _Cdecl ungetc(int __c, FILE *__stream);
int _Cdecl vfprintf(FILE *__stream, const char *__format,
void *__arglist);
int _Cdecl vfscanf(FILE *__stream, const char *__format,
void *__arglist);
int _CType vprintf(const char *__format, void *__arglist);
int _Cdecl vscanf(const char *__format, void *__arglist);
int _Cdecl vsprintf(char *__buffer, const char *__format,
void *__arglist);
int _Cdecl vsscanf(const char *__buffer, const char *__format,
void *__arglist);
int _CType unlink(const char *__path);
int _Cdecl getc(FILE *__fp);
int _Cdecl getchar(void);
int _Cdecl putchar(const int __c);
int _Cdecl putc(const int __c, FILE *__fp);
int _Cdecl feof(FILE *__fp);
int _Cdecl ferror(FILE *__fp);
#if !__STDC__
int _Cdecl fcloseall(void);
FILE *_Cdecl fdopen(int __handle, char *__type);
int _Cdecl fgetchar(void);
int _Cdecl flushall(void);
int _Cdecl fputchar(int __c);
FILE * _Cdecl _fsopen (const char *__path, const char *__mode,
int __shflag);
int _Cdecl getw(FILE *__stream);
int _Cdecl putw(int __w, FILE *__stream);
int _Cdecl rmtmp(void);
char * _Cdecl _strerror(const char *__s);
char * _Cdecl tempnam(char *__dir, char *__pfx);
#define fileno(f) ((f)->fd)
#endif
int _Cdecl _fgetc(FILE *__stream); /* used by getc() macro */
int _Cdecl _fputc(char __c, FILE *__stream); /* used by putc() macro */
#ifdef __cplusplus
}
#endif
/* The following macros provide for common functions */
#define ferror(f) ((f)->flags & _F_ERR)
#define feof(f) ((f)->flags & _F_EOF)
#define getc(f) \
((--((f)->level) >= 0) ? (unsigned char)(*(f)->curp++) : \
_fgetc (f))
#define putc(c,f) \
((++((f)->level) < 0) ? (unsigned char)(*(f)->curp++=(c)) : \
_fputc ((c),f))
#define getchar() getc(stdin)
#define putchar(c) putc((c), stdout)
#define ungetc(c,f) ungetc((c),f) /* traditionally a macro */
#endif
/* dos.h
Defines structs, unions, macros, and functions for dealing
with MSDOS and the Intel iAPX86 microprocessor family.
Copyright (c) 1987, 1991 by Borland International
All Rights Reserved.
*/
#ifndef __DOS_H
#define __DOS_H
#if !defined( __DEFS_H )
#include <_defs.h>
#endif
extern int _Cdecl errno;
extern int _Cdecl _doserrno;
/* Variables */
extern int const _Cdecl _8087;
extern int _Cdecl _argc;
extern char **_Cdecl _argv;
extern char **_Cdecl environ;
extern unsigned _Cdecl _psp;
extern unsigned _Cdecl _heaplen;
extern unsigned char _Cdecl _osmajor;
extern unsigned char _Cdecl _osminor;
extern unsigned _Cdecl _stklen;
extern unsigned _Cdecl _fpstklen;
extern unsigned _Cdecl _version;
extern unsigned _Cdecl _osversion; /* MSC name for _version */
#define FA_NORMAL 0x00 /* Normal file, no attributes */
#define FA_RDONLY 0x01 /* Read only attribute */
#define FA_HIDDEN 0x02 /* Hidden file */
#define FA_SYSTEM 0x04 /* System file */
#define FA_LABEL 0x08 /* Volume label */
#define FA_DIREC 0x10 /* Directory */
#define FA_ARCH 0x20 /* Archive */
/* MSC names for file attributes */
#define _A_NORMAL 0x00 /* Normal file, no attributes */
#define _A_RDONLY 0x01 /* Read only attribute */
#define _A_HIDDEN 0x02 /* Hidden file */
#define _A_SYSTEM 0x04 /* System file */
#define _A_VOLID 0x08 /* Volume label */
#define _A_SUBDIR 0x10 /* Directory */
#define _A_ARCH 0x20 /* Archive */
#define NFDS 20 /* Maximum number of fds */
struct fcb {
char fcb_drive; /* 0 = default, 1 = A, 2 = B */
char fcb_name[8]; /* File name */
char fcb_ext[3]; /* File extension */
short fcb_curblk; /* Current block number */
short fcb_recsize; /* Logical record size in bytes */
long fcb_filsize; /* File size in bytes */
short fcb_date; /* Date file was last written */
char fcb_resv[10]; /* Reserved for DOS */
char fcb_currec; /* Current record in block */
long fcb_random; /* Random record number */
};
struct xfcb {
char xfcb_flag; /* Contains 0xff to indicate xfcb */
char xfcb_resv[5];/* Reserved for DOS */
char xfcb_attr; /* Search attribute */
struct fcb xfcb_fcb; /* The standard fcb */
};
struct COUNTRY {
int co_date;
char co_curr[5];
char co_thsep[2];
char co_desep[2];
char co_dtsep[2];
char co_tmsep[2];
char co_currstyle;
char co_digits;
char co_time;
long co_case;
char co_dasep[2];
char co_fill[10];
};
#if defined(__MSC) && !defined(__cplusplus)
struct DOSERROR {
int exterror;
char class;
char action;
char locus;
};
#else
struct DOSERROR {
int de_exterror;
char de_class;
char de_action;
char de_locus;
};
#endif /* __MSC and not C++ */
struct dfree {
unsigned df_avail;
unsigned df_total;
unsigned df_bsec;
unsigned df_sclus;
};
struct diskfree_t {
unsigned total_clusters;
unsigned avail_clusters;
unsigned sectors_per_cluster;
unsigned bytes_per_sector;
};
struct fatinfo {
char fi_sclus;
char fi_fatid;
unsigned fi_nclus;
int fi_bysec;
};
struct devhdr {
long dh_next; /* Next device pointer */
short dh_attr; /* Attributes */
unsigned short dh_strat; /* Driver strategy routine */
unsigned short dh_inter; /* Driver interrupt routine */
char dh_name[8]; /* Device name */
};
struct time {
unsigned char ti_min; /* Minutes */
unsigned char ti_hour; /* Hours */
unsigned char ti_hund; /* Hundredths of seconds */
unsigned char ti_sec; /* Seconds */
};
struct dostime_t {
unsigned char hour; /* Hours */
unsigned char minute; /* Minutes */
unsigned char second; /* Seconds */
unsigned char hsecond; /* Hundredths of seconds */
};
struct date {
int da_year; /* Year - 1980 */
char da_day; /* Day of the month */
char da_mon; /* Month (1 = Jan) */
};
struct dosdate_t {
unsigned char day; /* 1-31 */
unsigned char month; /* 1-12 */
unsigned int year; /* 1980 - 2099 */
unsigned char dayofweek;/* 0 - 6 (0=Sunday) */
};
#ifndef _REG_DEFS
#define _REG_DEFS
struct WORDREGS {
unsigned int ax, bx, cx, dx, si, di, cflag, flags;
};
struct BYTEREGS {
unsigned char al, ah, bl, bh, cl, ch, dl, dh;
};
union REGS {
struct WORDREGS x;
struct BYTEREGS h;
};
struct SREGS {
unsigned int es;
unsigned int cs;
unsigned int ss;
unsigned int ds;
};
struct REGPACK {
unsigned r_ax, r_bx, r_cx, r_dx;
unsigned r_bp, r_si, r_di, r_ds, r_es, r_flags;
};
#endif /* _REG_DEFS */
typedef struct {
char ds_drive; /* do not change */
char ds_pattern [13]; /* these fields, */
char ds_reserved [7]; /* Microsoft reserved */
char ds_attrib;
short ds_time;
short ds_date;
long ds_size;
char ds_nameZ [13]; /* result of the search, asciiz */
} dosSearchInfo; /* used with DOS functions 4E, 4F */
#ifndef _FFBLK_DEF
#define _FFBLK_DEF
struct ffblk {
char ff_reserved[21];
char ff_attrib;
unsigned ff_ftime;
unsigned ff_fdate;
long ff_fsize;
char ff_name[13];
};
#endif /* _FFBLK_DEF */
/* The MSC find_t structure corresponds exactly to the ffblk structure */
struct find_t {
char reserved[21]; /* Microsoft reserved - do not change */
char attrib; /* attribute byte for matched file */
unsigned wr_time; /* time of last write to file */
unsigned wr_date; /* date of last write to file */
long size; /* size of file */
char name[13]; /* asciiz name of matched file */
};
/* axret values for _hardresume() */
#define _HARDERR_IGNORE 0 /* ignore error */
#define _HARDERR_RETRY 1 /* retry the operation */
#define _HARDERR_ABORT 2 /* abort program */
#define _HARDERR_FAIL 3 /* fail the operation */
#define SEEK_CUR 1
#define SEEK_END 2
#define SEEK_SET 0
#ifdef __cplusplus
extern "C" {
#endif
int _Cdecl absread( int __drive, int __nsects, long __lsect,
void *__buffer );
int _Cdecl abswrite( int __drive, int __nsects, long __lsect,
void *__buffer );
int _Cdecl allocmem( unsigned __size, unsigned *__segp );
int _CType bdos( int __dosfun, unsigned __dosdx, unsigned __dosal );
int _CType bdosptr( int __dosfun, void *__argument, unsigned __dosal );
struct COUNTRY *_Cdecl country( int __xcode, struct COUNTRY *__cp);
void _Cdecl ctrlbrk( int _Cdecl( *handler )( void ));
void _CType delay( unsigned __milliseconds );
void _Cdecl disable( void );
int _Cdecl dosexterr( struct DOSERROR *__eblkp );
long _Cdecl dostounix( struct date *__d, struct time *__t );
unsigned _Cdecl _dos_allocmem( unsigned __size, unsigned *__segp );
unsigned _Cdecl _dos_close ( int __fd );
unsigned _Cdecl _dos_creat( const char *__pathP, unsigned __attr,
int *__fd );
unsigned _Cdecl _dos_creatnew( const char *__pathP, unsigned __attr,
int *__fd );
unsigned _Cdecl _dos_findfirst( const char *__path,
unsigned __attrib,
struct find_t *__finfo );
unsigned _Cdecl _dos_findnext( struct find_t *__finfo );
unsigned _Cdecl _dos_freemem( unsigned __segx );
void _Cdecl _dos_getdate( struct dosdate_t *__datep );
unsigned _Cdecl _dos_getdiskfree( unsigned __drive,
struct diskfree_t *__dtable);
void _Cdecl _dos_getdrive( unsigned *__drive );
unsigned _Cdecl _dos_getfileattr( const char *__filename,
unsigned *__attrib );
unsigned _Cdecl _dos_getftime( int __fd, unsigned *__date,
unsigned *__time );
void _Cdecl _dos_gettime( struct dostime_t *__timep );
void _Cdecl _dos_keep(unsigned char __status, unsigned __size);
unsigned _Cdecl _dos_open( const char *__pathP, unsigned __oflag,
int *__fd );
unsigned _Cdecl _dos_read( int __fd, void far *__buf, unsigned __len,
unsigned *__nread );
unsigned _Cdecl _dos_setblock( unsigned __size, unsigned __segx,
unsigned *__maxp );
unsigned _Cdecl _dos_setdate( struct dosdate_t *__datep );
void _Cdecl _dos_setdrive( unsigned __drive, unsigned *__ndrives );
unsigned _Cdecl _dos_setfileattr( const char *__filename,
unsigned __attrib);
unsigned _Cdecl _dos_setftime( int __fd, unsigned __date, unsigned __time );
unsigned _Cdecl _dos_settime( struct dostime_t *__timep );
unsigned _Cdecl _dos_write( int __fd, void far *__buf, unsigned __len,
unsigned *__nread );
void __emit__( unsigned char __byte, ...);
void _Cdecl enable( void );
int _Cdecl freemem( unsigned __segx );
int _Cdecl getcbrk( void );
void _CType getdate( struct date *__datep );
void _Cdecl getdfree( unsigned char __drive,
struct dfree *__dtable );
int _Cdecl _getdrive( void );
void _Cdecl getfat( unsigned char __drive,
struct fatinfo *__dtable );
void _Cdecl getfatd( struct fatinfo *__dtable );
unsigned _Cdecl getpsp( void );
int _Cdecl getswitchar( void );
void _CType gettime( struct time *__timep );
int _Cdecl getverify( void );
#ifdef __cplusplus
void _Cdecl _harderr( void _Cdecl (far *__fptr)( unsigned __deverr,
unsigned __doserr, unsigned far *__hdr) );
#else
void _Cdecl _harderr( void _Cdecl (far *__fptr)( ) );
#endif
void _Cdecl _hardresume( int __axret );
void _Cdecl _hardretn( int __retn );
#ifdef __cplusplus
void _CType harderr( int _Cdecl( *__handler )( int __errval, int __ax,
int __bp, int __si) );
#else
void _CType harderr( int _Cdecl( *__handler )( ) );
#endif
void _CType hardresume( int __axret );
void _CType hardretn( int __retn );
#ifndef _PORT_DEFS
int _Cdecl inp( unsigned __portid );
unsigned _Cdecl inpw( unsigned __portid );
#endif
int _Cdecl inport( int __portid );
#ifndef _PORT_DEFS
unsigned char _Cdecl inportb( int __portid );
#endif
int _Cdecl int86( int __intno,
union REGS *__inregs,
union REGS *__outregs );
int _Cdecl int86x( int __intno,
union REGS *__inregs,
union REGS *__outregs,
struct SREGS *__segregs );
int _Cdecl intdos( union REGS *__inregs,
union REGS *__outregs );
int _Cdecl intdosx( union REGS *__inregs,
union REGS *__outregs,
struct SREGS *__segregs );
void _Cdecl intr( int __intno, struct REGPACK *__preg );
void _Cdecl keep( unsigned char __status, unsigned __size );
void _Cdecl nosound( void );
#ifndef _PORT_DEFS
int _Cdecl outp( unsigned __portid, int __value );
unsigned _Cdecl outpw( unsigned __portid, unsigned __value );
#endif
void _Cdecl outport( int __portid, int __value );
#ifndef _PORT_DEFS
void _Cdecl outportb( int __portid, unsigned char __value );
#endif
char * _Cdecl parsfnm( const char *__cmdline,
struct fcb *__fcb, int __opt );
int _Cdecl peek( unsigned __segment, unsigned __offset );
char _Cdecl peekb( unsigned __segment, unsigned __offset );
void _Cdecl poke( unsigned __segment, unsigned __offset, int __value);
void _Cdecl pokeb( unsigned __segment,
unsigned __offset, char __value );
int _Cdecl randbrd( struct fcb *__fcb, int __rcnt );
int _Cdecl randbwr( struct fcb *__fcb, int __rcnt );
void _Cdecl segread( struct SREGS *__segp );
int _Cdecl setblock( unsigned __segx, unsigned __newsize );
int _Cdecl setcbrk( int __cbrkvalue );
void _Cdecl setdate( struct date *__datep );
void _Cdecl setswitchar( char __ch );
void _Cdecl settime( struct time *__timep );
void _Cdecl setverify( int __value );
void _Cdecl sleep( unsigned __seconds );
void _Cdecl sound( unsigned __frequency );
void _Cdecl unixtodos( long __time, struct date *__d,
struct time *__t );
int _CType unlink( const char *__path );
/* These are in-line functions. These prototypes just clean up
some syntax checks and code generation.
*/
void _Cdecl __cli__( void );
void _Cdecl __sti__( void );
void _Cdecl __int__( int __interruptnum );
#define disable( ) __emit__( (char )( 0xfa ) )
#define _disable( ) __emit__( (char )( 0xfa ) ) /* MSC name */
#define enable( ) __emit__( (char )( 0xfb ) )
#define _enable( ) __emit__( (char )( 0xfb ) ) /* MSC name */
#define geninterrupt( i ) __int__( i ) /* Interrupt instruction */
#ifndef _PORT_DEFS
#define _PORT_DEFS
unsigned char _Cdecl __inportb__( int __portid );
unsigned int _Cdecl __inportw__( int __portid );
void _Cdecl __outportb__( int __portid, unsigned char __value );
void _Cdecl __outportw__( int __portid, unsigned int __value );
#define inportb __inportb__
#define outportb __outportb__
/* MSC-compatible macros for port I/O */
#define inp( portid ) __inportb__( portid )
#define outp( portid,v ) (__outportb__( portid,v ), (int)_AL)
#define inpw( portid ) __inportw__( portid )
#define outpw( portid,v ) (__outportw__( portid,v ), (unsigned)_AX)
#endif /* _PORT_DEFS */
#if !__STDC__
extern unsigned _Cdecl _ovrbuffer;
int cdecl far _OvrInitEms( unsigned __emsHandle, unsigned __emsFirst,
unsigned __emsPages );
int cdecl far _OvrInitExt( unsigned long __extStart,
unsigned long __extLength );
char far *cdecl getdta( void );
void cdecl setdta( char far *__dta );
#define MK_FP( seg,ofs )( (void _seg * )( seg ) +( void near * )( ofs ))
#define FP_SEG( fp )( (unsigned )( void _seg * )( void far * )( fp ))
#define FP_OFF( fp )( (unsigned )( fp ))
#ifdef __cplusplus
void _Cdecl _chain_intr ( void interrupt (far *__target)( ... ));
void interrupt( far * _Cdecl _dos_getvect( unsigned __interruptno ))( ... );
void interrupt( far * _CType getvect( int __interruptno ))( ... );
void _Cdecl _dos_setvect( unsigned __interruptno,
void interrupt( far *__isr )( ... ));
void _CType setvect( int __interruptno,
void interrupt( far *__isr )( ... ));
int inline _Cdecl peek( unsigned __segment, unsigned __offset )
{ return( *( (int far* )MK_FP( __segment, __offset )) ); }
char inline _Cdecl peekb( unsigned __segment, unsigned __offset )
{ return( *( (char far* )MK_FP( __segment, __offset )) ); }
void inline _Cdecl poke( unsigned __segment, unsigned __offset, int __value )
{( *( (int far* )MK_FP( __segment, __offset )) = __value ); }
void inline _Cdecl pokeb( unsigned __segment, unsigned __offset, char __value )
{( *( (char far* )MK_FP( __segment, __offset )) = __value ); }
#else
void _Cdecl _chain_intr ( void interrupt (far *__target)( ));
void interrupt( far * _Cdecl _dos_getvect( unsigned __interruptno ))( );
void interrupt( far * _CType getvect( int __interruptno ))( );
void _Cdecl _dos_setvect( unsigned __interruptno,
void interrupt( far *__isr )( ));
void _CType setvect( int __interruptno,
void interrupt( far *__isr )( ) );
#define peek( a,b )( *( (int far* )MK_FP( (a ),( b )) ))
#define peekb( a,b )( *( (char far* )MK_FP( (a ),( b )) ))
#define poke( a,b,c )( *( (int far* )MK_FP( (a ),( b )) ) =( int )( c ))
#define pokeb( a,b,c )( *( (char far* )MK_FP( (a ),( b )) ) =( char )( c ))
#endif /* __cplusplus */
#endif /* !__STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* __DOS_H */
/* conio.h
Direct MSDOS console input/output.
Copyright (c) 1987, 1991 by Borland International
All Rights Reserved.
*/
#if !defined(__CONIO_H)
#define __CONIO_H
#if !defined(__DEFS_H)
#include <_defs.h>
#endif
#define _NOCURSOR 0
#define _SOLIDCURSOR 1
#define _NORMALCURSOR 2
struct text_info {
unsigned char winleft;
unsigned char wintop;
unsigned char winright;
unsigned char winbottom;
unsigned char attribute;
unsigned char normattr;
unsigned char currmode;
unsigned char screenheight;
unsigned char screenwidth;
unsigned char curx;
unsigned char cury;
};
enum text_modes { LASTMODE=-1, BW40=0, C40, BW80, C80, MONO=7, C4350=64 };
#if !defined(__COLORS)
#define __COLORS
enum COLORS {
BLACK, /* dark colors */
BLUE,
GREEN,
CYAN,
RED,
MAGENTA,
BROWN,
LIGHTGRAY,
DARKGRAY, /* light colors */
LIGHTBLUE,
LIGHTGREEN,
LIGHTCYAN,
LIGHTRED,
LIGHTMAGENTA,
YELLOW,
WHITE
};
#endif
#define BLINK 128 /* blink bit */
extern int _Cdecl directvideo;
extern int _Cdecl _wscroll;
#ifdef __cplusplus
extern "C" {
#endif
void _Cdecl clreol( void );
void _Cdecl clrscr( void );
void _Cdecl gotoxy( int __x, int __y );
int _Cdecl wherex( void );
int _Cdecl wherey( void );