initial commit

This commit is contained in:
root
2023-06-12 09:14:09 +02:00
commit b4912f303e
2545 changed files with 209350 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,2 @@
common\nkcc_c.c
common\aaaankcc.s ; for the real nkc_tconv

View File

@@ -0,0 +1,139 @@
FIN0=strncpy
FIN1=fixdot
FIN2=INIT
FIN3=g_print
FIN4=e_print
FIN5=fp_print
FIN6=cpy
FIN7=DNAN
FIN8=v5.3DB8
FIN9=print
EDCU=1
EDCY=2
REPS=TWP_TOKEN
BTCU=9
WORD=0
NWRD=1
WRDB=0
WRDE=0
CASE=1
SURR=0
DEEP=0
TALK=0
ONCE=0
FBCK=1
FRWD=0
HKL0=#if*
HKR0=#endif
HKL1=do
HKR1=od
HKL2=node
HKR2=endnode
HKL3=case
HKR3=break
HKL4=begin
HKR4=end
HKL5=REPT
HKR5=ENDM
HKL6=if
HKR6=fi
HKCS=0
FCP1=D:\aaaa\ahcc\*.[Cc]*
FCP2=E:\AHCC.5\ahcc.src\ahcc\*.[Cc]*
MULN=F:\NeoN\NEON\SRC\*.[CHSchs]*
JRLX=1091
JRLY=21
JRLW=810
JRLH=1032
RTUN=0
AOPT=1
LCFG= {
vit =32
vic =-1
atab=2
ptab=8
ltab=1
tab =4
spl =248
aui =1
bol =1
lnr =0
tra =1
sma =0
svm =1
sva =1
svt =2
svn =3
shm =0
sha =0
sht =1
shn =2
}
SHEL= {
UDIR=D:\aaaa\*.*
MAKN=D:\aaaa\calc_cf.prj
NBUG=1
CMPT=1
VOPT=0
V1PT=0
V2PT=0
V3PT=0
COPT=1
KOPT=0
OPT2=0
FOPT=0
FOP1=0
PHOP=1
FTOP=0
PDOM=0
APOP=0
COIH=0
XOPT=0
LOPT=0
SUPT=1
XOPL=0
TOPN=0
TOPT=1
FLPT=0
LSPT=0
MSPT=0
JOPT=0
GSOP=0
LSOP=1
GTPT=0
ERFT=25
ERPT=1
WOFT=99
WOPT=0
DEFT=__STRICT_ANSI__=1
DEPT=0
DEF1=NKCGEM=1
DEP1=0
DEP2=0
DEP3=0
DEF4=DEBUG=1
DEP4=0
IOFT=include
IOPT=0
IOF1=sinclude
IOP1=1
IOP2=0
IOP3=0
IOP4=0
DOMT=*.C
DOFT=lib
DOPT=1
RTFU=main
AHF1=0
AHF2=0
AHF3=0
AHF4=0
AHF5=0
TOPB=0
SOPB=0
AOPB=0
ZOPB=0
XDFB=ntj
XDPB=1
YDPB=0
}

View File

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,513 @@
* load map of D:\aaaa\shell\ahclcf.ttp produced by AHCL (c) H. Robbers @ Amsterdam
in d:\CC\lib\ahcstart.o
0 0[ 478] TEXT
14 14 TEXT <ACC>
16 16 TEXT <APP>
208 208 TEXT <ScanEnvLoop>
216 216 TEXT <Start1>
256 256 TEXT <xArgLoop>
274 274 TEXT <ScanEnvExit>
298 298 TEXT <Start2>
320 320 TEXT <Start3>
334 334 TEXT <Stx3>
340 340 TEXT <Start4>
344 344 TEXT <Stx4>
356 356 TEXT <B1>
368 368 TEXT <Start5>
380 380 TEXT <Start6>
392 392 TEXT <Start7>
400 400 TEXT <CallMain>
422 422 TEXT <Exite>
434 434 TEXT exit
460 460 TEXT <Exit1>
472 472 TEXT <Exit2>
478
in D:\aaaa\ahcc\cc_load.o
478 0[ 254] TEXT CC_load
254
in D:\aaaa\ahcc\ld.o
732 0[ 92] TEXT <bfind_ref>
824 92[ 84] TEXT <find_ref>
908 176[ 234] TEXT <gbfind_ref>
1142 410[ 90] TEXT <gfind_ref>
1232 500[ 112] TEXT <bfind_locref>
1344 612[ 48] TEXT find_locref
1392 660[ 98] TEXT <ins_bref>
1490 758[ 50] TEXT <new_bref>
1540 808[ 312] TEXT <remove_ref>
1852 1120[ 100] TEXT new_ref
1952 1220[ 96] TEXT new_locref
2048 1316[ 70] TEXT <copy_refs>
2118 1386[ 102] TEXT <ifile>
2220 1488[ 42] TEXT <un_eol>
2262 1530[ 124] TEXT <read_obnames>
2386 1654[ 40] TEXT <after_is>
2426 1694[ 834] TEXT <doopt>
3260 2528[ 244] TEXT check_double
3504 2772[ 506] TEXT <write_symbols>
4010 3278[ 70] TEXT <match_local>
4080 3348[ 92] TEXT <match_ref>
4172 3440[ 168] TEXT <match_area>
4340 3608[ 194] TEXT <match_global>
4534 3802[ 256] TEXT <entries>
4790 4058[ 82] TEXT <firstreloc>
4872 4140[ 122] TEXT <addreloc>
4994 4262[ 846] TEXT <fix>
5840 5108[ 38] TEXT <anonymous>
5878 5146[ 108] TEXT <ar_name>
5986 5254[ 426] TEXT <pr_map>
6412 5680[ 224] TEXT <load_map>
6636 5904[ 258] TEXT <pr_sym>
6894 6162[ 296] TEXT <write_nm>
7190 6458[ 68] TEXT <remove_unreferenced>
7258 6526[ 1270] TEXT <write_program>
8528 7796[ 56] TEXT LD_ranout
8584 7852[ 936] TEXT main
8788
in D:\aaaa\ahcc\ld_ob.o
9520 0[ 30] TEXT format_error
9550 30[ 284] TEXT <get_pc_names>
9834 314[ 30] TEXT <skip>
9864 344[ 400] TEXT <ins_fixup>
10264 744[ 32] TEXT <is_start>
10296 776[ 260] TEXT <get_fixups>
10556 1036[ 40] TEXT <is_begin>
10596 1076[ 270] TEXT <get_area>
10866 1346[ 94] TEXT anon_ref
10960 1440[ 78] TEXT <analyse_a_refs>
11038 1518[ 480] TEXT <make_symbol_tree>
11518 1998[ 256] TEXT <load_pure>
11774 2254[ 138] TEXT <vglsym>
11912 2392[ 68] TEXT <put_name>
11980 2460[ 606] TEXT <get_dri_names>
12586 3066[ 24] TEXT <dri_ent2pc>
12610 3090[ 36] TEXT <dri_mod2pc>
12646 3126[ 164] TEXT <dri_segment>
12810 3290[ 122] TEXT <getname>
12932 3412[ 162] TEXT <in_symtab>
13094 3574[ 1254] TEXT <make_fixups>
14348 4828[ 162] TEXT <gfa_data>
14510 4990[ 246] TEXT <load_dri>
14756 5236[ 82] TEXT <gfa_name>
14838 5318[ 156] TEXT <load_drilib>
14994 5474[ 282] TEXT load_ob
5756
in D:\aaaa\ahcc\list.o
15276 0[ 76] TEXT rem_list
15352 76[ 74] TEXT cut_list
15426 150[ 68] TEXT append_list
15494 218[ 72] TEXT move_list
15566 290[ 56] TEXT ins_last
15622 346[ 92] TEXT ins_before
15714 438[ 86] TEXT ins_after
15800 524[ 8] TEXT clr_listbase
532
in D:\aaaa\ahcc\plib.o
15808 0[ 32] TEXT is_ref
15840 32[ 32] TEXT is_entry
15872 64[ 20] TEXT is_lc_entry
15892 84[ 20] TEXT is_gl_entry
15912 104[ 92] TEXT ldhash
16004 196[ 20] TEXT no_image
16024 216[ 20] TEXT is_module
16044 236[ 34] TEXT fixup_name
16078 270[ 40] TEXT disp_target
16118 310[ 212] TEXT list_refs
16330 522[ 78] TEXT clr_treebase
16408 600[ 60] TEXT <create_last>
16468 660[ 66] TEXT <create_after>
16534 726[ 66] TEXT <create_before>
16600 792[ 220] TEXT ins_flist
16820 1012[ 8] TEXT new_flist
16828 1020[ 68] TEXT ins_ref
16896 1088[ 124] TEXT new_fixup
17020 1212[ 190] TEXT new_area
17210 1402[ 104] TEXT add_areas
17314 1506[ 660] TEXT <handle_fixups>
17974 2166[ 106] TEXT <add_fixups>
18080 2272[ 122] TEXT <add_names>
18202 2394[ 176] TEXT write_areas
18378 2570[ 114] TEXT <wfixup>
18492 2684[ 232] TEXT <segment_fixup>
18724 2916[ 124] TEXT <write_fixups>
18848 3040[ 242] TEXT <write_names>
19090 3282[ 932] TEXT write_object
4214
in D:\aaaa\common\qmem.o
20022 0[ 106] TEXT CC_qalloc
20128 106[ 78] TEXT init_membase
20206 184[ 32] TEXT free_membase
216
in D:\aaaa\common\amem.o
20238 0[ 18] TEXT CC_xmalloc
20256 18[ 16] TEXT CC_xfree_all
20272 34[ 18] TEXT CC_fmalloc
20290 52[ 16] TEXT CC_ffree_all
68
in D:\aaaa\ahcc\ttp_io.o
20306 0[ 114] TEXT send_msg
20420 114[ 18] TEXT console
132
in D:\aaaa\common\aaaa_lib.o
20438 0[ 32] TEXT is_alpha
20470 32[ 82] TEXT cldbv
114
in D:\aaaa\common\hierarch.o
20552 0[ 28] TEXT strmaxcpy
20580 28[ 52] TEXT DIRcpy
20632 80[ 72] TEXT DIRcat
20704 152[ 150] TEXT inq_xfs
20854 302[ 44] TEXT <hn_issep>
20898 346[ 52] TEXT <hn_strsep>
20950 398[ 32] TEXT <dotdot>
20982 430[ 210] TEXT <hn_new_part>
21192 640[ 50] TEXT <ins_part>
21242 690[ 48] TEXT <separators>
21290 738[ 290] TEXT hn_make
21580 1028[ 90] TEXT hn_free
21670 1118[ 40] TEXT strslash
21710 1158[ 120] TEXT change_suffix
1278
in d:\CC\lib\ahccstdf.lib
21830 0[ 32] TEXT tolower
21862 32[ 32] TEXT toupper
21894 64[ 26] TEXT isalpha
21920 90[ 26] TEXT isdigit
21946 116[ 26] TEXT islower
21972 142[ 26] TEXT isupper
21998 168[ 194] TEXT <_wqsort>
22192 362[ 194] TEXT <_lqsort>
22386 556[ 446] TEXT <_nqsort>
22832 1002[ 134] TEXT qsort
22966 1136[ 70] TEXT ultoa
23036 1206[ 52] TEXT ltoa
23088 1258[ 16] TEXT itoa
23104 1274[ 76] TEXT <i_f>
23180 1350[ 60] TEXT Init_iob
23240 1410[ 30] TEXT <c_f>
23270 1440[ 94] TEXT Exit_iob
23364 1534[ 346] TEXT
23710 1880[ 116] TEXT fopen
23826 1996[ 46] TEXT lseek
23872 2042[ 156] TEXT <_fflush>
24028 2198[ 106] TEXT fflush
24134 2304[ 130] TEXT fclose
24264 2434[ 90] TEXT
24354 2524[ 534] TEXT _tttty
24888 3058[ 328] TEXT fgetc
25216 3386[ 84] TEXT fgets
25300 3470[ 206] TEXT fputc
25506 3676[ 60] TEXT fputs
25566 3736[ 72] TEXT
25638 3808[ 180] TEXT open
25818 3988[ 24] TEXT close
25842 4012[ 28] TEXT read
25870 4040[ 28] TEXT write
25898 4068[ 178] TEXT <p_round>
26076 4246[ 112] TEXT <is_NaNorInf>
26188 4358[ 176] TEXT <e_print>
26364 4534[ 252] TEXT <f_print>
26616 4786[ 134] TEXT <g_print>
26750 4920[ 202] TEXT <fp_print>
26952 5122[ 326] TEXT
27278 5448[ 1236] TEXT _printf
28514 6684[ 16] TEXT
28530 6700[ 20] TEXT
28550 6720[ 64] TEXT sprintf
28614 6784[ 26] TEXT fprintf
28640 6810[ 26] TEXT vfprintf
28666 6836[ 24] TEXT vprintf
28690 6860[ 274] TEXT <new_block>
28964 7134[ 100] TEXT <free_block>
29064 7234[ 72] TEXT <extract>
29136 7306[ 114] TEXT <find_free>
29250 7420[ 134] TEXT <split>
29384 7554[ 38] TEXT <insfirst>
29422 7592[ 60] TEXT <insbefore>
29482 7652[ 44] TEXT <inslast>
29526 7696[ 62] TEXT <insafter>
29588 7758[ 56] TEXT <amalgam>
29644 7814[ 170] TEXT <sortins>
29814 7984[ 42] TEXT <combine>
29856 8026[ 80] TEXT <XA_round>
29936 8106[ 70] TEXT <in_list>
30006 8176[ 126] TEXT <find_unit>
30132 8302[ 246] TEXT XA_alloc
30378 8548[ 82] TEXT XA_calloc
30460 8630[ 214] TEXT <free_unit>
30674 8844[ 692] TEXT XA_realloc
31366 9536[ 86] TEXT XA_free
31452 9622[ 34] TEXT XA_match
31486 9656[ 160] TEXT XA_free_all
31646 9816[ 152] TEXT XA_set_base
31798 9968[ 14] TEXT malloc
31812 9982[ 10] TEXT free
31822 9992[ 12] TEXT xmalloc
31834 10004[ 14] TEXT xcalloc
31848 10018[ 16] TEXT xrealloc
31864 10034[ 10] TEXT xfree
31874 10044[ 88] TEXT isatty
31962 10132[ 110] TEXT access
32072 10242[ 12] TEXT
32084 10254[ 26] TEXT clock
32110 10280[ 40] TEXT strcmp
32150 10320[ 78] TEXT stricmp
32228 10398[ 42] TEXT strncmp
32270 10440[ 86] TEXT strnicmp
32356 10526[ 12] TEXT strcpy
32368 10538[ 22] TEXT strncpy
32390 10560[ 14] TEXT strlen
32404 10574[ 42] TEXT strchr
32446 10616[ 40] TEXT strrchr
32486 10656[ 54] TEXT
32540 10710[ 12] TEXT strupr
32552 10722[ 12] TEXT strlwr
32564 10734[ 52] TEXT strrev
32616 10786[ 58] TEXT memmove
32674 10844[ 6] TEXT memcpy
32680 10850[ 18] TEXT memset
32698 10868[ 334] TEXT <Dnorm>
33032 11202[ 134] TEXT <Dunscale>
33166 11336[ 472] TEXT <Dscale>
33638 11808[ 470] TEXT log
34108 12278[ 16] TEXT log10
34124 12294[ 58] TEXT <dmul>
34182 12352[ 380] TEXT <Dtento>
34562 12732[ 16] TEXT pow10
34578 12748[ 368] TEXT ecvt
34946 13116[ 10] TEXT setjmp
34956 13126[ 12] TEXT longjmp
34966 13136 TEXT <L1822>
13138
in d:\CC\lib\ahcstart.o
34968 0[ 26] DATA
34970 2 DATA _argc
34972 4 DATA _argv
34976 8 DATA _envp
34980 12 DATA EmpStr
34982 14 DATA _AtExitVec
34986 18 DATA _FilSysVec
26
in D:\aaaa\ahcc\cc_load.o
34994 0[ 24] DATA
24
in D:\aaaa\ahcc\ld.o
35018 0[ 4] DATA
35022 4[ 4] DATA
35026 8[ 20] DATA
35046 28[ 580] DATA
35626 608[ 22] DATA
35648 630[ 26] DATA
35674 656[ 64] DATA
35738 720[ 46] DATA
35784 766[ 6] DATA
35790 772[ 94] DATA
35884 866[ 118] DATA
36002 984[ 20] DATA
36022 1004[ 134] DATA
36156 1138[ 256] DATA
36412 1394[ 48] DATA
36460 1442[ 164] DATA
36624 1606[ 32] DATA
36656 1638[ 4] DATA
36656 1638 DATA <abort_msg>
36660 1642[ 2160] DATA
36660 1642 DATA bugf
36664 1646 DATA stackname
36674 1656 DATA ld_lbl
36676 1658 DATA P
3802
in D:\aaaa\ahcc\ld_ob.o
38820 0[ 4] DATA
38824 4[ 8] DATA
38832 12[ 4] DATA
38836 16[ 28] DATA
38864 44[ 6] DATA
38870 50[ 2] DATA
38872 52[ 96] DATA
38968 148[ 28] DATA
38996 176[ 2] DATA
38998 178[ 2] DATA
39000 180[ 92] DATA
39092 272[ 58] DATA
39092 272 DATA <stack_ob_init>
39150 330[ 8] DATA
39158 338[ 8] DATA
39158 338 DATA <topc>
39166 346[ 8] DATA
39174 354[ 16] DATA
39174 354 DATA vx
370
in D:\aaaa\ahcc\plib.o
39190 0[ 4] DATA
39194 4[ 182] DATA
39376 186[ 4] DATA
39380 190[ 2] DATA
39382 192[ 46] DATA
39428 238[ 20] DATA
39448 258[ 58] DATA
39506 316[ 74] DATA
39580 390[ 18] DATA
39598 408[ 18] DATA
39616 426[ 18] DATA
39634 444[ 144] DATA
39778 588[ 146] DATA
39778 588 DATA <result>
39780 590 DATA <target_txt>
39796 606 DATA <fixnames>
734
in D:\aaaa\common\amem.o
39924 0[ 54] DATA
39978 54[ 120] DATA
39978 54 DATA XA_NS_base
40018 94 DATA XA_CC_base
40058 134 DATA XA_CC_fbase
174
in D:\aaaa\ahcc\ttp_io.o
40098 0[ 2] DATA
2
in D:\aaaa\common\aaaa_lib.o
40100 0[ 4] DATA
4
in d:\CC\lib\ahccstdf.lib
40104 0[ 512] DATA
40104 0 DATA <_ctype>
40616 512[ 4] DATA
40616 512 DATA _qbuf
40620 516[ 18] DATA
40638 534[ 20] DATA
40658 554[ 72] DATA
40730 626[ 822] DATA
40730 626 DATA _StdInF
40752 648 DATA _StdOutF
40774 670 DATA _StdErrF
40796 692 DATA _StdPrnF
40818 714 DATA _StdAuxF
40840 736 DATA _iob
41544 1440 DATA init_streams
41548 1444 DATA end_streams
41552 1448[ 16] DATA
41568 1464[ 2] DATA
41568 1464 DATA <fixdot>
41570 1466[ 86] DATA
41656 1552[ 16] DATA
41656 1552 DATA NaN
41672 1568[ 2] DATA
41672 1568 DATA _prt_lmode
41674 1570[ 42] DATA
41716 1612[ 164] DATA
41716 1612 DATA XA_heap_base
41756 1652 DATA XA_local_base
41796 1692 DATA XA_file_base
41836 1732 DATA XA_global_base
41876 1772 DATA XA_total
41880 1776[ 8] DATA
41888 1784[ 32] DATA
41888 1784 DATA <zero>
41896 1792 DATA <half>
41904 1800 DATA <one>
41912 1808 DATA <two>
41920 1816[ 96] DATA
41920 1816 DATA <sqrt2>
41928 1824 DATA <pp>
41952 1848 DATA <pq>
41984 1880 DATA <ec1>
41992 1888 DATA <ec2>
42000 1896 DATA <hugexp>
42008 1904 DATA <invln2>
42016 1912[ 64] DATA
42016 1912 DATA <lp>
42040 1936 DATA <lq>
42064 1960 DATA <loge>
42072 1968 DATA <rthalf>
42080 1976[ 72] DATA
42080 1976 DATA <pows>
42152 2048[ 48] DATA
42152 2048 DATA Hugeval
42160 2056 DATA Inf
42168 2064 DATA Nan
42176 2072 DATA Rteps
42184 2080 DATA Xbig
42192 2088 DATA Half
42200 2096[ 16] DATA
2112
in d:\CC\lib\ahcstart.o
42216 0[ 38] BSS
42218 2 BSS _base
42222 6 BSS _BasPag
42226 10 BSS _app
42228 12 BSS errno
42230 14 BSS etext
42234 18 BSS edata
42238 22 BSS ebss
42242 26 BSS _break
42246 30 BSS _StkLim
42250 34 BSS _PgmSize
38
in D:\aaaa\ahcc\ld.o
42254 0[ 12196] BSS
42254 0 BSS <BaseA4>
42258 4 BSS <lreloc>
42262 8 BSS <sttext>
42266 12 BSS <stdata>
42270 16 BSS <stbss>
42274 20 BSS <imgsize>
42278 24 BSS <ex_row>
46314 4060 BSS <gl_row>
50350 8096 BSS <out_row>
54386 12132 BSS <ex_base>
54410 12156 BSS <out_base>
54434 12180 BSS <oname>
54438 12184 BSS <last>
54442 12188 BSS <cmp>
54444 12190 BSS <name_d>
54446 12192 BSS <rname>
54450 12196[ 8] BSS
54450 12196 BSS <eq8>
54454 12200 BSS <gname>
54458 12204[ 12] BSS
54458 12204 BSS <relprev>
54462 12208 BSS <reloc>
54466 12212 BSS <relp>
54470 12216[ 256] BSS
54726 12472[ 116] BSS
54726 12472 BSS <ld_jump>
54842 12588[ 56] BSS
54842 12588 BSS stacksize
54846 12592 BSS flags
54874 12620 BSS gl_base
54898 12644[ 4] BSS
54898 12644 BSS curreloc
12648
in D:\aaaa\ahcc\ld_ob.o
54902 0[ 58] BSS
54902 0 BSS <stack_ob>
54960 58[ 16] BSS
54976 74[ 2] BSS
54976 74 BSS gfa
76
in D:\aaaa\ahcc\plib.o
54978 0[ 4] BSS
54978 0 BSS <last_area>
54982 4[ 168] BSS
54982 4 BSS defmem
55038 60 BSS refmem
55094 116 BSS opndmem
172
in D:\aaaa\common\hierarch.o
55150 0[ 8] BSS
55150 0 BSS <xfsc>
55154 4 BSS <xfst>
55158 8[ 128] BSS
136
in d:\CC\lib\ahccstdf.lib
55286 0[ 44] BSS
55286 0 BSS <_dta>
55330 44[ 4] BSS
55334 48[ 34] BSS
55334 48 BSS <buf>
82
in StckSize
0 0[ 8192] OFFS _StkSize
8192

Binary file not shown.

View File

@@ -0,0 +1,637 @@
* load map of D:\aaaa\shell\ahclcf_p.ttp produced by AHCL (c) H. Robbers @ Amsterdam
in d:\CC\lib\ahcstart.o
0 0[ 478] TEXT
14 14 TEXT <ACC>
16 16 TEXT <APP>
208 208 TEXT <ScanEnvLoop>
216 216 TEXT <Start1>
256 256 TEXT <xArgLoop>
274 274 TEXT <ScanEnvExit>
298 298 TEXT <Start2>
320 320 TEXT <Start3>
334 334 TEXT <Stx3>
340 340 TEXT <Start4>
344 344 TEXT <Stx4>
356 356 TEXT <B1>
368 368 TEXT <Start5>
380 380 TEXT <Start6>
392 392 TEXT <Start7>
400 400 TEXT <CallMain>
422 422 TEXT <Exite>
434 434 TEXT exit
460 460 TEXT <Exit1>
472 472 TEXT <Exit2>
478
in D:\aaaa\shell\shell.o
478 0[ 156] TEXT <findupsuf>
634 156[ 56] TEXT inlist
690 212[ 124] TEXT <putflist>
814 336[ 484] TEXT <keepfile>
1298 820[ 138] TEXT defofile
1436 958[ 60] TEXT <clear_files>
1496 1018[ 124] TEXT <clear_project>
1620 1142[ 26] TEXT remove_project
1646 1168[ 146] TEXT <look_CC>
1792 1314[ 948] TEXT dold
2740 2262[ 72] TEXT <make_path>
2812 2334[ 170] TEXT <add_options>
2982 2504[ 848] TEXT <load_prj>
3830 3352[ 132] TEXT loadmake
3962 3484[ 8] TEXT get_libstr
3970 3492[ 46] TEXT wait_exit
4016 3538[ 138] TEXT <doopt>
4154 3676[ 200] TEXT main
3876
in D:\aaaa\shell\tos_call.o
4354 0[ 140] TEXT
4354 0 TEXT tos_call
4372 18 TEXT <lo>
4376 22 TEXT <l0>
4392 38 TEXT <l1>
4398 44 TEXT <space>
4398 44 TEXT <l2>
4420 66 TEXT <apo>
4422 68 TEXT <l3>
4448 94 TEXT <lx>
4452 98 TEXT <lee>
140
in D:\aaaa\ahcc\cc_load.o
4494 0[ 254] TEXT CC_load
254
in D:\aaaa\ahcc\ld.o
4748 0[ 92] TEXT <bfind_ref>
4840 92[ 84] TEXT <find_ref>
4924 176[ 234] TEXT <gbfind_ref>
5158 410[ 90] TEXT <gfind_ref>
5248 500[ 112] TEXT <bfind_locref>
5360 612[ 48] TEXT find_locref
5408 660[ 98] TEXT <ins_bref>
5506 758[ 50] TEXT <new_bref>
5556 808[ 312] TEXT <remove_ref>
5868 1120[ 100] TEXT new_ref
5968 1220[ 96] TEXT new_locref
6064 1316[ 70] TEXT <copy_refs>
6134 1386[ 102] TEXT <ifile>
6236 1488[ 42] TEXT <un_eol>
6278 1530[ 124] TEXT <read_obnames>
6402 1654[ 40] TEXT <after_is>
6442 1694[ 556] TEXT <doopt>
6998 2250[ 244] TEXT check_double
7242 2494[ 506] TEXT <write_symbols>
7748 3000[ 70] TEXT <match_local>
7818 3070[ 92] TEXT <match_ref>
7910 3162[ 168] TEXT <match_area>
8078 3330[ 194] TEXT <match_global>
8272 3524[ 256] TEXT <entries>
8528 3780[ 82] TEXT <firstreloc>
8610 3862[ 122] TEXT <addreloc>
8732 3984[ 846] TEXT <fix>
9578 4830[ 38] TEXT <anonymous>
9616 4868[ 108] TEXT <ar_name>
9724 4976[ 426] TEXT <pr_map>
10150 5402[ 224] TEXT <load_map>
10374 5626[ 258] TEXT <pr_sym>
10632 5884[ 296] TEXT <write_nm>
10928 6180[ 68] TEXT <remove_unreferenced>
10996 6248[ 1270] TEXT <write_program>
12266 7518[ 56] TEXT LD_ranout
12322 7574[ 876] TEXT linker
8450
in D:\aaaa\ahcc\ld_ob.o
13198 0[ 30] TEXT format_error
13228 30[ 284] TEXT <get_pc_names>
13512 314[ 30] TEXT <skip>
13542 344[ 400] TEXT <ins_fixup>
13942 744[ 32] TEXT <is_start>
13974 776[ 260] TEXT <get_fixups>
14234 1036[ 40] TEXT <is_begin>
14274 1076[ 270] TEXT <get_area>
14544 1346[ 94] TEXT anon_ref
14638 1440[ 78] TEXT <analyse_a_refs>
14716 1518[ 480] TEXT <make_symbol_tree>
15196 1998[ 256] TEXT <load_pure>
15452 2254[ 138] TEXT <vglsym>
15590 2392[ 68] TEXT <put_name>
15658 2460[ 606] TEXT <get_dri_names>
16264 3066[ 24] TEXT <dri_ent2pc>
16288 3090[ 36] TEXT <dri_mod2pc>
16324 3126[ 164] TEXT <dri_segment>
16488 3290[ 122] TEXT <getname>
16610 3412[ 162] TEXT <in_symtab>
16772 3574[ 1254] TEXT <make_fixups>
18026 4828[ 162] TEXT <gfa_data>
18188 4990[ 246] TEXT <load_dri>
18434 5236[ 82] TEXT <gfa_name>
18516 5318[ 156] TEXT <load_drilib>
18672 5474[ 282] TEXT load_ob
5756
in D:\aaaa\ahcc\list.o
18954 0[ 76] TEXT rem_list
19030 76[ 74] TEXT cut_list
19104 150[ 68] TEXT append_list
19172 218[ 72] TEXT move_list
19244 290[ 56] TEXT ins_last
19300 346[ 92] TEXT ins_before
19392 438[ 86] TEXT ins_after
19478 524[ 8] TEXT clr_listbase
532
in D:\aaaa\ahcc\plib.o
19486 0[ 32] TEXT is_ref
19518 32[ 32] TEXT is_entry
19550 64[ 20] TEXT is_lc_entry
19570 84[ 20] TEXT is_gl_entry
19590 104[ 92] TEXT ldhash
19682 196[ 20] TEXT no_image
19702 216[ 20] TEXT is_module
19722 236[ 34] TEXT fixup_name
19756 270[ 40] TEXT disp_target
19796 310[ 212] TEXT list_refs
20008 522[ 78] TEXT clr_treebase
20086 600[ 60] TEXT <create_last>
20146 660[ 66] TEXT <create_after>
20212 726[ 66] TEXT <create_before>
20278 792[ 220] TEXT ins_flist
20498 1012[ 8] TEXT new_flist
20506 1020[ 68] TEXT ins_ref
20574 1088[ 124] TEXT new_fixup
20698 1212[ 190] TEXT new_area
20888 1402[ 104] TEXT add_areas
20992 1506[ 660] TEXT <handle_fixups>
21652 2166[ 106] TEXT <add_fixups>
21758 2272[ 122] TEXT <add_names>
21880 2394[ 176] TEXT write_areas
22056 2570[ 114] TEXT <wfixup>
22170 2684[ 232] TEXT <segment_fixup>
22402 2916[ 124] TEXT <write_fixups>
22526 3040[ 242] TEXT <write_names>
22768 3282[ 932] TEXT write_object
4214
in D:\aaaa\common\qmem.o
23700 0[ 106] TEXT CC_qalloc
23806 106[ 78] TEXT init_membase
23884 184[ 32] TEXT free_membase
216
in D:\aaaa\common\amem.o
23916 0[ 18] TEXT CC_xmalloc
23934 18[ 16] TEXT CC_xfree_all
23950 34[ 18] TEXT CC_fmalloc
23968 52[ 16] TEXT CC_ffree_all
68
in D:\aaaa\ahcc\ttp_io.o
23984 0[ 114] TEXT send_msg
24098 114[ 18] TEXT console
132
in D:\aaaa\common\hierarch.o
24116 0[ 28] TEXT strmaxcpy
24144 28[ 52] TEXT DIRcpy
24196 80[ 72] TEXT DIRcat
24268 152[ 150] TEXT inq_xfs
24418 302[ 44] TEXT <hn_issep>
24462 346[ 52] TEXT <hn_strsep>
24514 398[ 62] TEXT <icat>
24576 460[ 32] TEXT <dotdot>
24608 492[ 210] TEXT <hn_new_part>
24818 702[ 50] TEXT <ins_part>
24868 752[ 68] TEXT <remove_part>
24936 820[ 48] TEXT <separators>
24984 868[ 290] TEXT hn_make
25274 1158[ 110] TEXT <count>
25384 1268[ 70] TEXT <do_dd>
25454 1338[ 236] TEXT hn_full
25690 1574[ 90] TEXT hn_free
25780 1664[ 40] TEXT strslash
25820 1704[ 68] TEXT strrslash
25888 1772[ 120] TEXT change_suffix
26008 1892[ 268] TEXT inspad
26276 2160[ 102] TEXT delpad
26378 2262[ 104] TEXT init_dir
2366
in D:\aaaa\common\aaaa_lib.o
26482 0[ 32] TEXT is_alpha
26514 32[ 50] TEXT isfile
26564 82[ 82] TEXT cldbv
26646 164[ 82] TEXT crlf
246
in D:\aaaa\common\ipff.o
26728 0[ 44] TEXT ipff_trail
26772 44[ 114] TEXT ipff_init
26886 158[ 20] TEXT ipff_in
26906 178[ 8] TEXT ipff_getp
26914 186[ 54] TEXT sk
26968 240[ 24] TEXT skc
26992 264[ 28] TEXT sk1
27020 292[ 56] TEXT look
27076 348[ 92] TEXT fstr
440
in d:\CC\lib\ahccstdf.lib
27168 0[ 32] TEXT tolower
27200 32[ 32] TEXT toupper
27232 64[ 26] TEXT isalpha
27258 90[ 26] TEXT isdigit
27284 116[ 26] TEXT islower
27310 142[ 26] TEXT isupper
27336 168[ 194] TEXT <_wqsort>
27530 362[ 194] TEXT <_lqsort>
27724 556[ 446] TEXT <_nqsort>
28170 1002[ 134] TEXT qsort
28304 1136[ 70] TEXT ultoa
28374 1206[ 52] TEXT ltoa
28426 1258[ 16] TEXT itoa
28442 1274[ 76] TEXT <i_f>
28518 1350[ 60] TEXT Init_iob
28578 1410[ 30] TEXT <c_f>
28608 1440[ 94] TEXT Exit_iob
28702 1534[ 346] TEXT
29048 1880[ 116] TEXT fopen
29164 1996[ 46] TEXT lseek
29210 2042[ 156] TEXT <_fflush>
29366 2198[ 106] TEXT fflush
29472 2304[ 130] TEXT fclose
29602 2434[ 90] TEXT
29692 2524[ 534] TEXT _tttty
30226 3058[ 328] TEXT fgetc
30554 3386[ 84] TEXT fgets
30638 3470[ 206] TEXT fputc
30844 3676[ 60] TEXT fputs
30904 3736[ 72] TEXT
30976 3808[ 180] TEXT open
31156 3988[ 24] TEXT close
31180 4012[ 28] TEXT read
31208 4040[ 28] TEXT write
31236 4068[ 178] TEXT <p_round>
31414 4246[ 112] TEXT <is_NaNorInf>
31526 4358[ 176] TEXT <e_print>
31702 4534[ 252] TEXT <f_print>
31954 4786[ 134] TEXT <g_print>
32088 4920[ 202] TEXT <fp_print>
32290 5122[ 326] TEXT
32616 5448[ 1236] TEXT _printf
33852 6684[ 16] TEXT
33868 6700[ 20] TEXT
33888 6720[ 64] TEXT sprintf
33952 6784[ 26] TEXT fprintf
33978 6810[ 26] TEXT vfprintf
34004 6836[ 24] TEXT vprintf
34028 6860[ 274] TEXT <new_block>
34302 7134[ 100] TEXT <free_block>
34402 7234[ 72] TEXT <extract>
34474 7306[ 114] TEXT <find_free>
34588 7420[ 134] TEXT <split>
34722 7554[ 38] TEXT <insfirst>
34760 7592[ 60] TEXT <insbefore>
34820 7652[ 44] TEXT <inslast>
34864 7696[ 62] TEXT <insafter>
34926 7758[ 56] TEXT <amalgam>
34982 7814[ 170] TEXT <sortins>
35152 7984[ 42] TEXT <combine>
35194 8026[ 80] TEXT <XA_round>
35274 8106[ 70] TEXT <in_list>
35344 8176[ 126] TEXT <find_unit>
35470 8302[ 246] TEXT XA_alloc
35716 8548[ 82] TEXT XA_calloc
35798 8630[ 214] TEXT <free_unit>
36012 8844[ 692] TEXT XA_realloc
36704 9536[ 86] TEXT XA_free
36790 9622[ 34] TEXT XA_match
36824 9656[ 160] TEXT XA_free_all
36984 9816[ 152] TEXT XA_set_base
37136 9968[ 14] TEXT malloc
37150 9982[ 10] TEXT free
37160 9992[ 12] TEXT xmalloc
37172 10004[ 14] TEXT xcalloc
37186 10018[ 16] TEXT xrealloc
37202 10034[ 10] TEXT xfree
37212 10044[ 154] TEXT getcwd
37366 10198[ 88] TEXT isatty
37454 10286[ 110] TEXT access
37564 10396[ 12] TEXT
37576 10408[ 26] TEXT clock
37602 10434[ 20] TEXT strcat
37622 10454[ 40] TEXT strcmp
37662 10494[ 78] TEXT stricmp
37740 10572[ 42] TEXT strncmp
37782 10614[ 86] TEXT strnicmp
37868 10700[ 12] TEXT strcpy
37880 10712[ 22] TEXT strncpy
37902 10734[ 14] TEXT strlen
37916 10748[ 42] TEXT strchr
37958 10790[ 40] TEXT strrchr
37998 10830[ 68] TEXT strstr
38066 10898[ 54] TEXT
38120 10952[ 12] TEXT strupr
38132 10964[ 12] TEXT strlwr
38144 10976[ 52] TEXT strrev
38196 11028[ 58] TEXT memmove
38254 11086[ 6] TEXT memcpy
38260 11092[ 18] TEXT memset
38278 11110[ 334] TEXT <Dnorm>
38612 11444[ 134] TEXT <Dunscale>
38746 11578[ 472] TEXT <Dscale>
39218 12050[ 470] TEXT log
39688 12520[ 16] TEXT log10
39704 12536[ 58] TEXT <dmul>
39762 12594[ 380] TEXT <Dtento>
40142 12974[ 16] TEXT pow10
40158 12990[ 368] TEXT ecvt
40526 13358[ 10] TEXT setjmp
40536 13368[ 12] TEXT longjmp
40546 13378 TEXT <L1822>
13380
in d:\CC\lib\ahcstart.o
40548 0[ 26] DATA
40550 2 DATA _argc
40552 4 DATA _argv
40556 8 DATA _envp
40560 12 DATA EmpStr
40562 14 DATA _AtExitVec
40566 18 DATA _FilSysVec
26
in D:\aaaa\shell\shell.o
40574 0[ 44] DATA
40618 44[ 70] DATA
40688 114[ 6] DATA
40694 120[ 34] DATA
40728 154[ 254] DATA
40982 408[ 10] DATA
40992 418[ 62] DATA
41054 480[ 50] DATA
41104 530[ 18] DATA
41122 548[ 94] DATA
41216 642[ 30] DATA
41246 672[ 12] DATA
41246 672 DATA <LTMP>
41258 684[ 36] DATA
41258 684 DATA <ranout>
41294 720[ 2412] DATA
41294 720 DATA filecount
41296 722 DATA high_prj
41298 724 DATA mkpad
41426 852 DATA mkfn
41554 980 DATA depfn
41682 1108 DATA sufs
41760 1186 DATA SHL_cfg
3132
in D:\aaaa\shell\tos_call.o
43706 0[ 14] DATA
43706 0 DATA <_module>
43710 4 DATA <_stackp>
43714 8 DATA <EmpStr>
43716 10 DATA <_savea2>
14
in D:\aaaa\ahcc\cc_load.o
43720 0[ 24] DATA
24
in D:\aaaa\ahcc\ld.o
43744 0[ 4] DATA
43748 4[ 4] DATA
43752 8[ 20] DATA
43772 28[ 22] DATA
43794 50[ 26] DATA
43820 76[ 64] DATA
43884 140[ 46] DATA
43930 186[ 6] DATA
43936 192[ 94] DATA
44030 286[ 118] DATA
44148 404[ 20] DATA
44168 424[ 134] DATA
44302 558[ 256] DATA
44558 814[ 48] DATA
44606 862[ 160] DATA
44766 1022[ 32] DATA
44798 1054[ 4] DATA
44798 1054 DATA <abort_msg>
44802 1058[ 2160] DATA
44802 1058 DATA bugf
44806 1062 DATA stackname
44816 1072 DATA ld_lbl
44818 1074 DATA P
3218
in D:\aaaa\ahcc\ld_ob.o
46962 0[ 4] DATA
46966 4[ 8] DATA
46974 12[ 4] DATA
46978 16[ 28] DATA
47006 44[ 6] DATA
47012 50[ 2] DATA
47014 52[ 96] DATA
47110 148[ 28] DATA
47138 176[ 2] DATA
47140 178[ 2] DATA
47142 180[ 92] DATA
47234 272[ 58] DATA
47234 272 DATA <stack_ob_init>
47292 330[ 8] DATA
47300 338[ 8] DATA
47300 338 DATA <topc>
47308 346[ 8] DATA
47316 354[ 16] DATA
47316 354 DATA vx
370
in D:\aaaa\ahcc\plib.o
47332 0[ 4] DATA
47336 4[ 182] DATA
47518 186[ 4] DATA
47522 190[ 2] DATA
47524 192[ 46] DATA
47570 238[ 20] DATA
47590 258[ 58] DATA
47648 316[ 74] DATA
47722 390[ 18] DATA
47740 408[ 18] DATA
47758 426[ 18] DATA
47776 444[ 144] DATA
47920 588[ 146] DATA
47920 588 DATA <result>
47922 590 DATA <target_txt>
47938 606 DATA <fixnames>
734
in D:\aaaa\common\amem.o
48066 0[ 54] DATA
48120 54[ 120] DATA
48120 54 DATA XA_NS_base
48160 94 DATA XA_CC_base
48200 134 DATA XA_CC_fbase
174
in D:\aaaa\ahcc\ttp_io.o
48240 0[ 2] DATA
2
in D:\aaaa\common\hierarch.o
48242 0[ 2] DATA
48244 2[ 4] DATA
48248 6[ 6] DATA
48254 12[ 6] DATA
48260 18[ 256] DATA
48260 18 DATA idir
48388 146 DATA fsel
274
in D:\aaaa\common\aaaa_lib.o
48516 0[ 4] DATA
4
in D:\aaaa\common\ipff.o
48520 0[ 2] DATA
48522 2[ 272] DATA
48522 2 DATA <stpa>
48778 258 DATA <ln>
48782 262 DATA <xln>
48786 266 DATA <stp>
48790 270 DATA <vul>
48792 272 DATA <snl>
274
in d:\CC\lib\ahccstdf.lib
48794 0[ 512] DATA
48794 0 DATA <_ctype>
49306 512[ 4] DATA
49306 512 DATA _qbuf
49310 516[ 18] DATA
49328 534[ 20] DATA
49348 554[ 72] DATA
49420 626[ 822] DATA
49420 626 DATA _StdInF
49442 648 DATA _StdOutF
49464 670 DATA _StdErrF
49486 692 DATA _StdPrnF
49508 714 DATA _StdAuxF
49530 736 DATA _iob
50234 1440 DATA init_streams
50238 1444 DATA end_streams
50242 1448[ 16] DATA
50258 1464[ 2] DATA
50258 1464 DATA <fixdot>
50260 1466[ 86] DATA
50346 1552[ 16] DATA
50346 1552 DATA NaN
50362 1568[ 2] DATA
50362 1568 DATA _prt_lmode
50364 1570[ 42] DATA
50406 1612[ 164] DATA
50406 1612 DATA XA_heap_base
50446 1652 DATA XA_local_base
50486 1692 DATA XA_file_base
50526 1732 DATA XA_global_base
50566 1772 DATA XA_total
50570 1776[ 8] DATA
50578 1784[ 32] DATA
50578 1784 DATA <zero>
50586 1792 DATA <half>
50594 1800 DATA <one>
50602 1808 DATA <two>
50610 1816[ 96] DATA
50610 1816 DATA <sqrt2>
50618 1824 DATA <pp>
50642 1848 DATA <pq>
50674 1880 DATA <ec1>
50682 1888 DATA <ec2>
50690 1896 DATA <hugexp>
50698 1904 DATA <invln2>
50706 1912[ 64] DATA
50706 1912 DATA <lp>
50730 1936 DATA <lq>
50754 1960 DATA <loge>
50762 1968 DATA <rthalf>
50770 1976[ 72] DATA
50770 1976 DATA <pows>
50842 2048[ 48] DATA
50842 2048 DATA Hugeval
50850 2056 DATA Inf
50858 2064 DATA Nan
50866 2072 DATA Rteps
50874 2080 DATA Xbig
50882 2088 DATA Half
50890 2096[ 16] DATA
2112
in d:\CC\lib\ahcstart.o
50906 0[ 38] BSS
50908 2 BSS _base
50912 6 BSS _BasPag
50916 10 BSS _app
50918 12 BSS errno
50920 14 BSS etext
50924 18 BSS edata
50928 22 BSS ebss
50932 26 BSS _break
50936 30 BSS _StkLim
50940 34 BSS _PgmSize
38
in D:\aaaa\shell\shell.o
50944 0[ 572] BSS
50944 0 BSS pdrive
50946 2 BSS root_project
572
in D:\aaaa\ahcc\ld.o
51516 0[ 12196] BSS
51516 0 BSS <BaseA4>
51520 4 BSS <lreloc>
51524 8 BSS <sttext>
51528 12 BSS <stdata>
51532 16 BSS <stbss>
51536 20 BSS <imgsize>
51540 24 BSS <ex_row>
55576 4060 BSS <gl_row>
59612 8096 BSS <out_row>
63648 12132 BSS <ex_base>
63672 12156 BSS <out_base>
63696 12180 BSS <oname>
63700 12184 BSS <last>
63704 12188 BSS <cmp>
63706 12190 BSS <name_d>
63708 12192 BSS <rname>
63712 12196[ 8] BSS
63712 12196 BSS <eq8>
63716 12200 BSS <gname>
63720 12204[ 12] BSS
63720 12204 BSS <relprev>
63724 12208 BSS <reloc>
63728 12212 BSS <relp>
63732 12216[ 256] BSS
63988 12472[ 116] BSS
63988 12472 BSS <ld_jump>
64104 12588[ 56] BSS
64104 12588 BSS stacksize
64108 12592 BSS flags
64136 12620 BSS gl_base
64160 12644[ 4] BSS
64160 12644 BSS curreloc
12648
in D:\aaaa\ahcc\ld_ob.o
64164 0[ 58] BSS
64164 0 BSS <stack_ob>
64222 58[ 16] BSS
64238 74[ 2] BSS
64238 74 BSS gfa
76
in D:\aaaa\ahcc\plib.o
64240 0[ 4] BSS
64240 0 BSS <last_area>
64244 4[ 168] BSS
64244 4 BSS defmem
64300 60 BSS refmem
64356 116 BSS opndmem
172
in D:\aaaa\common\hierarch.o
64412 0[ 8] BSS
64412 0 BSS <xfsc>
64416 4 BSS <xfst>
64420 8[ 128] BSS
64548 136[ 128] BSS
64676 264[ 514] BSS
64676 264 BSS drive
64678 266 BSS ipath
64806 394 BSS setfn
64934 522 BSS buffn
65062 650 BSS CC_path
778
in D:\aaaa\common\ipff.o
65190 0[ 2] BSS
65190 0 BSS <mc>
2
in d:\CC\lib\ahccstdf.lib
65192 0[ 44] BSS
65192 0 BSS <_dta>
65236 44[ 4] BSS
65240 48[ 34] BSS
65240 48 BSS <buf>
82
in StckSize
0 0[ 8192] OFFS _StkSize
8192

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,8 @@
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("Hello world!\n");
return 0;
}

View File

@@ -0,0 +1,8 @@
; 68020+/Coldfire version using AHCC libraries
hello_cf.tos
.C [-27]
=
ahcstart.o
hello.c
ahccstdf.lib

View File

@@ -0,0 +1,115 @@
/* Copyright (c) 2006 by H. Robbers.
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* This file is invoked by AHCC before any byte is compiled.
Its purpose is a flexible way of handling all kinds of AHCC
specific, mostly non standard, stuff.
The file is read automatically without the need for a #include
*/
/* Aint & Auint are defined such that you will always get 2-byte
ints independent of __INT4__ setting.
It is mainly intended for use with AHCCLIB header files.
AHCCLIB is a 16-bit int library, but you can have a 32-bit
int application.
*/
#ifndef AHCC_RUN_H
#define AHCC_RUN_H
#if __ABC__ || __AHCC__
#define operator __OP__
#define cast __UC__
#if __INT4__
typedef short Aint;
typedef unsigned short Auint;
#else
typedef int Aint;
typedef unsigned int Auint;
#endif
#if __COLDFIRE__
typedef long CFi;
typedef unsigned long CFui;
#else
typedef int CFi;
typedef unsigned int CFui;
#endif
#if (__68020__ || __COLDFIRE__)
#if __LONGLONG__
/* long long stuff; routines in ahcclib\ll.s */
#define ll long long
ll operator + (ll, ll) _lladd; /*  */
ll operator - (ll, ll) _llsub; /*  */
ll operator * (ll, ll) _llmul; /*  */
ll operator / (ll, ll) _lldiv; /*  */
ll operator % (ll, ll) _llmod;
ll operator & (ll, ll) _lland; /*  */
ll operator | (ll, ll) _llor; /*  */
ll operator ^ (ll, ll) _lleor; /*  */
ll operator << (ll, ll) _llshl;
ll operator >> (ll, ll) _llshr;
_Bool operator == (ll, ll) _lleq; /*  */
_Bool operator != (ll, ll) _llne; /*  */
_Bool operator < (ll, ll) _lllt; /*  */
_Bool operator > (ll, ll) _llgt; /*  */
_Bool operator >= (ll, ll) _llge; /*  */
_Bool operator <= (ll, ll) _llle; /*  */
ll operator - (ll) _llneg;
ll cast (char) _b2ll; /*  */
ll cast (unsigned char) _ub2ll; /*  */
ll cast (short) _s2ll; /*  */
ll cast (unsigned short) _us2ll; /*  */
ll cast (long) _l2ll; /*  */
ll cast (unsigned long) _ul2ll; /*  */
ll cast (float) _f2ll;
float cast (ll) _ll2f;
ll cast (double) _d2ll;
double cast(ll) _ll2d;
#undef ll
#endif
#else
/* #message long multiply, mod and divide handled by software */
#define __HAVE_SW_LONG_MUL_DIV__ 1
/* The operands are casted before the existence of these operator
overloads are examined, so the below will suffice. */
unsigned long operator / (unsigned long, unsigned long) _uldiv;
long operator / ( long, long) _ldiv;
unsigned long operator * (unsigned long, unsigned long) _ulmul;
long operator * ( long, long) _lmul;
unsigned long operator % (unsigned long, unsigned long) _ulmod;
long operator % ( long, long) _lmod;
#endif
#undef operator
#undef cast
#endif
#endif

View File

@@ -0,0 +1,763 @@
/* AES.H
GEM AES Definitions
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __AES__ )
#define __AES__
/****** GEMparams *******************************************************/
typedef struct
{
int contrl[15];
int global[15];
int intin[132];
int intout[140];
void *addrin[16];
void *addrout[16];
} GEMPARBLK;
extern GEMPARBLK _GemParBlk;
extern int _app;
typedef struct
{
int *contrl;
int *global;
int *intin;
int *intout;
int *addrin;
int *addrout;
} AESPB;
int vq_aes( void );
void _crystal( AESPB *aespb );
/****** Application definitions *****************************************/
int appl_init( void );
int appl_read( int ap_rid, int ap_rlength, void *ap_rpbuff );
int appl_write( int ap_wid, int ap_wlength, void *ap_wpbuff );
int appl_find( const char *ap_fpname );
int appl_tplay( void *ap_tpmem, int ap_tpnum, int ap_tpscale );
int appl_trecord( void *ap_trmem, int ap_trcount );
int appl_exit( void );
int appl_search( int ap_smode, char *ap_sname, int *ap_stype,
int *ap_sid );
int appl_getinfo( int ap_gtype, int *ap_gout1, int *ap_gout2,
int *ap_gout3, int *ap_gout4 );
/****** Event definitions ***********************************************/
#define MU_KEYBD 0x0001
#define MU_BUTTON 0x0002
#define MU_M1 0x0004
#define MU_M2 0x0008
#define MU_MESAG 0x0010
#define MU_TIMER 0x0020
#define MN_SELECTED 10
#define WM_REDRAW 20
#define WM_TOPPED 21
#define WM_CLOSED 22
#define WM_FULLED 23
#define WM_ARROWED 24
#define WM_HSLID 25
#define WM_VSLID 26
#define WM_SIZED 27
#define WM_MOVED 28
#define WM_NEWTOP 29
#define WM_UNTOPPED 30
#define WM_ONTOP 31
#define WM_UNKNOWN 32 /* AES 4.1 */
#define WM_BACK 33 /* WINX */
#define WM_BOTTOMED 33 /* AES 4.1 */
#define WM_ICONIFY 34 /* AES 4.1 */
#define WM_UNICONIFY 35 /* AES 4.1 */
#define WM_ALLICONIFY 36 /* AES 4.1 */
#define WM_TOOLBAR 37 /* AES 4.1 */
#define AC_OPEN 40
#define AC_CLOSE 41
#define CT_UPDATE 50
#define CT_MOVE 51
#define CT_NEWTOP 52
#define AP_TERM 50
#define AP_TFAIL 51
#define AP_RESCHG 57
#define SHUT_COMPLETED 60
#define RESCHG_COMPLETED 61
#define AP_DRAGDROP 63
#define CH_EXIT 80
/* 06'16 HR: */
#define WM_SHADED 22360
#define WM_UNSHADED 22361
#define FL3DNONE 0x0000
#define FL3DIND 0x0200
#define FL3DBAK 0x0400
#define FL3DACT 0x0600
#define FL3DMASK 0x0600
#define SUBMENU 0x0800
/* Keybord states */
#define K_RSHIFT 0x0001
#define K_LSHIFT 0x0002
#define K_CTRL 0x0004
#define K_ALT 0x0008
typedef struct
{
int m_out;
int m_x;
int m_y;
int m_w;
int m_h;
} MOBLK;
int evnt_keybd( void );
int evnt_button( int ev_bclicks, int ev_bmask, int ev_bstate,
int *ev_bmx, int *ev_bmy, int *ev_bbutton,
int *ev_bkstate );
int evnt_mouse( int ev_moflags, int ev_mox, int ev_moy,
int ev_mowidth, int ev_moheight, int *ev_momx,
int *ev_momy, int *ev_mobutton,
int *ev_mokstate );
int evnt_mesag( int *ev_mgpbuff );
int evnt_timer( int ev_tlocount, int ev_thicount );
int evnt_multi( int ev_mflags, int ev_mbclicks, int ev_mbmask,
int ev_mbstate, int ev_mm1flags, int ev_mm1x,
int ev_mm1y, int ev_mm1width, int ev_mm1height,
int ev_mm2flags, int ev_mm2x, int ev_mm2y,
int ev_mm2width, int ev_mm2height,
int *ev_mmgpbuff, int ev_mtlocount,
int ev_mthicount, int *ev_mmox, int *ev_mmoy,
int *ev_mmbutton, int *ev_mmokstate,
int *ev_mkreturn, int *ev_mbreturn );
int evnt_dclick( int ev_dnew, int ev_dgetset );
/* this is our special invention to increase evnt_multi performance */
typedef struct /* Special type for EventMulti */
{
/* input parameters */
int ev_mflags, ev_mbclicks, ev_bmask, ev_mbstate, ev_mm1flags,
ev_mm1x, ev_mm1y, ev_mm1width, ev_mm1height, ev_mm2flags,
ev_mm2x, ev_mm2y, ev_mm2width, ev_mm2height, ev_mtlocount,
ev_mthicount;
/* output parameters */
int ev_mwich, ev_mmox, ev_mmoy, ev_mmobutton, ev_mmokstate,
ev_mkreturn, ev_mbreturn;
/* message buffer */
int ev_mmgpbuf[8];
} EVENT;
int EvntMulti( EVENT *evnt_struct );
/****** Object definitions **********************************************/
#define G_BOX 20
#define G_TEXT 21
#define G_BOXTEXT 22
#define G_IMAGE 23
#define G_USERDEF 24
#define G_IBOX 25
#define G_BUTTON 26
#define G_BOXCHAR 27
#define G_STRING 28
#define G_FTEXT 29
#define G_FBOXTEXT 30
#define G_ICON 31
#define G_TITLE 32
#define G_CICON 33
#define NO_OBJECT -1
/* Object flags */
#define NONE 0x0000
#define SELECTABLE 0x0001
#define DEFAULT 0x0002
#define EXIT 0x0004
#define EDITABLE 0x0008
#define RBUTTON 0x0010
#define LASTOB 0x0020
#define TOUCHEXIT 0x0040
#define HIDETREE 0x0080
#define INDIRECT 0x0100
/* Object states */
#define NORMAL 0x00
#define SELECTED 0x01
#define CROSSED 0x02
#define CHECKED 0x04
#define DISABLED 0x08
#define OUTLINED 0x10
#define SHADOWED 0x20
/* Object colors */
#if !defined(__COLORS)
#define __COLORS /* using AES-colors and BGI-colors
is not possible
*/
#define WHITE 0
#define BLACK 1
#define RED 2
#define GREEN 3
#define BLUE 4
#define CYAN 5
#define YELLOW 6
#define MAGENTA 7
#define LWHITE 8
#define LBLACK 9
#define LRED 10
#define LGREEN 11
#define LBLUE 12
#define LCYAN 13
#define LYELLOW 14
#define LMAGENTA 15
#endif
#define ROOT 0
#define MAX_LEN 81 /* max string length */
#define MAX_DEPTH 8 /* max depth of search or draw */
#define IBM 3 /* font types */
#define SMALL 5
#define ED_START 0 /* editable text field definitions */
#define ED_INIT 1
#define ED_CHAR 2
#define ED_END 3
#define TE_LEFT 0 /* editable text justification */
#define TE_RIGHT 1
#define TE_CNTR 2
typedef struct orect
{
struct orect *o_link;
int o_x;
int o_y;
int o_w;
int o_h;
} ORECT;
typedef struct
{
int g_x;
int g_y;
int g_w;
int g_h;
} GRECT;
typedef struct
{
int x;
int y;
int w;
int h;
} RECT;
/* Object structures */
typedef struct
{
char *te_ptext; /* ptr to text (must be 1st) */
char *te_ptmplt; /* ptr to template */
char *te_pvalid; /* ptr to validation */
int te_font; /* font */
int te_junk1; /* junk int */
int te_just; /* justification: left, right...*/
int te_color; /* color information */
int te_junk2; /* junk int */
int te_thickness; /* border thickness */
int te_txtlen; /* text string length */
int te_tmplen; /* template string length */
} TEDINFO;
typedef struct
{
int *ib_pmask;
int *ib_pdata;
char *ib_ptext;
int ib_char;
int ib_xchar;
int ib_ychar;
int ib_xicon;
int ib_yicon;
int ib_wicon;
int ib_hicon;
int ib_xtext;
int ib_ytext;
int ib_wtext;
int ib_htext;
} ICONBLK;
typedef struct cicon_data
{
int num_planes;
int *col_data;
int *col_mask;
int *sel_data;
int *sel_mask;
struct cicon_data *next_res;
} CICON;
typedef struct cicon_blk
{
ICONBLK monoblk;
CICON *mainlist;
} CICONBLK;
typedef struct
{
int *bi_pdata; /* ptr to bit forms data */
int bi_wb; /* width of form in bytes */
int bi_hl; /* height in lines */
int bi_x; /* source x in bit form */
int bi_y; /* source y in bit form */
int bi_color; /* foreground color */
} BITBLK;
struct __parmblk;
#ifndef __STDC__ /*
* using this structure is not possible
* if ANSI keywords only is ON
*/
typedef struct
{
int cdecl (*ub_code)(struct __parmblk *parmblock);
long ub_parm;
} USERBLK;
#endif
typedef struct
{
unsigned character : 8;
signed framesize : 8;
unsigned framecol : 4;
unsigned textcol : 4;
unsigned textmode : 1;
unsigned fillpattern : 3;
unsigned interiorcol : 4;
} bfobspec;
typedef union obspecptr
{
long index;
union obspecptr *indirect;
bfobspec obspec;
TEDINFO *tedinfo;
ICONBLK *iconblk;
CICONBLK *ciconblk;
BITBLK *bitblk;
#ifndef __STDC__
USERBLK *userblk;
#endif
char *free_string;
} OBSPEC;
typedef struct
{
int ob_next; /* -> object's next sibling */
int ob_head; /* -> head of object's children */
int ob_tail; /* -> tail of object's children */
unsigned int ob_type; /* object type: BOX, CHAR,... */
unsigned int ob_flags; /* object flags */
unsigned int ob_state; /* state: SELECTED, OPEN, ... */
OBSPEC ob_spec; /* "out": -> anything else */
int ob_x; /* upper left corner of object */
int ob_y; /* upper left corner of object */
int ob_width; /* object width */
int ob_height; /* object height */
} OBJECT;
typedef struct __parmblk
{
OBJECT *pb_tree;
int pb_obj;
int pb_prevstate;
int pb_currstate;
int pb_x, pb_y, pb_w, pb_h;
int pb_xc, pb_yc, pb_wc, pb_hc;
long pb_parm;
} PARMBLK;
typedef struct
{
OBJECT *mn_tree;
int mn_menu;
int mn_item;
int mn_scroll;
int mn_keystate;
} MENU;
typedef struct
{
long Display;
long Drag;
long Delay;
long Speed;
int Height;
} MN_SET;
/****** Menu definitions ************************************************/
int menu_bar( OBJECT *me_btree, int me_bshow );
int menu_icheck( OBJECT *me_ctree, int me_citem, int me_ccheck );
int menu_ienable( OBJECT *me_etree, int me_eitem,
int me_eenable );
int menu_tnormal( OBJECT *me_ntree, int me_ntitle,
int me_nnormal );
int menu_text( OBJECT *me_ttree, int me_titem,
const char *me_ttext );
int menu_register( int me_rapid, const char *me_rpstring );
int menu_popup( MENU *me_menu, int me_xpos, int me_ypos,
MENU *me_mdata );
int menu_attach( int me_flag, OBJECT *me_tree, int me_item,
MENU *me_mdata );
int menu_istart( int me_flag, OBJECT *me_tree, int me_imenu,
int me_item );
int menu_settings( int me_flag, MN_SET *me_values );
/* Object prototypes */
int objc_add( OBJECT *ob_atree, int ob_aparent, int ob_achild );
int objc_delete( OBJECT *ob_dltree, int ob_dlobject );
int objc_draw( OBJECT *ob_drtree, int ob_drstartob,
int ob_drdepth, int ob_drxclip, int ob_dryclip,
int ob_drwclip, int ob_drhclip );
int objc_find( OBJECT *ob_ftree, int ob_fstartob, int ob_fdepth,
int ob_fmx, int ob_fmy );
int objc_offset( OBJECT *ob_oftree, int ob_ofobject,
int *ob_ofxoff, int *ob_ofyoff );
int objc_order( OBJECT *ob_ortree, int ob_orobject,
int ob_ornewpos );
int objc_edit( OBJECT *ob_edtree, int ob_edobject,
int ob_edchar, int *ob_edidx, int ob_edkind );
int objc_change( OBJECT *ob_ctree, int ob_cobject,
int ob_cresvd, int ob_cxclip, int ob_cyclip,
int ob_cwclip, int ob_chclip,
int ob_cnewstate, int ob_credraw );
/****** Form definitions ************************************************/
#define FMD_START 0
#define FMD_GROW 1
#define FMD_SHRINK 2
#define FMD_FINISH 3
int form_do( OBJECT *fo_dotree, int fo_dostartob );
int form_dial( int fo_diflag, int fo_dilittlx,
int fo_dilittly, int fo_dilittlw,
int fo_dilittlh, int fo_dibigx,
int fo_dibigy, int fo_dibigw, int fo_dibigh );
int form_alert( int fo_adefbttn, const char *fo_astring );
int form_error( int fo_enum );
int form_center( OBJECT *fo_ctree, int *fo_cx, int *fo_cy,
int *fo_cw, int *fo_ch );
int form_keybd( OBJECT *fo_ktree, int fo_kobject, int fo_kobnext,
int fo_kchar, int *fo_knxtobject, int *fo_knxtchar );
int form_button( OBJECT *fo_btree, int fo_bobject, int fo_bclicks,
int *fo_bnxtobj );
/****** Graph definitions ************************************************/
/* Mouse forms */
#define ARROW 0
#define TEXT_CRSR 1
#define HOURGLASS 2
#define BUSYBEE 2
#define POINT_HAND 3
#define FLAT_HAND 4
#define THIN_CROSS 5
#define THICK_CROSS 6
#define OUTLN_CROSS 7
#define USER_DEF 255
#define M_OFF 256
#define M_ON 257
/* Mouse form definition block */
typedef struct mfstr
{
int mf_xhot;
int mf_yhot;
int mf_nplanes;
int mf_fg;
int mf_bg;
int mf_mask[16];
int mf_data[16];
} MFORM;
int graf_rubberbox( int gr_rx, int gr_ry, int gr_minwidth,
int gr_minheight, int *gr_rlastwidth,
int *gr_rlastheight );
int graf_rubbox( int gr_rx, int gr_ry, int gr_minwidth,
int gr_minheight, int *gr_rlastwidth,
int *gr_rlastheight );
int graf_dragbox( int gr_dwidth, int gr_dheight,
int gr_dstartx, int gr_dstarty,
int gr_dboundx, int gr_dboundy,
int gr_dboundw, int gr_dboundh,
int *gr_dfinishx, int *gr_dfinishy );
int graf_movebox( int gr_mwidth, int gr_mheight,
int gr_msourcex, int gr_msourcey,
int gr_mdestx, int gr_mdesty );
int graf_mbox( int gr_mwidth, int gr_mheight,
int gr_msourcex, int gr_msourcey,
int gr_mdestx, int gr_mdesty );
int graf_growbox( int gr_gstx, int gr_gsty,
int gr_gstwidth, int gr_gstheight,
int gr_gfinx, int gr_gfiny,
int gr_gfinwidth, int gr_gfinheight );
int graf_shrinkbox( int gr_sfinx, int gr_sfiny,
int gr_sfinwidth, int gr_sfinheight,
int gr_sstx, int gr_ssty,
int gr_sstwidth, int gr_sstheight );
int graf_watchbox( OBJECT *gr_wptree, int gr_wobject,
int gr_winstate, int gr_woutstate );
int graf_slidebox( OBJECT *gr_slptree, int gr_slparent,
int gr_slobject, int gr_slvh );
int graf_handle( int *gr_hwchar, int *gr_hhchar,
int *gr_hwbox, int *gr_hhbox );
int graf_mouse( int gr_monumber, MFORM *gr_mofaddr );
int graf_mkstate( int *gr_mkmx, int *gr_mkmy,
int *gr_mkmstate, int *gr_mkkstate );
/****** Scrap definitions ***********************************************/
int scrp_read( char *sc_rpscrap );
int scrp_write( char *sc_wpscrap );
/****** File selector definitions ***************************************/
int fsel_input( char *fs_iinpath, char *fs_iinsel,
int *fs_iexbutton );
int fsel_exinput( char *fs_einpath, char *fs_einsel,
int *fs_eexbutton, char *fs_elabel );
int fsel_boxinput( char *fs_einpath, char *fs_einsel,
int *fs_eexbutton, char *fs_elabel, void *call );
/****** Window definitions **********************************************/
#define NAME 0x0001
#define CLOSER 0x0002
#define FULLER 0x0004
#define MOVER 0x0008
#define INFO 0x0010
#define SIZER 0x0020
#define UPARROW 0x0040
#define DNARROW 0x0080
#define VSLIDE 0x0100
#define LFARROW 0x0200
#define RTARROW 0x0400
#define HSLIDE 0x0800
#define MENUBAR 0x1000 /* XaAES */
#define BACKDROP 0x2000 /* KAOS 1.4 */
#define ICONIFIER 0x4000 /* AES 4.1 */
#define SMALLER ICONIFIER
#define WF_KIND 1
#define WF_NAME 2
#define WF_INFO 3
#define WF_WORKXYWH 4
#define WF_CURRXYWH 5
#define WF_PREVXYWH 6
#define WF_FULLXYWH 7
#define WF_HSLIDE 8
#define WF_VSLIDE 9
#define WF_TOP 10
#define WF_FIRSTXYWH 11
#define WF_NEXTXYWH 12
#define WF_RESVD 13
#define WF_NEWDESK 14
#define WF_HSLSIZE 15
#define WF_VSLSIZE 16
#define WF_SCREEN 17
#define WF_COLOR 18
#define WF_DCOLOR 19
#define WF_OWNER 20
#define WF_BEVENT 24
#define WF_BOTTOM 25
#define WF_ICONIFY 26 /* AES 4.1 */
#define WF_UNICONIFY 27 /* AES 4.1 */
#define WF_UNICONIFYXYWH 28 /* AES 4.1 */
#define WF_TOOLBAR 30 /* compatible */
#define WF_FTOOLBAR 31
#define WF_NTOOLBAR 32
#define WF_MENU 33
#define WF_WIDGET 34
#define WF_WHEEL 40
#define WF_M_BACKDROP 100 /* KAOS 1.4 */
#define WF_M_OWNER 101 /* KAOS 1.4 */
#define WF_M_WINDLIS 102 /* KAOS 1.4 */
#define WF_SHADE 0x575d /* WINX 2.3 */
#define WF_STACK 0x575e /* WINX 2.3 */
#define WF_TOPALL 0x575f /* WINX 2.3 */
#define WF_BOTTOMALL 0x5760 /* WINX 2.3 */
#define W_BOX 0
#define W_TITLE 1
#define W_CLOSER 2
#define W_NAME 3
#define W_FULLER 4
#define W_INFO 5
#define W_DATA 6
#define W_WORK 7
#define W_SIZER 8
#define W_VBAR 9
#define W_UPARROW 10
#define W_DNARROW 11
#define W_VSLIDE 12
#define W_VELEV 13
#define W_HBAR 14
#define W_LFARROW 15
#define W_RTARROW 16
#define W_HSLIDE 17
#define W_HELEV 18
#define WA_UPPAGE 0
#define WA_DNPAGE 1
#define WA_UPLINE 2
#define WA_DNLINE 3
#define WA_LFPAGE 4
#define WA_RTPAGE 5
#define WA_LFLINE 6
#define WA_RTLINE 7
#define WC_BORDER 0 /* wind calc flags */
#define WC_WORK 1
#define END_UPDATE 0 /* update flags */
#define BEG_UPDATE 1
#define END_MCTRL 2
#define BEG_MCTRL 3
int wind_create( int wi_crkind, int wi_crwx, int wi_crwy,
int wi_crww, int wi_crwh );
int wind_open( int wi_ohandle, int wi_owx, int wi_owy,
int wi_oww, int wi_owh );
int wind_close( int wi_clhandle );
int wind_delete( int wi_dhandle );
int wind_get( int wi_ghandle, int wi_gfield, ... );
int wind_set( int wi_shandle, int wi_sfield, ... );
int wind_find( int wi_fmx, int wi_fmy );
int wind_update( int wi_ubegend );
int wind_calc( int wi_ctype, int wi_ckind, int wi_cinx,
int wi_ciny, int wi_cinw, int wi_cinh,
int *coutx, int *couty, int *coutw,
int *couth );
void wind_new( void );
/****** Resource definitions ********************************************/
/* data structure types */
#define R_TREE 0
#define R_OBJECT 1
#define R_TEDINFO 2
#define R_ICONBLK 3
#define R_BITBLK 4
#define R_STRING 5 /* gets pointer to free strings */
#define R_IMAGEDATA 6 /* gets pointer to free images */
#define R_OBSPEC 7
#define R_TEPTEXT 8 /* sub ptrs in TEDINFO */
#define R_TEPTMPLT 9
#define R_TEPVALID 10
#define R_IBPMASK 11 /* sub ptrs in ICONBLK */
#define R_IBPDATA 12
#define R_IPBTEXT 13
#define R_BIPDATA 14 /* sub ptrs in BITBLK */
#define R_FRSTR 15 /* gets addr of ptr to free strings */
#define R_FRIMG 16 /* gets addr of ptr to free images */
typedef struct rshdr
{
unsigned rsh_vrsn;
unsigned rsh_object;
unsigned rsh_tedinfo;
unsigned rsh_iconblk; /* list of ICONBLKS */
unsigned rsh_bitblk;
unsigned rsh_frstr;
unsigned rsh_string;
unsigned rsh_imdata; /* image data */
unsigned rsh_frimg;
unsigned rsh_trindex;
unsigned rsh_nobs; /* counts of various structs */
unsigned rsh_ntree;
unsigned rsh_nted;
unsigned rsh_nib;
unsigned rsh_nbb;
unsigned rsh_nstring;
unsigned rsh_nimages;
unsigned rsh_rssize; /* total bytes in resource */
} RSHDR;
int rsrc_load( const char *re_lpfname );
int rsrc_free( void );
int rsrc_gaddr( int re_gtype, int re_gindex, void *gaddr );
int rsrc_saddr( int re_stype, int re_sindex, void *saddr );
int rsrc_obfix( OBJECT *re_otree, int re_oobject );
int rsrc_rcfix( RSHDR *rc_header );
/****** Shell definitions ***********************************************/
int shel_read( char *sh_rpcmd, char *sh_rptail );
int shel_write( int sh_wdoex, int sh_wisgr, int sh_wiscr,
char *sh_wpcmd, char *sh_wptail );
int shel_get( char *sh_gaddr, int sh_glen );
int shel_put( char *sh_paddr, int sh_plen );
int shel_find( char *sh_fpbuff );
int shel_envrn( char **sh_epvalue, char *sh_eparm );
#endif
/************************************************************************/

View File

@@ -0,0 +1,117 @@
/* Copyright (c) 2006 by H. Robbers.
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* This file is invoked by AHCC before any byte is compiled.
Its purpose is a flexible way of handling all kinds of AHCC
specific, mostly non standard, stuff.
The file is read automatically without the need for a #include
*/
/* Aint & Auint are defined such that you will always get 2-byte
ints independent of __INT4__ setting.
It is mainly intended for use with AHCCLIB header files.
AHCCLIB is a 16-bit int library, but you can have a 32-bit
int application.
*/
#ifndef AHCC_RUN_H
#define AHCC_RUN_H
#if __ABC__ || __AHCC__
#define operator __OP__
#define cast __UC__
#if __INT4__
typedef short Aint;
typedef unsigned short Auint;
#else
typedef int Aint;
typedef unsigned int Auint;
#endif
#if __COLDFIRE__
typedef long CFi;
typedef unsigned long CFui;
#else
typedef int CFi;
typedef unsigned int CFui;
#endif
#if (__68020__ || __COLDFIRE__)
#if __LONGLONG__
/* long long stuff; routines in ahcclib\ll.s */
#define ll long long
ll operator + (ll, ll) _lladd; /*  */
ll operator - (ll, ll) _llsub; /*  */
ll operator * (ll, ll) _llmul; /*  */
ll operator / (ll, ll) _lldiv; /*  */
ll operator % (ll, ll) _llmod;
ll operator & (ll, ll) _lland; /*  */
ll operator | (ll, ll) _llor; /*  */
ll operator ^ (ll, ll) _lleor; /*  */
ll operator << (ll, ll) _llshl;
ll operator >> (ll, ll) _llshr;
_Bool operator == (ll, ll) _lleq; /*  */
_Bool operator != (ll, ll) _llne; /*  */
_Bool operator < (ll, ll) _lllt; /*  */
_Bool operator > (ll, ll) _llgt; /*  */
_Bool operator >= (ll, ll) _llge; /*  */
_Bool operator <= (ll, ll) _llle; /*  */
ll operator - (ll) _llneg;
ll cast (char) _b2ll; /*  */
ll cast (unsigned char) _ub2ll; /*  */
ll cast (short) _s2ll; /*  */
ll cast (unsigned short) _us2ll; /*  */
ll cast (long) _l2ll; /*  */
ll cast (unsigned long) _ul2ll; /*  */
ll cast (float) _f2ll;
float cast (ll) _ll2f;
ll cast (double) _d2ll;
double cast(ll) _ll2d;
#undef ll
#endif
#else
/* #message long multiply, mod and divide handled by software */
#define __HAVE_SW_LONG_MUL_DIV__ 1
/* The operands are casted before the existence of these operator
overloads are examined, so the below will suffice. */
unsigned long operator / (unsigned long, unsigned long) _uldiv;
long operator / ( long, long) _ldiv;
unsigned long operator * (unsigned long, unsigned long) _ulmul;
long operator * ( long, long) _lmul;
unsigned long operator % (unsigned long, unsigned long) _ulmod;
long operator % ( long, long) _lmod;
#endif
#undef operator
#undef cast
#endif
typedef void VpV(void);
#endif

View File

@@ -0,0 +1,117 @@
/* Copyright (c) 2006 by H. Robbers.
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* This file is invoked by AHCC before any byte is compiled.
Its purpose is a flexible way of handling all kinds of AHCC
specific, mostly non standard, stuff.
The file is read automatically without the need for a #include
*/
/* Aint & Auint are defined such that you will always get 2-byte
ints independent of __INT4__ setting.
It is mainly intended for use with AHCCLIB header files.
AHCCLIB is a 16-bit int library, but you can have a 32-bit
int application.
*/
#ifndef AHCC_RUN_H
#define AHCC_RUN_H
#if __ABC__ || __AHCC__
#define operator __OP__
#define cast __UC__
#if __INT4__
typedef short Aint;
typedef unsigned short Auint;
#else
typedef int Aint;
typedef unsigned int Auint;
#endif
#if __COLDFIRE__
typedef long CFi;
typedef unsigned long CFui;
#else
typedef int CFi;
typedef unsigned int CFui;
#endif
#if (__68020__ || __COLDFIRE__)
#if __LONGLONG__
/* long long stuff; routines in ahcclib\ll.s */
#define ll long long
ll operator + (ll, ll) _lladd; /*  */
ll operator - (ll, ll) _llsub; /*  */
ll operator * (ll, ll) _llmul; /*  */
ll operator / (ll, ll) _lldiv; /*  */
ll operator % (ll, ll) _llmod;
ll operator & (ll, ll) _lland; /*  */
ll operator | (ll, ll) _llor; /*  */
ll operator ^ (ll, ll) _lleor; /*  */
ll operator << (ll, ll) _llshl;
ll operator >> (ll, ll) _llshr;
_Bool operator == (ll, ll) _lleq; /*  */
_Bool operator != (ll, ll) _llne; /*  */
_Bool operator < (ll, ll) _lllt; /*  */
_Bool operator > (ll, ll) _llgt; /*  */
_Bool operator >= (ll, ll) _llge; /*  */
_Bool operator <= (ll, ll) _llle; /*  */
ll operator - (ll) _llneg;
ll cast (char) _b2ll; /*  */
ll cast (unsigned char) _ub2ll; /*  */
ll cast (short) _s2ll; /*  */
ll cast (unsigned short) _us2ll; /*  */
ll cast (long) _l2ll; /*  */
ll cast (unsigned long) _ul2ll; /*  */
ll cast (float) _f2ll;
float cast (ll) _ll2f;
ll cast (double) _d2ll;
double cast(ll) _ll2d;
#undef ll
#endif
#else
/* #message long multiply, mod and divide handled by software */
#define __HAVE_SW_LONG_MUL_DIV__ 1
/* The operands are casted before the existence of these operator
overloads are examined, so the below will suffice. */
unsigned long operator / (unsigned long, unsigned long) _uldiv;
long operator / ( long, long) _ldiv;
unsigned long operator * (unsigned long, unsigned long) _ulmul;
long operator * ( long, long) _lmul;
unsigned long operator % (unsigned long, unsigned long) _ulmod;
long operator % ( long, long) _lmod;
#endif
#undef operator
#undef cast
#endif
typedef void VpV(void);
#endif

View File

@@ -0,0 +1,117 @@
/* Copyright (c) 2006 by H. Robbers.
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* This file is invoked by AHCC before any byte is compiled.
Its purpose is a flexible way of handling all kinds of AHCC
specific, mostly non standard, stuff.
The file is read automatically without the need for a #include
*/
/* Aint & Auint are defined such that you will always get 2-byte
ints independent of __INT4__ setting.
It is mainly intended for use with AHCCLIB header files.
AHCCLIB is a 16-bit int library, but you can have a 32-bit
int application.
*/
#ifndef AHCC_RUN_H
#define AHCC_RUN_H
#if __ABC__ || __AHCC__
#define operator __OP__
#define cast __UC__
#if __INT4__
typedef short Aint;
typedef unsigned short Auint;
#else
typedef int Aint;
typedef unsigned int Auint;
#endif
#if __COLDFIRE__
typedef long CFi;
typedef unsigned long CFui;
#else
typedef int CFi;
typedef unsigned int CFui;
#endif
#if (__68020__ || __COLDFIRE__)
#if __LONGLONG__
/* long long stuff; routines in ahcclib\ll.s */
#define ll long long
ll operator + (ll, ll) _lladd; /*  */
ll operator - (ll, ll) _llsub; /*  */
ll operator * (ll, ll) _llmul; /*  */
ll operator / (ll, ll) _lldiv; /*  */
ll operator % (ll, ll) _llmod;
ll operator & (ll, ll) _lland; /*  */
ll operator | (ll, ll) _llor; /*  */
ll operator ^ (ll, ll) _lleor; /*  */
ll operator << (ll, ll) _llshl;
ll operator >> (ll, ll) _llshr;
_Bool operator == (ll, ll) _lleq; /*  */
_Bool operator != (ll, ll) _llne; /*  */
_Bool operator < (ll, ll) _lllt; /*  */
_Bool operator > (ll, ll) _llgt; /*  */
_Bool operator >= (ll, ll) _llge; /*  */
_Bool operator <= (ll, ll) _llle; /*  */
ll operator - (ll) _llneg;
ll cast (char) _b2ll; /*  */
ll cast (unsigned char) _ub2ll; /*  */
ll cast (short) _s2ll; /*  */
ll cast (unsigned short) _us2ll; /*  */
ll cast (long) _l2ll; /*  */
ll cast (unsigned long) _ul2ll; /*  */
ll cast (float) _f2ll;
float cast (ll) _ll2f;
ll cast (double) _d2ll;
double cast(ll) _ll2d;
#undef ll
#endif
#else
/* #message long multiply, mod and divide handled by software */
#define __HAVE_SW_LONG_MUL_DIV__ 1
/* The operands are casted before the existence of these operator
overloads are examined, so the below will suffice. */
unsigned long operator / (unsigned long, unsigned long) _uldiv;
long operator / ( long, long) _ldiv;
unsigned long operator * (unsigned long, unsigned long) _ulmul;
long operator * ( long, long) _lmul;
unsigned long operator % (unsigned long, unsigned long) _ulmod;
long operator % ( long, long) _lmod;
#endif
#undef operator
#undef cast
#endif
typedef void VpV(void);
#endif

View File

@@ -0,0 +1,117 @@
/* Copyright (c) 2006 by H. Robbers.
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* This file is invoked by AHCC before any byte is compiled.
Its purpose is a flexible way of handling all kinds of AHCC
specific, mostly non standard, stuff.
The file is read automatically without the need for a #include
*/
/* Aint & Auint are defined such that you will always get 2-byte
ints independent of __INT4__ setting.
It is mainly intended for use with AHCCLIB header files.
AHCCLIB is a 16-bit int library, but you can have a 32-bit
int application.
*/
#ifndef AHCC_RUN_H
#define AHCC_RUN_H
#if __ABC__ || __AHCC__
#define operator __OP__
#define cast __UC__
#if __INT4__
typedef short Aint;
typedef unsigned short Auint;
#else
typedef int Aint;
typedef unsigned int Auint;
#endif
#if __COLDFIRE__
typedef long CFi;
typedef unsigned long CFui;
#else
typedef int CFi;
typedef unsigned int CFui;
#endif
#if (__68020__ || __COLDFIRE__)
#if __LONGLONG__
/* long long stuff; routines in ahcclib\ll.s */
#define ll long long
ll operator + (ll, ll) _lladd; /*  */
ll operator - (ll, ll) _llsub; /*  */
ll operator * (ll, ll) _llmul; /*  */
ll operator / (ll, ll) _lldiv; /*  */
ll operator % (ll, ll) _llmod;
ll operator & (ll, ll) _lland; /*  */
ll operator | (ll, ll) _llor; /*  */
ll operator ^ (ll, ll) _lleor; /*  */
ll operator << (ll, ll) _llshl;
ll operator >> (ll, ll) _llshr;
_Bool operator == (ll, ll) _lleq; /*  */
_Bool operator != (ll, ll) _llne; /*  */
_Bool operator < (ll, ll) _lllt; /*  */
_Bool operator > (ll, ll) _llgt; /*  */
_Bool operator >= (ll, ll) _llge; /*  */
_Bool operator <= (ll, ll) _llle; /*  */
ll operator - (ll) _llneg;
ll cast (char) _b2ll; /*  */
ll cast (unsigned char) _ub2ll; /*  */
ll cast (short) _s2ll; /*  */
ll cast (unsigned short) _us2ll; /*  */
ll cast (long) _l2ll; /*  */
ll cast (unsigned long) _ul2ll; /*  */
ll cast (float) _f2ll;
float cast (ll) _ll2f;
ll cast (double) _d2ll;
double cast(ll) _ll2d;
#undef ll
#endif
#else
/* #message long multiply, mod and divide handled by software */
#define __HAVE_SW_LONG_MUL_DIV__ 1
/* The operands are casted before the existence of these operator
overloads are examined, so the below will suffice. */
unsigned long operator / (unsigned long, unsigned long) _uldiv;
long operator / ( long, long) _ldiv;
unsigned long operator * (unsigned long, unsigned long) _ulmul;
long operator * ( long, long) _lmul;
unsigned long operator % (unsigned long, unsigned long) _ulmod;
long operator % ( long, long) _lmod;
#endif
#undef operator
#undef cast
#endif
typedef void VpV(void);
#endif

View File

@@ -0,0 +1,158 @@
/* Copyright (c) 2001 - present by Henk Robbers @ Amsterdam
*
* This file is part of AHCM. A Home Cooked Memory allocator.
*
* AHCM is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCM; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Thread safe and debug friendly memory allocator
*/
#ifdef _XA_MEMORY_H
#pragma if_endfile /* AHCC: perform #endif and abandon file immediately */
/* there is also if_endcomp and if_endmake, + the equivalents without if_ */
#else
#define _XA_MEMORY_H
#include <prelude.h>
#include <stdlib.h> /* size_t */
#define XA_lib_replace 1
typedef int XA_key;
/* size must be multiple of 4 */
typedef struct xa_unit
{
long size; /* MUST be in front and include unitprefix !! */
struct xa_unit *next,*prior;
XA_key key,
ty;
char area[0];
} XA_unit;
typedef struct xa_list
{
XA_unit *first, *cur, *last;
} XA_list;
/* size must be multiple of 4 */
typedef struct xa_block /* These are the big ones, at least 8K */
{
long size; /* MUST be in front and include blockprefix!! */
long magic;
struct xa_block *next, *prior;
XA_list used, free;
int mode, filler;
XA_unit area[0];
} XA_block;
#undef MX_STRAM
#undef MX_TTRAM
#undef MX_PREFSTRAM
#undef MX_PREFTTRAM
#undef MX_HEADER
#undef MX_PRIVATE
#undef MX_GLOBAL
#undef MX_SUPERVISOR
#undef MX_READABLE
enum
{
MX_STRAM = 0,
MX_TTRAM = 1,
MX_PREFSTRAM = 2,
MX_PREFTTRAM = 3,
MX_HEADER = (1 << 3),
MX_PRIVATE = ((1 << 3) | (1 << 4)),
MX_GLOBAL = ((1 << 3) | (2 << 4)),
MX_SUPERVISOR= ((1 << 3) | (3 << 4)),
MX_READABLE = ((1 << 3) | (4 << 4))
};
#define XA_LOCAL 1 /* base is defined in local memory */
typedef struct xa_memory XA_memory;
typedef void XA_report(XA_memory *base, XA_block *blk, XA_unit *unit, char *txt, int nr);
typedef int XA_run_out(XA_memory *base, XA_key xkey, XA_key xtype);
struct xa_memory
{
XA_block *first, *last, *cur; /* No free pointer here, blocks that
become free are returned to GEMDOS */
long chunk;
int round,
flags,
mode,
stack;
XA_run_out *runout, /* default out of memory function */
*ranout; /* transient out of memory function */
char *name;
long allocated;
};
extern XA_memory XA_heap_base, XA_local_base, XA_file_base, XA_global_base;
void XA_set_base (XA_memory *base, size_t chunk, int round, int mode, XA_run_out *runout, char *name);
void * XA_alloc (XA_memory *base, size_t amount, XA_run_out *ranout, XA_key , XA_key );
void * XA_calloc (XA_memory *base, size_t items, size_t chunk, XA_run_out *ranout, XA_key , XA_key );
void * XA_realloc (XA_memory *base, void *area, size_t size, XA_run_out *ranout, XA_key , XA_key );
bool XA_free (XA_memory *base, void *area);
void XA_free_all (XA_memory *base, XA_key , XA_key );
void XA_up (XA_memory *base);
void * XA_new (XA_memory *base, size_t size, XA_key key);
void XA_down (XA_memory *base);
bool XA_leaked (XA_memory *base, XA_key , XA_key , XA_report *report, int nr);
void XA_sanity (XA_memory *base, XA_report *report, int nr);
void XA_list_free(XA_memory *base, XA_report *report);
#if XA_lib_replace
/* The below are wrapper functions and do the same
as the macros further below.
You can find them in ahcm.c
By having these functions in ahcm.c
existing library functions are completely replaced.
*/
void *calloc(size_t n, size_t sz);
void *malloc(size_t size);
void *realloc(void *, size_t);
void free(void *);
void _FreeAll(void);
#else
/* In this case, only files that include ahcm.h
invoke AHCM. Other objects are not affected.
Calls to standard C malloc in libraries are not
replaced.
*/
#define calloc(n,l) XA_calloc(nil, (n), (l), nil, 0, 0)
#define malloc(l) XA_alloc (nil, (l), nil, 0, 0)
#define realloc(p,l) XA_realloc(nil, (p), (l), nil, 0, 0)
#define free(a) XA_free (nil, (a), 0)
#define _freeAll() XA_free_all(nil, -1, -1)
#endif
#define unitprefix sizeof(XA_unit)
#define blockprefix sizeof(XA_block)
#define XA_MAGIC 0xf1e2d3c4
void *xmalloc (size_t, XA_key);
void *xcalloc (size_t items, size_t chunk, XA_key key);
void *xrealloc (void *old, size_t size, XA_key key);
void xfree (void *);
void *fmalloc (size_t, XA_key);
void *fcalloc (size_t items, size_t chunk, XA_key key);
void *frealloc (void *old, size_t size, XA_key key);
void ffree (void *);
#endif

View File

@@ -0,0 +1,39 @@
/* ASSERT.H
Diagnostic Includes
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __ASSERT )
#define __ASSERT
#if !defined(NDEBUG)
#if !defined(__STDLIB)
#include <stdlib.h>
#endif
#if !defined( __STDIO )
#include <stdio.h>
#endif
#define assert( expr )\
((void)((expr)||(fprintf( stderr, \
"\nAssertion failed: %s, file %s, line %d\n",\
#expr, __FILE__, __LINE__ ),\
((int (*)(void))abort)())))
#else
#define assert( expr )
#endif
#endif
/************************************************************************/


View File

@@ -0,0 +1,46 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
/*
* BASEPAGE.H Definition of the basepage structure
*/
#ifndef BASEP_H
#define BASEP_H
typedef struct basep
{
char *p_lowtpa; /* pointer to self (bottom of TPA) */
char *p_hitpa; /* pointer to top of TPA + 1 */
char *p_tbase; /* base of text segment */
long p_tlen; /* length of text segment */
char *p_dbase; /* base of data segment */
long p_dlen; /* length of data segment */
char *p_bbase; /* base of BSS segment */
long p_blen; /* length of BSS segment */
char *p_dta; /* pointer to current DTA */
struct basep *p_parent; /* pointer to parent's basepage */
char *p_reserved; /* reserved for future use */
char *p_env; /* pointer to environment string */
long p_undef[20]; /* scratch area... don't touch */
char p_cmdlin[128]; /* command line image */
} BASEPAGE;
extern BASEPAGE *_base;
#endif BASEP_H

View File

@@ -0,0 +1,319 @@
/* bindings.h to be used by AHCC compiling MiNT */
#define TRAP(a) cdecl __syscall__(a)
#define GEM_DOS(b) cdecl __syscall__( 1,b)
#define BIOS(b) cdecl __syscall__(13,b)
#define XBIOS(b) cdecl __syscall__(14,b)
long TRAP( 1) gemdos( void, ... );
long TRAP(13) bios ( void, ... );
long TRAP(14) xbios ( void, ... );
/****** Tos *************************************************************/
void GEM_DOS(0) Pterm0( void );
long GEM_DOS(1) Cconin( void );
void GEM_DOS(2) Cconout( int c );
int GEM_DOS(3) Cauxin( void );
void GEM_DOS(4) Cauxout( int c );
int GEM_DOS(5) Cprnout( int c );
long GEM_DOS(6) Crawio( int w );
long GEM_DOS(7) Crawcin( void );
long GEM_DOS(8) Cnecin( void );
int GEM_DOS(9) Cconws( const char *buf );
/* void GEM_DOS(10) Cconrs( LINE *buf ); not suitable for MiNT */
int GEM_DOS(11) Cconis( void );
long GEM_DOS(14) Dsetdrv( int drv );
int GEM_DOS(16) Cconos( void );
int GEM_DOS(17) Cprnos( void );
int GEM_DOS(18) Cauxis( void );
int GEM_DOS(19) Cauxos( void );
int GEM_DOS(25) Dgetdrv( void );
void GEM_DOS(26) Fsetdta( DTABUF *buf );
long GEM_DOS(32) Super( void *stack );
unsigned int GEM_DOS(42) Tgetdate( void );
unsigned int GEM_DOS(43) Tsetdate( unsigned int date );
unsigned int GEM_DOS(44) Tgettime( void );
unsigned int GEM_DOS(45) Tsettime( unsigned int time );
DTABUF * GEM_DOS(47) Fgetdta( void );
int GEM_DOS(48) Sversion( void );
void GEM_DOS(49) Ptermres( long keepcnt, int retcode );
int GEM_DOS(54) Dfree( long *buf, int driveno );
int GEM_DOS(57) Dcreate( const char *path );
int GEM_DOS(58) Ddelete( const char *path );
int GEM_DOS(59) Dsetpath( const char *path );
long GEM_DOS(60) Fcreate( const char *filename, int attr );
long GEM_DOS(61) Fopen( const char *filename, int mo );
int GEM_DOS(62) Fclose( int handle );
long GEM_DOS(63) Fread( int handle, long count, void *buf );
long GEM_DOS(64) Fwrite( int handle, long count, void *buf );
int GEM_DOS(65) Fdelete( const char *filename );
long GEM_DOS(66) Fseek( long offset, int handle, int seekmode );
int GEM_DOS(67) Fattrib( const char *filename, int wflag, int attrib );
long GEM_DOS(69) Fdup( int handle );
int GEM_DOS(70) Fforce( int stch, int nonstdh );
int GEM_DOS(71) Dgetpath( char *path, int driveno );
void * GEM_DOS(72) Malloc( long number );
int GEM_DOS(73) Mfree( void *block );
int GEM_DOS(74) Mshrink( int zero, void *block, long newsiz );
long GEM_DOS(75) Pexec( int mo, char *ptr1, void *ptr2, void *ptr3 );
void GEM_DOS(76) Pterm( int retcode );
int GEM_DOS(78) Fsfirst( const char *filename, int attr );
int GEM_DOS(79) Fsnext( void );
int GEM_DOS(86) Frename( int zero, const char *oldname, const char *newname );
int GEM_DOS(87) Fdatime( void *timeptr, int handle, int wflag );
int GEM_DOS(0x119) Pdomain( int newdom );
void * GEM_DOS(0x112) Psignal( int sig, void *handler );
/****** TOS 030 Gemdos Extension ****************************************/
void * GEM_DOS(68) Mxalloc( long number, int mo );
long GEM_DOS(20) Maddalt( void *start, long size );
/****** Network Gemdos Extension ****************************************/
long GEM_DOS(92) Flock( int handle, int mo, long start, long length );
/****** Bios ************************************************************/
/* void BIOS( 0) Getmpb( void *ptr ); */
int BIOS( 1) Bconstat( int dev );
long BIOS( 2) Bconin( int dev );
long BIOS( 3) Bconout( int dev, int c );
long BIOS( 4) Rwabs( int rwflag, void *buf, int cnt, int recnr, int dev );
void (* BIOS(5) Setexc( int number, void (*exchdlr)() )) ();
long BIOS( 6) Tickcal( void );
void * BIOS( 7) Getbpb( int dev );
long BIOS( 8) Bcostat( int dev );
long BIOS( 9) Mediach( int dev );
long BIOS(10) Drvmap( void );
long BIOS(11) Kbshift( int mo );
long BIOS(12) Lrwabs( int rwflag, void *buf, int cnt, int recnr, int dev );
/****** XBios ***********************************************************/
/*void XBIOS(0) Initmouse( int type, MOUSE *par, void (*mousevec)() ); */
void * XBIOS(1) Ssbrk( int count );
void * XBIOS(2) Physbase( void );
void * XBIOS(3) Logbase( void );
int XBIOS(4) Getrez( void );
void XBIOS(5) Setscreen( void *laddr, void *paddr, int rez );
void XBIOS(6) Setpalette( void *pallptr );
int XBIOS(7) Setcolor( int colornum, int color );
int XBIOS(8) Floprd( void *buf, void *filler, int devno, int sectno,
int trackno, int sideno, int count );
int XBIOS(9) Flopwr( void *buf, void *filler, int devno, int sectno,
int trackno, int sideno, int count );
int XBIOS(10) Flopfmt( void *buf, void *filler, int devno, int spt, int trackno,
int sideno, int interlv, long magic, int virgin );
void XBIOS(12) Midiws( int cnt, void *ptr );
void XBIOS(13) Mfpint( int erno, void (*vector)() );
void * XBIOS(14) Iorec( int dev );
long XBIOS(15) Rsconf( int baud, int ctr, int ucr, int rsr, int tsr, int scr );
struct keytab *XBIOS(16) Keytbl( void *unshift, void *shift, void *capslock );
long XBIOS(17) Random( void );
void XBIOS(18) Protobt( void *buf, long serialno, int disktype, int execflag );
int XBIOS(19) Flopver( void *buf, void *filler, int devno, int sectno,
int trackno, int sideno, int count );
void XBIOS(20) Scrdmp( void );
int XBIOS(21) Cursconf( int func, int rate );
void XBIOS(22) Settime( unsigned long time );
unsigned
long XBIOS(23) Gettime( void );
void XBIOS(24) Bioskeys( void );
void XBIOS(25) Ikbdws( int count, void *ptr );
void XBIOS(26) Jdisint( int number );
void XBIOS(27) Jenabint( int number );
char XBIOS(28) Giaccess( char data, int regno );
void XBIOS(29) Offgibit( int bitno );
void XBIOS(30) Ongibit( int bitno );
void XBIOS(31) Xbtimer( int timer, int control, int data, void (*vector)() );
void * XBIOS(32) Dosound( void *buf );
int XBIOS(33) Setprt( int config );
void * XBIOS(34)Kbdvbase( void );
int XBIOS(35) Kbrate( int initial, int repeat );
/* void XBIOS(36) Prtblk( PBDEF *par ); */
void XBIOS(37) Vsync( void );
typedef unsigned long Supfunc(void);
long XBIOS(38) Supexec( Supfunc * );
void XBIOS(39) Puntaes( void );
int XBIOS(41) Floprate( int devno, int newrate );
int XBIOS(64) Blitmode( int mo );
/* TOS030 XBios */
int XBIOS(42) DMAread( long sector, int count, void *buffer, int devno );
int XBIOS(43) DMAwrite( long sector, int count, void *buffer, int devno );
long XBIOS(44) Bconmap( int devno );
int XBIOS(46) NVMaccess( int opcode, int start, int count, void *buffer );
int XBIOS(80) Esetshift( int shftMode );
int XBIOS(81) Egetshift( void );
int XBIOS(82) EsetBank( int bankNum );
int XBIOS(83) EsetColor( int colorNum, int color );
void XBIOS(84) EsetPalette( int colorNum, int count, int *palettePtr );
void XBIOS(85) EgetPalette( int colorNum, int count, int *palettePtr );
int XBIOS(86) EsetGray( int swtch );
int XBIOS(87) EsetSmear( int swtch );
int GEM_DOS(0xff) Syield( void );
int GEM_DOS(0x100) Fpipe( int *usrh );
int GEM_DOS(0x104) Fcntl( int f, long arg, int cmd );
long GEM_DOS(0x105) Finstat( int f );
long GEM_DOS(0x106) Foutstat( int f );
long GEM_DOS(0x107) Fgetchar( int f, int mo );
long GEM_DOS(0x108) Fputchar( int f, long c, int mo );
long GEM_DOS(0x109) Pwait( void );
int GEM_DOS(0x10a) Pnice( int delta );
int GEM_DOS(0x10b) Pgetpid( void );
int GEM_DOS(0x10c) Pgetppid( void );
int GEM_DOS(0x10d) Pgetpgrp( void );
int GEM_DOS(0x10e) Psetpgrp( int pid, int newgrp );
int GEM_DOS(0x10f) Pgetuid( void );
int GEM_DOS(0x110) Psetuid( int id );
int GEM_DOS(0x111) Pkill( int pid, int sig );
int GEM_DOS(0x113) Pvfork( void );
int GEM_DOS(0x114) Pgetgid( void );
int GEM_DOS(0x115) Psetgid( int id );
long GEM_DOS(0x116) Psigblock( long mask );
long GEM_DOS(0x117) Psigsetmask( long mask );
long GEM_DOS(0x118) Pusrval( long arg );
void GEM_DOS(0x11a) Psigreturn( void );
int GEM_DOS(0x11b) Pfork( void );
long GEM_DOS(0x11c) Pwait3( int flag, long *rusage );
int GEM_DOS(0x11d) Fselect( unsigned int timeout, long *rfds, long *wfds, long *xfds );
void GEM_DOS(0x11e) Prusage( long *r );
long GEM_DOS(0x11f) Psetlimit( int lim, long value );
long GEM_DOS(0x120) Talarm( long secs );
void GEM_DOS(0x121) Pause( void );
long GEM_DOS(0x122) Sysconf( int n );
long GEM_DOS(0x123) Psigpending( void );
long GEM_DOS(0x124) Dpathconf( char *name, int n );
long GEM_DOS(0x125) Pmsg( int mo, long mbox, void *msg );
long GEM_DOS(0x126) Fmidipipe( int pid, int in, int out );
int GEM_DOS(0x127) Prenice( int pid, int delta );
long GEM_DOS(0x128) Dopendir( const char *name, int flag );
long GEM_DOS(0x129) Dreaddir( int buflen, long dir, char *buf );
long GEM_DOS(0x12a) Drewinddir( long dir );
long GEM_DOS(0x12b) Dclosedir( long dir );
long GEM_DOS(0x12c) Fxattr( int flag, const char *name, XATTR *buf );
long GEM_DOS(0x12d) Flink( char *oldname, char *newname );
long GEM_DOS(0x12e) Fsymlink( char *oldname, char *newname );
long GEM_DOS(0x12f) Freadlink( int size, char *buf, char *name );
long GEM_DOS(0x130) Dcntl( int cmd, char *name, long arg );
long GEM_DOS(0x131) Fchown( char *name, int uid, int gid );
long GEM_DOS(0x132) Fchmod( char *name, int mo );
long GEM_DOS(0x133) Pumask( unsigned int mo );
long GEM_DOS(0x134) Psemaphore( int mo, long id, long timeout );
long GEM_DOS(0x135) Dlock( int mo, int drive );
void GEM_DOS(0x136) Psigpause( unsigned long mask );
/* long GEM_DOS(0x137) Psigaction( int sig, SIGACTION *act, SIGACTION *oact ); */
int GEM_DOS(0x138) Pgeteuid( void );
int GEM_DOS(0x139) Pgetegid( void );
long GEM_DOS(0x13b) Dgetcwd( char *path, int drv, int size );
long GEM_DOS(0x13a) Pwaitpid( int pid, int flag, long *rusage );
long GEM_DOS(0x13c) Salert(char *msg);
/* Falcon */
#define VERTFLAG 0x0100
#define STMODES 0x0080
#define OVERSCAN 0x0040
#define PAL 0x0020
#define VGA_FALCON 0x0010
#define TV 0x0000
#define COL80 0x08
#define COL40 0x00
#define BPS16 4
#define BPS8 3
#define BPS4 2
#define BPS2 1
#define BPS1 0
#define NUMCOLS 7
typedef struct
{
int blocktype;
long blocksize;
void *blockaddr;
} DSPBLOCK;
void XBIOS( 5) VsetScreen( void *log, void *phys, int mode, int modecode);
int XBIOS( 88) VsetMode( int modecode );
int XBIOS( 89) mon_type( void );
int XBIOS( 89) VgetMonitor( void );
void XBIOS( 90) VsetSync( int flag );
long XBIOS( 91) VgetSize( int mode );
void XBIOS( 92) VsetMask( int ormask, int andmask, int overlay );
void XBIOS( 93) VsetRGB( int index, int count, long *array );
void XBIOS( 94) VgetRGB( int index, int count, long *array );
int XBIOS( 95) VcheckMode( int modecode );
int XBIOS( 95) ValidMode( int modecode );
void XBIOS( 96) Dsp_DoBlock( char *data_in, long size_in, char *data_out,
long size_out );
void XBIOS( 97) Dsp_BlkHandShake( char *data_in, long size_in, char *data_out,
long size_out );
void XBIOS( 98) Dsp_BlkUnpacked( long *data_in, long size_in, long *data_out,
long size_out );
void XBIOS( 99) Dsp_InStream( char *data_in, long block_size, long num_blocks,
long *blocks_done );
void XBIOS(100) Dsp_OutStream( char *data_out, long block_size, long num_blocks,
long *blocks_done );
void XBIOS(101) Dsp_IOStream( char *data_in, char *data_out, long block_insize,
long block_outsize, long num_blocks,
long *blocks_done );
void XBIOS(102) Dsp_RemoveInterrupts( int mask );
int XBIOS(103) Dsp_GetWordSize( void );
int XBIOS(104) Dsp_Lock( void );
void XBIOS(105) Dsp_Unlock( void );
void XBIOS(106) Dsp_Available( long *xavailable, long *yavailable );
int XBIOS(107) Dsp_Reserve( long xreserve, long yreserve );
int XBIOS(108) Dsp_LoadProg( char *file, int ability, char *buffer );
void XBIOS(109) Dsp_ExecProg( char *codeptr, long codesize, int ability );
void XBIOS(110) Dsp_ExecBoot( char *codeptr, long codesize, int ability );
long XBIOS(111) Dsp_LodToBinary( char *file, char *codeptr );
void XBIOS(112) Dsp_TriggerHC( int vector );
int XBIOS(113) Dsp_RequestUniqueAbility( void );
int XBIOS(114) Dsp_GetProgAbility( void );
void XBIOS(115) Dsp_FlushSubroutines( void );
int XBIOS(116) Dsp_LoadSubroutine( char *codeptr, long codesize, int ability );
int XBIOS(117) Dsp_InqSubrAbility( int ability );
int XBIOS(118) Dsp_RunSubroutine( int handle );
int XBIOS(119) Dsp_Hf0( int flag );
int XBIOS(120) Dsp_Hf1( int flag );
int XBIOS(121) Dsp_Hf2( void );
int XBIOS(122) Dsp_Hf3( void );
void XBIOS(123) Dsp_BlkWords( void *data_in, long size_in, void *data_out,
long size_out );
void XBIOS(124) Dsp_BlkBytes( void *data_in, long size_in, void *data_out,
long size_out );
char XBIOS(125) Dsp_HStat( void );
void XBIOS(126) Dsp_SetVectors( void (*receiver)( ), long (*transmitter)( ));
void XBIOS(127) Dsp_MultBlocks( long numsend, long numreceive,
DSPBLOCK *sendblocks, DSPBLOCK *receiveblocks );
long XBIOS(128) locksnd( void );
long XBIOS(129) unlocksnd( void );
long XBIOS(130) soundcmd( int mode, int data );
long XBIOS(131) setbuffer( int reg, void *begaddr, void *endaddr );
long XBIOS(132) setmode( int mode );
long XBIOS(133) settracks( int playtracks, int rectracks );
long XBIOS(134) setmontracks( int montrack );
long XBIOS(135) setinterrupt( int src_inter, int cause );
long XBIOS(136) buffoper( int mode );
long XBIOS(137) dsptristate( int dspxmit, int dsprec );
long XBIOS(138) gpio( int mode, int data );
long XBIOS(139) devconnect( int src, int dst, int srcclk, int prescale,
int protocol );
long XBIOS(140) sndstatus( int reset );
long XBIOS(141) buffptr( long *ptr );
/* XBIOS(150) VsetVars ( ?????? ); */
int XBIOS(165) WavePlay( int flags, long rate, void *sptr, long slen );

View File

@@ -0,0 +1,65 @@
/* compiler specific defines */
/* this file is guaranteed to be included exactly once if you include
anything at all. all site-dependent or compiler-dependent stuff
should go here!!!
*/
#ifndef _COMPILER_H_
# define _COMPILER_H_ 1
#if ! defined __TURBOC__
#error for Pure C, Turbo C or AHCC only
#endif
/* Undefine everything, so we get a clean slate. */
#undef __USE_POSIX
#undef __USE_POSIX2
#undef __USE_POSIX199309
#undef __USE_XOPEN
#undef __USE_XOPEN_EXTENDED
#undef __USE_BSD
#undef __USE_SVID
#undef __USE_MISC
#undef __USE_GNU
#undef __USE_REENTRANT
#undef __FAVOR_BSD
#undef __KERNEL_STRICT_NAMES
#undef __USE_MINTLIB
/* general library stuff */
/* __SIZE_TYPEDEF__: the type returned by sizeof() */
/* __PTRDIFF_TYPEDEF__: the type of the difference of two pointers */
/* __WCHAR_TYPEDEF__: wide character type (i.e. type of L'x') */
/* __EXITING: the type of a function that exits */
/* __NORETURN: attribute of a function that exits (gcc >= 2.5) */
/* __CDECL: function must get parameters on stack */
#define __SIZE_TYPEDEF__ unsigned long
#define __PTRDIFF_TYPEDEF__ long
#define __WCHAR_TYPEDEF__ int
#define __EXITING void
#define __VA_LIST__ char *
#define __CDECL cdecl
#define __cdecl cdecl
#define __TCC_GEMLIB__
#define __NORETURN
#define __EXTERN extern
#define inline
#define __PROTO(x) x
#define __P(x) x
#define __NULL 0L
#define _UID_T unsigned short
#define _GID_T unsigned short
#define _PID_T int
/* used in limits.h, stdio.h */
#define _NFILE (32) /* maximum number of open streams */
#define atarist
#define __BEGIN_DECLS
#define __END_DECLS
#define begin_decls __BEGIN_DECLS
#define end_decls __END_DECLS
#endif /* _COMPILER_H_ */

View File

@@ -0,0 +1,35 @@
/* CTYPE.H
Character definitions
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __CTYPE )
#define __CTYPE
int isalnum( int c );
int isalpha( int c );
int isascii( int c );
int iscntrl( int c );
int isdigit( int c );
int isodigit( int c );
int isxdigit( int c );
int isgraph( int c );
int isprint( int c );
int ispunct( int c );
int islower( int c );
int isupper( int c );
int isspace( int c );
int tolower( int c );
int toupper( int c );
#define toascii(c) ((c) & 0x7f)
#endif
/************************************************************************/


View File

@@ -0,0 +1,46 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
/* From the mintlib modified by Henk Robbers <h.rbbers@chello.nl> */
#if !defined _ERRNO_H
# define _ERRNO_H 1 /* Allow multiple inclusion. */
extern int errno;
#define DEFENUM 1
enum
{
#include "pc_errno.h"
sys_nerr
};
#ifndef ERROR
#define ERROR (-1) /* general error condition */
#endif
typedef struct
{
char *text, *short_text;
short errno;
} ERR_LIST;
#endif

View File

@@ -0,0 +1,44 @@
/* ERRNO.H
Library error code definitions
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined(__ERRNO)
#define __ERRNO
extern int errno;
#define E_OK 0
#define EPERM 1 /* file permission denied */
#define ENOENT 2 /* file not found */
#define EIO 5 /* general i/o error */
#define EBADF 9 /* invalid file handle */
#define EILLSPE 10 /* illegal file specification */
#define EINVMEM 11 /* invalid heap block */
#define ENOMEM 12 /* heap overflow */
#define EACCES 13 /* file access mode error */
#define EEXIST 17 /* file already exists */
#define EPLFMT 18 /* program load format error */
#define ENODEV 19 /* device error */
#define ENOTDIR 20 /* path not found */
#define EINVAL 22 /* invalid parameter */
#define ENFILE 23 /* file table overflow */
#define EMFILE 24 /* too many open files */
#define ENOSPC 28 /* disk full */
#define ESPIPE 29 /* seek error */
#define EROFS 30 /* read only device */
#define EDOM 33 /* domain error */
#define ERANGE 34 /* range error */
#define ENMFILE 35 /* no more matching file */
#define sys_nerr 35
#endif
/************************************************************************/


View File

@@ -0,0 +1,127 @@
/* Copyright (c) 2006 by H. Robbers.
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#if !defined( __EXT )
#define __EXT
#include <time.h>
/* code belonging to these standard headers moved there, ++eero */
#include <sys/stat.h>
#include <unistd.h>
extern int __text, __data, __bss;
#define _text &__text
#define _data &__data
#define _bss &__bss
#define FA_UPDATE 0x00
#define FA_RDONLY 0x01
#define FA_HIDDEN 0x02
#define FA_SYSTEM 0x04
#define FA_LABEL 0x08
#define FA_DIREC 0x10
#define FA_ARCH 0x20
#define MAXPATH 119
#define MAXDRIVE 3
#define MAXDIR 102
#define MAXFILE 9
#define MAXEXT 5
struct ffblk
{
char ff_reserved[21]; /* Reserved by TOS */
char ff_attrib; /* Attribute found */
int ff_ftime; /* File time */
int ff_fdate; /* File date */
long ff_fsize; /* File size */
char ff_name[13]; /* File name found */
};
struct date
{
int da_year; /* Current year */
char da_day; /* Day of the month */
char da_mon; /* Month ( 1 = Jan ) */
};
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 ftime
{
unsigned ft_hour: 5;
unsigned ft_min: 6;
unsigned ft_tsec: 5;
unsigned ft_year: 7;
unsigned ft_month: 4;
unsigned ft_day: 5;
};
struct dfree
{
unsigned df_avail;
unsigned df_total;
unsigned df_bsec;
unsigned df_sclus;
};
int getcurdir( int drive, char *path );
int getdisk( void );
void getdfree( unsigned char drive, struct dfree *dtable );
int setdisk( int drive );
int findfirst( const char *filename, struct ffblk *ffblk, int attrib );
int findnext( struct ffblk *ffblk );
void getdate( struct date *dateRec );
void gettime( struct time *timeRec );
void setdate( struct date *dateRec );
void settime( struct time *timeRec );
int getftime( int handle, struct ftime *ftimep );
int setftime( int handle, struct ftime *ftimep );
struct tm *ftimtotm( struct ftime *f );
void delay( unsigned milliseconds );
int kbhit( void );
int getch( void );
int getche( void );
int putch( int c);
long filelength( int handle );
size_t coreleft( void );
#include <unistd.h>
#endif
/***********************************************************************/


View File

@@ -0,0 +1,92 @@
#define VERTFLAG 0x0100
#define STMODES 0x0080
#define OVERSCAN 0x0040
#define PAL 0x0020
#define VGA_FALCON 0x0010
#define TV 0x0000
#define COL80 0x08
#define COL40 0x00
#define BPS16 4
#define BPS8 3
#define BPS4 2
#define BPS2 1
#define BPS1 0
#define NUMCOLS 7
typedef struct
{
short blocktype;
long blocksize;
void *blockaddr;
} DSPBLOCK;
long locksnd( void );
long unlocksnd( void );
long soundcmd( short mo, short data );
long setbuffer( short reg, void *begaddr, void *endaddr );
long setmode( short mo );
long settracks( short playtracks, short rectracks );
long setmontracks( short montrack );
long setinterrupt( short src_inter, short cause );
long buffoper( short mo );
long dsptristate( short dspxmit, short dsprec );
long gpio( short mo, short data );
long devconnect( short src, short dst, short srcclk, short prescale,
short protocol );
long sndstatus( short reset );
long buffptr( long *ptr );
short Dsp_LoadProg( char *file, short ability, char *buffer );
long Dsp_LodToBinary( char *file, char *codeptr );
void Dsp_DoBlock( char *data_in, long size_in, char *data_out,
long size_out );
void Dsp_BlkHandShake( char *data_in, long size_in, char *data_out,
long size_out );
void Dsp_BlkUnpacked( long *data_in, long size_in, long *data_out,
long size_out );
void Dsp_InStream( char *data_in, long block_size, long num_blocks,
long *blocks_done );
void Dsp_OutStream( char *data_out, long block_size, long num_blocks,
long *blocks_done );
void Dsp_IOStream( char *data_in, char *data_out, long block_insize,
long block_outsize, long num_blocks,
long *blocks_done );
void Dsp_RemoveInterrupts( short mask );
short Dsp_GetWordSize( void );
short Dsp_Lock( void );
void Dsp_Unlock( void );
void Dsp_Available( long *xavailable, long *yavailable );
short Dsp_Reserve( long xreserve, long yreserve );
void Dsp_ExecProg( char *codeptr, long codesize, short ability );
void Dsp_ExecBoot( char *codeptr, long codesize, short ability );
void Dsp_TriggerHC( short vector );
short Dsp_RequestUniqueAbility( void );
short Dsp_GetProgAbility( void );
void Dsp_FlushSubroutines( void );
short Dsp_LoadSubroutine( char *codeptr, long codesize, short ability );
short Dsp_InqSubrAbility( short ability );
short Dsp_RunSubroutine( short handle );
short Dsp_Hf0( short flag );
short Dsp_Hf1( short flag );
short Dsp_Hf2( void );
short Dsp_Hf3( void );
void Dsp_BlkWords( void *data_in, long size_in, void *data_out,
long size_out );
void Dsp_BlkBytes( void *data_in, long size_in, void *data_out,
long size_out );
char Dsp_HStat( void );
void Dsp_SetVectors( void (*receiver)( ), long (*transmitter)( ));
void Dsp_MultBlocks( long numsend, long numreceive,
DSPBLOCK *sendblocks, DSPBLOCK *receiveblocks );
short Vsetmode( short modecode );
short mon_type( void );
long VgetSize( short mo );
void VsetSync( short flag );
void VsetRGB( short index, short count, long *array );
void VgetRGB( short index, short count, long *array );
void VsetMask( short ormask, short andmask, short overlay );

View File

@@ -0,0 +1,44 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
/* HR: Do away with all this GCC gibberish */
#ifndef __GIBBERISH_H
#define __GIBBERISH_H
#undef __THROW
#define __THROW
#undef __BEGIN_DECLS
#define __BEGIN_DECLS
#undef __END_DECLS
#define __END_DECLS
#undef __PROTO
#define __PROTO(x) x
/* Please add more gibberish here when encountered */
#undef NORETURN
#define NORETURN
#undef inline
#define inline
#endif

View File

@@ -0,0 +1,50 @@
/* FLOAT.H
Characteristics of floating point types
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __FLOAT )
#define __FLOAT
#define FLT_ROUNDS 1
#define FLT_RADIX 2
#define FLT_MANT_DIG 24
#define FLT_DIG 6
#define FLT_MIN_EXP -125
#define FLT_MIN_10_EXP -37
#define FLT_MAX_EXP 128
#define FLT_MAX_10_EXP 38
#define FLT_EPSILON 1.192093E-07
#define FLT_MIN 1.175494E-38
#define FLT_MAX 3.402823E+38
#define DBL_MANT_DIG 64
#define DBL_DIG 19
#define DBL_MIN_EXP -16383
#define DBL_MIN_10_EXP -4932
#define DBL_MAX_EXP 16384
#define DBL_MAX_10_EXP 4932
#define DBL_EPSILON 5.421010862427522170E-0020
#define DBL_MIN 1.681051571556046753E-4932
#define DBL_MAX 1.189731495357231765E+4932
#define LDBL_MANT_DIG 64
#define LDBL_DIG 19
#define LDBL_MIN_EXP -16383
#define LDBL_MIN_10_EXP -4932
#define LDBL_MAX_EXP 16384
#define LDBL_MAX_10_EXP 4932
#define LDBL_EPSILON 5.421010862427522170E-0020
#define LDBL_MIN 1.681051571556046753E-4932
#define LDBL_MAX 1.189731495357231765E+4932
#endif
/************************************************************************/


View File

@@ -0,0 +1,58 @@
/**************************************************************************
* FRMTYPES.H - datatypes internal to the forms handling subsystem.
*************************************************************************/
#ifndef FRMTYPES_H
#define FRMTYPES_H
#include <stdarg.h>
#define Array_els(a) ( sizeof(a) / sizeof((a)[0]) )
/*-------------------------------------------------------------------------
* All dynamic dialogs get these options...
*-----------------------------------------------------------------------*/
#define FRM_DEFAULT_DYNOPT (FRM_USEBLIT | FRM_MOVEABLE | FRM_MOUSEARROW)
#define FRM_MANDATORY_DYNOPT (FRM_CENTER | FRM_DCOMPLETE)
/*-------------------------------------------------------------------------
*
*-----------------------------------------------------------------------*/
typedef struct form_control {
OBJECT *ptree;
void *blitbuffer;
int (*form_do)(struct form_control *ctl);
long options;
int editobj;
int parentobj;
int moverobj;
int defaultobj;
int specialobj;
int select_state;
int treeflags;
GRECT littlerect;
GRECT scrnrect;
GRECT *pboundrect;
} FormControl;
/*-------------------------------------------------------------------------
*
*-----------------------------------------------------------------------*/
typedef long BLITFU(int options, void *buffer, void *prect);
extern long _FrmDefaults;
FormControl *_FrmSetup (FormControl *ctl, long options, OBJECT *ptree, GRECT *pboundrect);
char * _FrmVFormat (char *fmt, va_list args, int *plen);
void _FrmVFree (char *buffer);
void _FrmTrWidths (OBJECT *ptree, int parent, int width);
int _FrmDS2Obj (char **ppstr, OBJECT *pobj, TEDINFO *pted, int *pwidth, int maxobj);
void _FrmNLPatch (char **patch_array);
void _FrmNL2DS (char *strings, char **pointer_array, char **patch_array, int maxstrings);
#endif

View File

@@ -0,0 +1,505 @@
/* tab expansion/compression should be set to 4 */
/**************************************************************************
* GEMF.H - Header file for GEM programming.
*
* This header file contains items compatible with both GEMDEFS and OBDEFS
* from the Alcyon system. Note that there are no 'extern' definitions
* for the GEM functions, because they all return a signed int and work
* fine as autodefined functions.
*
* Maintenance:
* 12/09/08 - > Henk Robbers.
* Use standard AES of the compiler.
* Every duplication in gemfast.h removed.
* Renamed to GEMF.
* Ported to Pure C & AHCC.
* 02/29/92 - v1.8
* > Added new options for new utility functions.
* > Added extern declarations for all global vars.
* > Added macro to map frm_dsdial() to frm_dsdialog() with
* parms in the new order.
* > Added macros mapping appl_init/exit to apl_xinit/xexit,
* so that all aps automatically get new extended init that
* fills in the new global vars. New utils REQUIRE that
* these vars be init'd; think twice before changing this!
* > Changed FDADDR datatype from char* to void*.
* 05/26/90 - v1.4
* > Added RSHDR structure for imbedded resource support.
* > Fixed all structures which defined pointers as 'long'...
* - ICONBLK ib_pmask, ib_pdata, ib_ptext
* - BITBLK bi_pdata
* - USERBLK ub_code
* - PARMBLK pb_tree
* All of these structure elements now define the proper ptr.
* > Added AESUTIL_A, AESFAST_A and VDIFAST_A symbols. This
* allows specific indication of the presence or abscence of
* the bindings libraries, allowing a programmer to use the
* GEMFAST.H header without using the rest of GemFast. This
* also allows conditional compilation code to be more
* specific: it can now test for the presence of the header
* file (and handle the differences in the structure defs),
* and it can separately test for the presence of the libs,
* and the extended functions available therein.
* 12/03/89 - v1.3
* > Renamed a lot of functions, a name compatibility block was
* added at the end of this file to smooth the transition.
* > Added NO_OBJECT, MU_MENTRY, MU_MEXIT to defines.
* > Added XMULTI struct, even though it really belongs to v2.0
*************************************************************************/
#include <tos.h>
#include <stdarg.h>
#include <stddef.h>
#include <string.h>
#include <aes.h>
#include <vdi.h>
#include "frmtypes.h"
#ifndef GEMFAST_H /* Prevent multiple inclusion */
#define GEMFAST_H 1 /* Tell the world GEMFAST header is used */
#define GEMF_VERSION 0x0180 /* Tell the world we are v1.80 */
#define AESUTIL_A 1 /* Tell the world AESFAST utils available */
#define AESFAST_A 1 /* Tell the world AESFAST lib is available */
#define VDIFAST_A 1 /* Tell the world VDIFAST lib is available */
/* VDI inside fill styles */
#define IS_HOLLOW 0
#define IS_SOLID 1
#define IS_PATTERN 2
#define IS_HATCH 3
#define IS_UDPTRN 4
/* evnt_mouse options */
#define MU_MENTRY 0x0000
#define MU_MEXIT 0x0001
/* rsrc_gaddr structure types */
#define ROOT 0 /* this name used by MWC */
#define BUSY_BEE 2
#define BEE 2
/* value returned by objc_find(), et. al. */
#define NO_OBJECT -1
/* editable text field definitions */
#define EDSTART 0
#define EDINIT 1
#define EDCHAR 2
#define EDEND 3
/*-------------------------------------------------------------------------
* a few miscellanious GemFast-defined constants...
*-----------------------------------------------------------------------*/
#define GRF_MSALTARROW 200 /* alternate value of ARROW for grf_mouse() */
#define GRF_MSINQUIRE (-1) /* inquire current shape for grf_mouse() */
#define OBJ_BMINQUIRE (-1) /* get w/o change from obj_bmbuttons() */
#define FRM_GETDEFAULTS (-1L) /* get w/o change from frm_defaults() */
#define FRM_MOVER 0x4000 /* special ob_flags value for moveable forms*/
#define G_THERMO 200 /* ob_type for a thermometer display object */
#define OBJ_NODRAW 0 /* obj_XXchange(): no draw after change */
#define OBJ_WITHDRAW 1 /* obj_XXchange(): do draw after change */
#define OBJ_CLIPDRAW 2 /* obj_XXchange(): draw with optional clip */
#define OBJ_TINQUIRE (-32000) /* inquire current G_THERMO position */
#define OBJ_TINCREMENT (-1) /* increment current G_THERMO position by 1 */
#define FRM_DSMAXBUTTONS 5 /* max dynamic button strings */
#define FRM_DSMAXSTRINGS 20 /* max dynamic dialog display strings */
/*-------------------------------------------------------------------------
* options for apl_whatever() functions...
*-----------------------------------------------------------------------*/
#define APL_RTRANSIENT 0x0001 /* cleanup transient resources */
#define APL_RPERMENANT 0x0002 /* cleanup permenant resources */
/*-------------------------------------------------------------------------
* actions for frm_desktop()...
*-----------------------------------------------------------------------*/
#define FRM_DTINSTALL 0x00000000L /* install form as system desktop */
#define FRM_DTREMOVE 0x10000000L /* remove form, revert to sys desktop */
/*-------------------------------------------------------------------------
* actions for frm_dialog()...
*-----------------------------------------------------------------------*/
#define FRM_DSTART 0x10000000L /* do FMD_START */
#define FRM_DDRAW 0x20000000L /* do objc_draw() */
#define FRM_DDO 0x40000000L /* do form_do() */
#define FRM_DFINISH 0x80000000L /* do FMD_FINISH */
#define FRM_DCOMPLETE 0xF0000000L /* do all the steps above in one call */
/*-------------------------------------------------------------------------
* actions for frm_progress()...
*-----------------------------------------------------------------------*/
#define FRM_PSTART 0x10000000L /* set up and display progress dialog */
#define FRM_PUPDATE 0x40000000L /* update progress thermometer */
#define FRM_PFINISH 0x80000000L /* close and cleanup progress dialog */
/*-------------------------------------------------------------------------
* options for all frm_whatever() functions...
* 0xauddbbbb
* ||| |______ Basic options for all dialog handling.
* |||________ Dynamic dialog options.
* ||_________ User options; never touched by GemFast.
* |__________ Actions.
*-----------------------------------------------------------------------*/
#define FRM_NORMAL 0x00000000L /* placeholder when you want none */
#define FRM_EXPLODE 0x00000001L /* exploding box graphics in dialog */
#define FRM_CENTER 0x00000002L /* center dialog in screen */
#define FRM_NEARMOUSE 0x00000004L /* center dialog over mouse */
#define FRM_MOUSEARROW 0x00000008L /* force mouse ARROW during dialog */
#define FRM_USEBLIT 0x00000010L /* use blits instead of redraw msgs */
#define FRM_MOVEABLE 0x00000020L /* dialog is moveable */
#define FRM_NODEFAULTS 0x00008000L /* these options override defaults */
#define FRM_DMUSTSELECT 0x00010000L /* dsdialog/dsmenu: no default exit */
#define FRM_DSHADOWED 0x00020000L /* dsdialog/dsmenu: shadowed parent */
#define FRM_DSL1TITLE 0x00100000L /* 1st line is title, higher y pos */
#define FRM_MEXITPARENT 0x00100000L /* exit if mouse leaves parent */
#define FRM_MEXITVICINITY 0x00200000L /* exit if mouse leaves vicinity */
#define FRM_OPTIONBITS 0x0FFFFFFFL /* mask for dialog options */
#define FRM_BOPTIONBITS 0x0000FFFFL /* mask for basic options */
#define FRM_DOPTIONBITS 0x00FF0000L /* mask for dynamic options */
#define FRM_UOPTIONBITS 0x0F000000L /* mask for user options */
#define FRM_ACTIONBITS 0xF0000000L /* mask for dialog actions */
/*-------------------------------------------------------------------------
* option for fsl_dialog()...
*-----------------------------------------------------------------------*/
#define FSL_NORMAL 0x0000
#define FSL_FNOPTIONAL 0x0001
#define FSL_PATHONLY 0x0002
/*-------------------------------------------------------------------------
* options for grf_blit() and grf_memblit()...
*-----------------------------------------------------------------------*/
#define GRF_NORMAL 0x0000 /* a placeholder value */
#define GRF_BFROMSCREEN 0x1000 /* blit from screen to buffer */
#define GRF_BTOSCREEN 0x2000 /* blit from buffer to screen */
#define GRF_BMEMCALC 0x4000 /* calc mem requirements, don't blit */
#define GRF_BOBJTREE 0x0001 /* rectparm OBJECT* instead of GRECT* */
/**************************************************************************
* data structures and types...
*************************************************************************/
/*-------------------------------------------------------------------------
* FDB/MFDB structure (describes memory area for VDI blit)...
*-----------------------------------------------------------------------*/
#ifndef FDADDR /* v1.3: this define has been added to */
#define FDADDR void* /* help provide compatibility between */
#endif /* bindings systems. */
typedef MFDB FDB;
/*-------------------------------------------------------------------------
* VRECT structure (a VDI-style rectangle, describes opposite corners)...
*-----------------------------------------------------------------------*/
typedef struct vrect
{
int v_x1;
int v_y1;
int v_x2;
int v_y2;
} VRECT;
#define appl_blk user_blk
/*-------------------------------------------------------------------------
* XUSERBLK (our internal extension to a standard USERBLK)...
*-----------------------------------------------------------------------*/
typedef struct xuser_blk
{
long cdecl (*ub_code)(); /* the 1st two fields are USERBLK std, */
struct xuser_blk *ub_self; /* but ub_parm always points to self. */
void *reserved; /* this will be used in v1.9 */
long ub_size; /* size of this XUSERBLK structure */
long ob_spec; /* ob_spec and ob_type are from the */
short ob_type; /* original object before we xformed */
} XUSERBLK;
/*-------------------------------------------------------------------------
* XPARMBLK structure (our renaming of a standard PARMBLK)...
*-----------------------------------------------------------------------*/
typedef struct xparm_blk
{
OBJECT *ptree;
int obj;
int prevstate;
int currstate;
GRECT drawrect;
GRECT cliprect;
XUSERBLK *pub;
} XPARMBLK;
typedef struct
{
XUSERBLK xub;
int tick_limit;
int tick_count;
int tick_width;
int curr_width;
int full_width;
int fill_style;
int xoffset;
} ThermoInfo;
#define RSHDR_DEFINED 1 /* signal to other header files that RSHDR is done */
/*-------------------------------------------------------------------------
* XMOUSE structure...
*-----------------------------------------------------------------------*/
typedef struct xmouse
{
int retval;
int bclicks;
int mask;
int state;
int status;
int mousex;
int mousey;
int mouseb;
int keystate;
} XMOUSE;
/*-------------------------------------------------------------------------
* XMULTI structure...
*-----------------------------------------------------------------------*/
typedef struct xmulti
{
int msgbuf[8];
int mflags,
mbclicks,
mbmask,
mbstate,
mm1flags;
GRECT mm1rect;
int mm2flags;
GRECT mm2rect;
int mtlocount,
mthicount;
int mwhich,
mmox,
mmoy,
mmobutton,
mmokstate,
mkreturn,
mbreturn;
} XMULTI;
/**************************************************************************
* declarations for functions.
*************************************************************************/
typedef void *(VPFUNC)(size_t size);
typedef void (VFUNC)(void *block);
int apl_xinit (void);
void * apl_malloc (size_t size);
void apl_free (void * block);
int apl_vshared (void);
void apl_mmvectors (VPFUNC *newalloc, VFUNC *newrelease);
int apl_vopen (void);
void apl_vclose (int vdi_handle);
void apl_xexit (void);
typedef struct parms
{
short idx;
OBJECT **pptree;
} Parms;
int rsc_cubuttons (OBJECT *ptree);
int rsc_rrbuttons (OBJECT *ptree);
void rsc_sxtypes (OBJECT *thetree, ...);
void rsc_gstrings (OBJECT *thetree, ...);
void rsc_sstrings (OBJECT *thetree, ...);
void cdecl rsc_gtrees (int firstparm, ...);
void rsc_treefix (OBJECT *ptree);
int frmx_center (OBJECT *ptree, GRECT *prect);
void frm_cleanup (FormControl *ctl);
void * frm_init (long options, OBJECT *ptree, GRECT *pboundrect);
void frm_start (FormControl *ctl);
void frm_draw (FormControl *ctl, int obj);
void frm_finish (FormControl *ctl);
void frm_move (FormControl *ctl);
int frm_do (FormControl *ctl, int editobj);
int frm_mdo (FormControl *ctl);
int frm_dialog (long options, OBJECT *ptree, int object);
long frm_defaults (long options);
void * frm_dovector (void *newfunc);
void frm_confine (OBJECT *ptree, GRECT *boundrect);
int frm_mkmoveable (OBJECT *ptree, int object);
int frmx_dial (int flag, GRECT *plittle, GRECT *pbig);
int frm_dsdialog (long options, char *pbuttons[], char *pstrings[]);
int frm_progress (long options, int increments, char *buttons, char *fmt, ...);
int frm_qchoice (char *buttons, char *fmt, ...);
int frm_printf (long options, char *buttons, char *fmt, ...);
int frm_vprintf (long options, char *buttons, char *fmt, va_list args);
int frm_qerror (int err, char *fmt, ...);
int frm_verror (int err, char *buttons, char *fmt, va_list args);
int frm_menu (long options, OBJECT *ptree, int select_state);
int frm_nlmenu (long options, char *title, char *strings);
int frm_qmenu (char *title,char *strings);
int frm_dsmenu (long options, char *title, char **strings);
void frm_qtext (char *fmt, ...);
int frm_question (char *fmt, ...);
int frm_error (int err, char *buttons, char *fmt, ...);
int frm_nldialog (long options, char *buttons, char *strings);
int frm_eflag (OBJECT *ptree, int obj, char *fmt, ...);
void frm_desktop (long options, OBJECT *ptree);
int fsl_dialog (int options, char *pfullname, char *ppath, char *pwild, char *pprompt);
void obj_mxuserdef (XUSERBLK *pblk, OBJECT *pobj, void *pcode);
char ** obj_ppstring (OBJECT *pobj);
int obj_clcalc (OBJECT *ptree, int object, GRECT *pgrect, VRECT *pvrect);
void obj_flchange (OBJECT *ptree, int object, int newflags, int drawflag, GRECT *optional_clip);
void obj_stchange (OBJECT *ptree, int object, int newstate, int drawflag, GRECT *optional_clip);
void obj_xywh (OBJECT *ptree, int object, GRECT *prect);
void obj_offxywh (OBJECT *ptree, int object, GRECT *prect);
int obj_mkthermo (OBJECT *ptree, int object, int nincr);
int obj_udthermo (OBJECT *ptree, int object, int newpos, GRECT *pclip);
void obj_mxuserdef (XUSERBLK *pblk, OBJECT *pobj, void *pcode);
int obj_rbfind (OBJECT *tree, int parent, int rbstate);
int obj_parent (OBJECT *tree, int curobj);
int obj_rbselect (OBJECT *ptree, int selobj, int state);
int obj_xtfind (OBJECT *ptree, int parent, char xtype);
int obj_bmbuttons (OBJECT *ptree, int parent, int selstate, int newbits);
int grf_mouse (int shape, void *pform);
int grfx_dragbox (GRECT *startrect, GRECT *boundrect, GRECT *endrect);
void * grf_memblit (int options, void *buffer, void *prect);
BLITFU grf_blit;
GRECT * rc_gadjust (GRECT *prect, int xadjust, int yadjust);
VRECT * rc_vadjust (VRECT *prect, int xadjust, int yadjust);
void * rc_copy (void *psrce, void *pdest);
GRECT * rc_vtog (VRECT *pvrect, GRECT *pgrect);
VRECT * rc_gtov (GRECT *pgrect, VRECT *pvrect);
GRECT * rc_union (GRECT *prect1, GRECT *prect2);
GRECT * rc_confine (GRECT *pbound, GRECT *pdest);
int rc_intersect (GRECT *prect1, GRECT *prect2);
int rc_ptinrect (GRECT *prect, int x, int y);
GRECT * rc_scale (GRECT *psource, GRECT *pdest, int percentage);
int winx_get (int whandle, int wfield, GRECT *prect);
int wnd_update (int flag);
int wnd_top (void);
int winx_calc (int type, int kind, GRECT inrect, GRECT *poutrect);
int evnx_multi (XMULTI *xm);
int mnu_bar (void *menutree, int flag, long reserved);
void mnu_disable (void);
void mnu_enable (void);
/**************************************************************************
* declarations of all global vars defined by gemfast...
*************************************************************************/
/*
* these are valid after appl_init()
*/
extern void *aespb[6]; /* the AES parmblk, an array of 6 ptrs */
extern int aescontrol[5]; /* the AES control structure, 5 ints */
extern int global[]; /* global[] is aliased by following names */
extern int gl_apversion; /* the AES version number */
extern int gl_apcount; /* max # of concurrent AES applications */
extern int gl_apid; /* id of the current application */
extern long gl_apprivate; /* anything the applicaton wants to store */
extern void *gl_apptree; /* pointer to array of object tree ptrs */
extern long gl_ap1resv; /* old name for pointer to rsc data */
extern RSHDR *gl_aprshdr; /* pointer to head of rsc data */
extern int gl_ap2resv[6]; /* unused entries in global array */
/*
* these are valid after apl_xinit()
*/
extern int gl_grfhandle; /* global physical VDI handle (graf_handle)*/
extern int gl_wchar; /* width of a character */
extern int gl_hchar; /* height of a character */
extern int gl_wbox; /* width of a boxchar */
extern int gl_hbox; /* height of a boxchar */
extern GRECT gl_rwdesk; /* coordinates of work area of the desktop */
extern GRECT gl_rfscrn; /* coordinates of the full screen */
/*
* these are valid after apl_vopen()
*/
extern int gl_vwout[57]; /* work_out from v_opnvwk() */
extern int gl_vxout[57]; /* work_out from vq_extnd(,1,) */
/**************************************************************************
* automatically use extended binding routines....
* if you undo these macros, all the builtin utilities will break!
* the normal low-level bindings will still work, though.
*************************************************************************/
#define appl_init apl_xinit /* extended init fills in new gl_ vars */
#define appl_exit apl_xexit /* extended exit closes shared vdi, etc */
#define wind_update wnd_update /* stack-like wind_update routine */
#define graf_mouse grf_mouse /* use save/restore mouse shape system */
#define objc_xywh obj_xywh /* this one's just plain faster */
#define menu_bar(a,b) mnu_bar((a),(b),0L) /* popable menu system */
/**************************************************************************
* Name compatibility stuff.
*
* 02/29/92 - v1.8
* Added mapping of frm_dsdial to frm_dsdialog.
* 05/26/90 - v1.4
* Added mapping of find_exttype to obj_xtfind.
* 08/28/89 - v1.3
* In v1.3, a big push has been made to make a consistant
* naming standard for the AES utilities. To avoid breaking
* a lot of existing code, the following block will direct
* the old names to the new routines.
*************************************************************************/
#define objclg_adjust rc_gadjust
#define objclv_adjust rc_vadjust
#define objcl_calc obj_clcalc
#define objrb_which(a,b) obj_rbfind((a),(b),SELECTED)
#define obj_rbwhich(a,b) obj_rbfind((a),(b),SELECTED)
#define objxrb_which obj_rbfind
#define find_exttype obj_xtfind
#define objst_change obj_stchange
#define objfl_change obj_flchange
#define graqon_mouse gra_qonmouse
#define graqof_mouse gra_qofmouse
#define graq_mstate gra_qmstate
#define frm_dsdial(str,btn, options) frm_dsdialog((options)|FRM_DSL1TITLE,(btn),(str))
#define frm_sizes(tree, rect) obj_clcalc((tree), ROOT, (rect), NULL)
#endif
/* end of GEMFAST.H */

View File

@@ -0,0 +1,184 @@
/* Copyright (c) 1990 - present by H. Robbers. ANSI upgrade.
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef GEMPB_H
#define GEMPB_H
/* (c) 1990 1999 Henk Robbers Amsterdam
1990: used in a item_selector of my own (called within trap)
1999: adapted to modern OS's like MagiC and MiNT,
added flexibility and compiletime compatability with original binding.
*/
#include <prelude.h>
#if 0
/* define these in your compilers -D options or in the project file */
#define G_MT 0 /* declare as 1 if you generate for Multi Threading version */
#define G_EXT 0 /* declare as 1 if you want extended bindings. */
#define G_MODIFIED 0 /* declare as 1 if you want modified bindings for:
evnt_button, evnt_mouse, objc_draw, form_center,
form_do, form_dial wind_get.... */
/* define these in your compilers -D options or in the project file */
#define G_STACK 0 /* declare as 1 if you want to compile for systems with
parameters all on the stack (faster bindings possible) */
#define PC_GLOB 0 /* declare as 1 if your program uses the global in GEMPARBLK of Pure C */
#endif
#if G_STACK && (sizeof(G_w) == sizeof(G_i))
#define ON_STACK 1
#if __TURBOC__ || __AHCC__ || __ABC__
#define G_decl cdecl /* for bindings */
#define __Cdecl cdecl /* ALWAYS cdecl */
#define CDECL 1
#define __WGS_ELLIPSISD__ 1 /* define this as 1 if you use the 'ellipsis'd version of wind_get & wind_set */
#else
#define G_decl /* or whatever is needed */
#define __Cdecl
#endif
#else
#if __TURBOC__ || __AHCC__ || __ABC__
#define G_decl /* for bindings */
#define __Cdecl cdecl /* ALWAYS cdecl */
#define CDECL 1
#define __WGS_ELLIPSISD__ 1 /* define this as 1 if you use the 'ellipsis'd version of wind_get & wind_set */
#else
#define G_decl /* or whatever is needed */
#define __Cdecl
#endif
#endif
typedef union
{
void * spec; /* PC_GEM */
long l;
int pi[2];
} private;
/* At last give in to the fact that it is a struct, NOT an array */
typedef struct aes_global
{
int version,
count,
id;
private *pprivate;
void **ptree;
void *mem;
int lmem,
nplanes,
res1,res2,
bvdisk,
bvhard;
} GLOBAL;
#define aes_global (_GemParBlk.glob)
#if G_MT /* pass global at the user level */
#define dglob ,GLOBAL *glob
#define pglob glob
#define G_n(x) MT_ ## x
#define G_nv(x) MT_ ## x (GLOBAL *glob) /* for void x(void) */
#else /* use implicit global */
#define dglob
#if PC_GLOB /* use PC's _GemParBlk */
#define pglob 0L
#else /* use simple defaults */
#define pglob &aes_global
#endif
#define G_n(x) x
#define G_nv(x) x(void)
#endif
int __Cdecl G_trap
(int * contrl, /* 4(sp) */
GLOBAL * glob, /* 8(sp) */
int * intin, /* 12(sp) */
int * intout, /* 16(sp) */
void * addrin, /* 20(sp) */
void * addrout); /* 24(sp) */
void __Cdecl _trap_vdi
(int handle, /* 4(sp) */
int fu, /* 6(sp) */
int ii, /* 8(sp) */
int pi, /* 10(sp) */
int * contrl, /* 12(sp) */
int * intin, /* 16(sp) */
int * ptsin, /* 20(sp) */
int * intout, /* 24(sp) */
int * ptsout); /* 28(sp) */
typedef struct
{
int x, y, bstate, kstate;
} EVNTDATA;
typedef struct
{
int out,
x,y,
w,h;
} MOBLK;
typedef enum
{
MU_KEYBD =0x0001,
MU_BUTTON=0x0002,
MU_M1 =0x0004,
MU_M2 =0x0008,
MU_MESAG =0x0010,
MU_TIMER =0x0020,
MU_WHEEL =0x0040, /* AES 4.09 & XaAES */
MU_MX =0x0080, /* XaAES */
MU_NORM_KEYBD =0x0100, /* " */
MU_DYNAMIC_KEYBD=0x0200 /* keybd as a bunch of buttons, includes release of key */
} EVENT_TY;
typedef struct /* Ereignisstruktur f<>r EVNT_multi(), Fensterdialoge, etc. */
{
int mwhich;
int mx;
int my;
int mbutton;
int kstate;
int key;
int mclicks;
int reserved[9];
int msg[16];
} EVNT;
typedef struct
{
int contrl[15];
GLOBAL glob; /* keep the word global reserved for lamguage */
int intin[132];
int intout[140];
void * addrin[16];
void * addrout[16];
} GEMPARBLK;
extern GEMPARBLK _GemParBlk;
extern int _app,gl_apid,gl_ap_version;
int vq_aes( void );
/* AESPB is now completely out of sight */
#endif

View File

@@ -0,0 +1,350 @@
/*
GRAPHICS.H
(c) 1992 Pure Software GmbH
*/
#ifndef __GRAPHX_DEF_
#define __GRAPHX_DEF_
enum graphics_errors
{
grOk = 0,
grNoInitGraph = -1,
grNotDetected = -2,
grFileNotFound = -3,
grInvalidDriver = -4,
grNoLoadMem = -5,
grNoScanMem = -6,
grNoFloodMem = -7,
grFontNotFound = -8,
grNoFontMem = -9,
grInvalidMode = -10,
grError = -11,
grIOerror = -12,
grInvalidFont = -13,
grInvalidFontNum = -14,
grInvalidVersion = -18
};
enum graphics_drivers
{
DETECT,
CURRENT_DRIVER = -1,
CGA,
MCGA,
EGA,
EGA64,
EGAMONO,
IBM8514,
HERCMONO,
ATT400,
VGA,
PC3270,
VDI = 256
};
enum graphics_modes
{
CGAC0 = 0,
CGAC1 = 1,
CGAC2 = 2,
CGAC3 = 3,
CGAHI = 4,
MCGAC0 = 0,
MCGAC1 = 1,
MCGAC2 = 2,
MCGAC3 = 3,
MCGAMED = 4,
MCGAHI = 5,
EGALO = 0,
EGAHI = 1,
EGA64LO = 0,
EGA64HI = 1,
EGAMONOHI = 0,
HERCMONOHI = 0,
ATT400C0 = 0,
ATT400C1 = 1,
ATT400C2 = 2,
ATT400C3 = 3,
ATT400MED = 4,
ATT400HI = 5,
VGALO = 0,
VGAMED = 1,
VGAHI = 2,
PC3270HI = 0,
IBM8514LO = 0,
IBM8514HI = 1,
VDIMODE = 0
};
#ifndef __COLORS
#define __COLORS
enum COLORS
{
BLACK,
BLUE,
GREEN,
CYAN,
RED,
MAGENTA,
BROWN,
LIGHTGRAY,
DARKGRAY,
LIGHTBLUE,
LIGHTGREEN,
LIGHTCYAN,
LIGHTRED,
LIGHTMAGENTA,
YELLOW,
WHITE
};
#endif
enum CGA_COLORS
{
CGA_GREEN = 2,
CGA_CYAN = 3,
CGA_RED = 4,
CGA_MAGENTA = 5,
CGA_BROWN = 6,
CGA_LIGHTGRAY = 7,
CGA_LIGHTGREEN = 10,
CGA_LIGHTCYAN = 11,
CGA_LIGHTRED = 12,
CGA_LIGHTMAGENTA = 13,
CGA_YELLOW = 14,
CGA_WHITE = 15
};
enum EGA_COLORS
{
EGA_BLACK = 0,
EGA_BLUE = 1,
EGA_GREEN = 2,
EGA_CYAN = 3,
EGA_RED = 4,
EGA_MAGENTA = 5,
EGA_BROWN = 6,
EGA_LIGHTGRAY = 7,
EGA_DARKGRAY = 8,
EGA_LIGHTBLUE = 9,
EGA_LIGHTGREEN = 10,
EGA_LIGHTCYAN = 11,
EGA_LIGHTRED = 12,
EGA_LIGHTMAGENTA = 13,
EGA_YELLOW = 14,
EGA_WHITE = 15
};
enum line_styles
{
SOLID_LINE = 0,
DOTTED_LINE = 1,
CENTER_LINE = 2,
DASHED_LINE = 3,
USERBIT_LINE = 4
};
enum line_widths
{
NORM_WIDTH = 1,
THICK_WIDTH = 3
};
enum font_names
{
DEFAULT_FONT = 0,
TRIPLEX_FONT = 1,
SMALL_FONT = 2,
SANS_SERIF_FONT = 3,
GOTHIC_FONT = 4
};
#define HORIZ_DIR 0
#define VERT_DIR 1
#define USER_CHAR_SIZE 0
enum fill_patterns
{
EMPTY_FILL,
SOLID_FILL,
LINE_FILL,
LTSLASH_FILL,
SLASH_FILL,
BKSLASH_FILL,
LTBKSLASH_FILL,
HATCH_FILL,
XHATCH_FILL,
INTERLEAVE_FILL,
WIDE_DOT_FILL,
CLOSE_DOT_FILL,
USER_FILL
};
enum putimage_ops
{
COPY_PUT,
XOR_PUT,
OR_PUT,
AND_PUT,
NOT_PUT
};
enum text_just
{
LEFT_TEXT = 0,
CENTER_TEXT = 1,
RIGHT_TEXT = 2,
BOTTOM_TEXT = 0,
TOP_TEXT = 2
};
#define MAXCOLORS 15
struct palettetype
{
unsigned char size;
signed char colors[MAXCOLORS+1];
};
struct linesettingstype
{
int linestyle;
unsigned upattern;
int thickness;
};
struct textsettingstype
{
int font;
int direction;
int charsize;
int horiz;
int vert;
};
struct fillsettingstype
{
int pattern;
int color;
};
struct pointtype
{
int x;
int y;
};
struct viewporttype
{
int left;
int top;
int right;
int bottom;
int clip;
};
struct arccoordstype
{
int x;
int y;
int xstart;
int ystart;
int xend;
int yend;
};
void arc( int x, int y, int stangle, int endangle, int radius );
void bar( int left, int top, int right, int bottom );
void bar3d( int left, int top, int right, int bottom, int depth, int topflag );
void circle( int x, int y, int radius );
void cleardevice( void );
void clearviewport( void );
void closegraph( void );
void detectgraph( int *graphdriver,int *graphmode );
void drawpoly( int numpoints, int *polypoints );
void ellipse( int x, int y, int stangle, int endangle, int xradius, int yradius );
void fillellipse( int x, int y, int xradius, int yradius );
void fillpoly( int numpoints, int *polypoints );
void floodfill( int x, int y, int border );
void getarccoords( struct arccoordstype *arccoords );
void getaspectratio( int *xasp, int *yasp );
int getbkcolor( void );
int getcolor( void );
char *getdrivername( void );
void *getdefaultpalette( void );
void getfillpattern( char *pattern );
void getfillsettings( struct fillsettingstype *fillinfo );
int getgraphmode( void );
void getimage( int left, int top, int right, int bottom, void *bitmap );
void getlinesettings( struct linesettingstype *lineinfo );
int getmaxcolor( void );
int getmaxmode( void );
int getmaxx( void );
int getmaxy( void );
char *getmodename( int mode_number );
void getmoderange( int graphdriver, int *lomode, int *himode );
unsigned int getpixel( int x, int y );
void getpalette( struct palettetype *palette );
int getpalettesize( void );
void gettextsettings( struct textsettingstype *texttypeinfo );
void getviewsettings( struct viewporttype *viewport );
int getx( void );
int gety( void );
void graphdefaults( void );
char *grapherrormsg( int errorcode );
void _graphfreemem( void *ptr, unsigned size );
void *_graphgetmem( unsigned size );
int graphresult( void );
unsigned long imagesize( int left, int top, int right, int bottom );
void initgraph( int *graphdriver, int *graphmode, char *pathtodriver );
int installuserdriver( char *name, int (*detect)( void ));
int installuserfont( char *name );
void line( int x1, int y1, int x2, int y2 );
void linerel( int dx, int dy );
void lineto( int x, int y );
void moverel( int dx, int dy );
void moveto( int x, int y );
void outtext( char *textstring );
void outtextxy( int x, int y, char *textstring );
void pieslice( int x, int y, int stangle, int endangle, int radius );
void putimage( int left, int top, void *bitmap, int op );
void putpixel( int x, int y, int color );
void rectangle( int left, int top, int right, int bottom );
int registerbgidriver( void (*driver)( void ));
int registerbgifont( void (*font)( void ));
void restorecrtmode( void );
void sector( int X, int Y, int StAngle, int EndAngle, int XRadius, int YRadius );
void setactivepage( int page );
void setallpalette( struct palettetype *palette );
void setaspectratio( int xasp, int yasp );
void setbkcolor( int color );
void setcolor( int color );
void setfillpattern( char *upattern, int color );
void setfillstyle( int pattern, int color );
unsigned int setgraphbufsize( unsigned bufsize );
void setgraphmode( int mode );
void setlinestyle( int linestyle, unsigned upattern, int thickness );
void setpalette( int index, int color );
void setrgbpalette( int colornum, int red, int green, int blue );
void settextjustify( int horiz, int vert );
void settextstyle( int font, int direction, int charsize );
void setusercharsize( int multx, int divx, int multy, int divy );
void setviewport( int left, int top, int right, int bottom, int clip );
void setvisualpage( int page );
void setwritemode( int mode );
int textheight( char *textstring );
int textwidth( char *textstring );
void triplex_font( void );
void small_font( void );
void sansserif_font( void );
void gothic_font( void );
#endif

View File

@@ -0,0 +1,38 @@
/* LIMITS.H
Sizes of integral types
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __LIMITS )
#define __LIMITS
#define CHAR_BIT 8
#define SCHAR_MIN (-128)
#define SCHAR_MAX 127
#define UCHAR_MAX 255U
#if ('\x80' < 0)
#define CHAR_MIN (-128)
#define CHAR_MAX 127
#else
#define CHAR_MIN 0
#define CHAR_MAX 255
#endif
#define MB_LEN_MAX 1
#define SHRT_MIN (-32767-1)
#define SHRT_MAX 32767
#define USHRT_MAX 65535U
#define INT_MIN (-32767-1)
#define INT_MAX 32767
#define UINT_MAX 65535U
#define LONG_MIN (-2147483647L-1)
#define LONG_MAX 2147483647L
#define ULONG_MAX 4294967295LU
#endif
/************************************************************************/


View File

@@ -0,0 +1,272 @@
/* LINEA.H
LineA Definitions
Copyright (C) Borland International 1990
All Rights Reserved.
*/
#if !defined( __LINEA__ )
#define __LINEA__
#if !defined( __AES__ )
#include <aes.h> /* for MFORM */
#endif
#define REPLACE 0 /* set_wrt_mode() */
#define TRANS 1
#define XOR 2
#define INVERS 3
#define VDIFM 1 /* sdb.form */
#define XORFM -1
typedef struct
{
int xhot, /* X-Offset */
yhot, /* Y-Offset */
form, /* Format (1 = VDI, -1 = XOR) */
bgcol, /* Hintergrundfarbe */
fgcol, /* Vordergrundfarbe */
image[32]; /* Sprite-Image */
} SDB;
typedef int SSB[10 + 4 * 64];
typedef int PATTERN[16]; /* Bei Bedarf vergr<67><72>ern */
typedef struct fonthdr
{
int id, /* Fontnummer */
size; /* Fontgr<67><72>e in Punkten */
char facename[32]; /* Name */
int ade_lo, /* kleinster ASCII-Wert */
ade_hi, /* gr<67><72>ter ASCII-Wert */
top_dist, /* Abstand Top <-> Baseline */
asc_dist, /* Abstand Ascent <-> Baseline */
hlf_dist, /* Abstand Half <-> Baseline */
des_dist, /* Abstand Descent <-> Baseline */
bot_dist, /* Abstand Bottom <-> Baseline */
wchr_wdt, /* maximale Zeichenbreite */
wcel_wdt, /* maximale Zeichenzellenbreite */
lft_ofst, /* Offset links */
rgt_ofst, /* Offset rechts */
thckning, /* Verbreiterungsfaktor f<>r Bold*/
undrline, /* Dicke der Unterstreichung */
lghtng_m, /* Maske f<>r Light */
skewng_m; /* Maske f<>r Kursiv */
struct
{
unsigned :12; /* Frei */
unsigned mono_spaced : 1; /* Proportional/Monospaced */
unsigned f68000 : 1; /* 8086-/68000 Format */
unsigned hot : 1; /* HOT verwenden */
unsigned system : 1; /* Default system font */
} flags;
char *hz_ofst; /* Horizontal Offset Table */
int *ch_ofst; /* Font-Offset-Tabelle */
void *fnt_dta; /* Zeichensatz-Image */
int frm_wdt, /* Breite des Font-Image */
frm_hgt; /* H<>he des Fonts */
struct fonthdr *next; /* N<>chster Font */
} FONT_HDR;
typedef struct
{
int v_planes, /* # Bitplanes (1, 2 od. 4) */
v_lin_wr, /* # Bytes/Scanline */
*contrl,
*intin,
*ptsin, /* Koordinaten-Eingabe */
*intout,
*ptsout, /* Koordinaten-Ausgabe */
fg_bp_1, /* Plane 0 */
fg_bp_2, /* Plane 1 */
fg_bp_3, /* Plane 2 */
fg_bp_4, /* Plane 3 */
lstlin;
unsigned ln_mask; /* Linienmuster */
int wrt_mode, /* Schreib-Modus */
x1, y1, x2, y2; /* Koordinaten */
void *patptr; /* F<>llmuster */
unsigned patmsk; /* .. dazugeh<65>rige Maske */
int multifill, /* F<>llmuster f<>r Planes */
clip, /* Flag f<>r Clipping */
xmn_clip, ymn_clip,
xmx_clip, ymx_clip, /* Clipping Rechteck */
/* Rest f<>r text_blt: */
xacc_dda,
dda_inc, /* Vergr<67><72>erungsfaktor */
t_sclsts, /* Vergr<67><72>erungsrichtung */
mono_status, /* Proportionalschrift */
sourcex, sourcey, /* Koordinaten im Font */
destx, desty, /* Bildschirmkoordinaten */
delx, dely; /* Breite und H<>he des Zeichen */
FONT_HDR *fbase; /* Start der Font-Daten */
int fwidth, /* Breite des Fontimage */
style; /* Schreibstil */
unsigned litemask, /* Maske f<>r Light */
skewmask; /* Maske f<>r Kursiv */
int weight, /* Breite bei Bold */
r_off, /* Kursiv-Offset rechts */
l_off, /* Kursiv-Offset links */
scale, /* Vergr<67><72>erung ja/nein */
chup, /* Rotationswinkel *10 */
text_fg; /* Textfarbe */
void *scrtchp; /* Buffer */
int scrpt2, /* Index in Buffer */
text_bg, /* unbenutzt */
copy_tran, /* -- */
(*fill_abort)( void ); /* Testet Seed Fill */
} LINEA;
typedef struct
{
long reserved6; /* reserviert (-0x38e) */
FONT_HDR *cur_font; /* Zeiger auf Header akt. Font */
int reserved5[23], /* reserviert */
m_pos_hx, /* X-Koordinate Maus */
m_pos_hy, /* Y-Koordinate Maus */
m_planes, /* Zeichenmodus der Maus */
m_cdb_bg, /* Maus Hintergrundfarbe */
m_cdb_fg, /* Maus Vordergrundfarbe */
mask_form[32], /* Vordergrund und Maske */
inq_tab[45], /* wie vq_extnd() */
dev_tab[45], /* wie v_opnwk() */
gcurx, /* X-Position Maus */
gcury, /* Y-Position Maus */
m_hid_ct, /* Anzahl der hide_mouse-calls */
mouse_bt, /* Status der Mauskn<6B>pfe */
req_col[3][16], /* Interne Daten f<>r vq_color() */
siz_tab[15], /* wie v_opnwk() */
reserved4[2]; /* reserviert */
void *cur_work; /* Attribute der akt. Workstn. */
FONT_HDR *def_font; /* Standard Systemzeichensatz */
FONT_HDR *font_ring[4]; /* Zeichensatzlisten */
int font_count, /* Anzahl der Zeichens<6E>tze */
reserved3[45]; /* reserviert */
char cur_ms_stat, /* Mausstatus */
reserved2; /* reserviert */
int v_hid_cnt, /* Anzahl der Hide_cursor-calls */
cur_x, /* X-Position Maus */
cur_y; /* Y-Position Maus */
char cur_flag, /* != 0: Maus neu zeichnen */
mouse_flag; /* != 0: Maus-Interrupt ein */
long reserved1; /* reserviert */
int v_sav_xy[2], /* gerettete X-Y-Koordinaten */
save_len; /* Anzahl der Bildschirmzeilen */
void *save_addr; /* Erstes Byte im Bildspeicher */
int save_stat; /* Dirty-Flag */
long save_area[4][16]; /* Buffer f<>r Bild unter Maus */
void (*user_tim)( void ); /* Timer-Interrupt-Vektor */
void (*next_tim)( void ); /* alter Interrupt */
void (*user_but)( void ); /* Maustasten-Vektor */
void (*user_cur)( void ); /* Maus-Vektor */
void (*user_mot)( void ); /* Mausbewegungs-Vektor */
int v_cel_ht, /* Zeichenh<6E>he */
v_cel_mx, /* maximale Cursorspalte */
v_cel_my, /* maximale Cursorzeile */
v_cel_wr, /* Characterzeilenbreite */
v_col_bg, /* Hintergrundfarbe */
v_col_fg; /* Vordergrundfarbe */
void *v_cur_ad; /* Adresse der Cursorposition */
int v_cur_off, /* Vertikaler Bildschirmoffset */
v_cur_xy[2]; /* X-Y-Cursor */
char v_period, /* Blinkgeschwindigkeit */
v_cur_ct; /* Z<>hler f<>r Blinken */
void *v_fnt_ad; /* Zeiger auf Font */
int v_fnt_nd, /* gr<67><72>ter ASCII-Wert */
v_fnt_st, /* kleinster ASCII-Wert */
v_fnt_wd, /* Breite des Fontimage in Byte */
v_rez_hz, /* Bildschirmbreite in Pixel */
*v_off_ad, /* Font-Offset-Tabelle */
reserved, /* Cursorflag/reserviert */
v_rez_vt, /* Bildschirmh<6D>he in Pixel */
bytes_lin; /* Bytes pro Pixelzeile */
} VDIESC;
typedef struct
{
int b_wd, /* Breite des Blocks in Pixeln */
b_ht, /* H<>he des Blocks in Pixeln */
plane_ct, /* Anzahl der Farbplanes */
fg_col, /* Vordergrundfarbe */
bg_col; /* Hintergrundfarbe */
char op_tab[4]; /* Verkn<6B>pfung (f<>r jede Plane) */
int s_xmin, /* X-Quellraster */
s_ymin; /* Y-Quellraster */
void *s_form; /* Adresse des Quellrasters */
int s_nxwd, /* Offset zum n<>chsten Wort */
s_nxln, /* Breite des Quellrasters */
s_nxpl, /* Offset zur n<>chsten Plane */
d_xmin, /* X-Zielraster */
d_ymin; /* Y-Zielraster */
void *d_form; /* Adresse des Zielrasters */
int d_nxwd, /* Offset zum n<>chsten Wort */
d_nxln, /* Breite des Quellrasters */
d_nxpl; /* Offset zur n<>chsten Plane */
void *p_addr; /* 16-Bit-Masken zum Undieren */
int p_nxln, /* Breite der Maske in Bytes */
p_nxpl, /* Offset zur n<>chsten Plane */
p_mask; /* H<>he der Maske in Zeilen */
char filler[24]; /* Interner Buffer */
} BITBLT;
typedef struct
{
FONT_HDR *font[3];
} FONTS;
typedef struct
{
int (*funp[16])( void );
} LINEA_FUNP;
void linea_init( void );
void put_pixel( int x, int y, int color );
int get_pixel( int x, int y );
void draw_line(int x1, int y1, int x2, int y2);
/* set_fg_bp(), set_ln_mask(), set_wrt_mode() */
void horizontal_line( int x1, int y1, int x2 );
/* set_fg_bp(), set_wrt_mode(), set_pattern() */
void filled_rect( int x1, int y1, int x2, int y2 );
/* set_fg_bp(), set_wrt_mode(), set_pattern(), set_clipping() */
void filled_polygon( int *xy, int count );
/* set_fg_bp(), set_wrt_mode(), set_pattern(), set_clipping() */
void bit_blt(BITBLT *bitblt);
void text_blt( int x, int y, unsigned char c );
/* set_txtblt() */
void show_mouse( int flag );
void hide_mouse( void );
void transform_mouse( MFORM *mform );
void undraw_sprite( SSB *ssb );
void draw_sprite( int x, int y, SDB *sdb, SSB *ssb );
void copy_raster( void ); /* 14, COPY RASTER FORM */
void seed_fill( void ); /* 15, SEED FILL */
/* WARNING: 14 & 15 are NOT supported ! */
void set_fg_bp( int auswahl );
void set_ln_mask( int mask );
void set_wrt_mode( int modus );
void set_pattern( int *pattern, int mask, int multifill );
void set_clip( int x1, int y1, int x2, int y2, int modus );
void set_text_blt( FONT_HDR *font, int scale, int style, int chup,
int text_fg, int text_bg );
void draw_circle( int x, int y, int radius, int color );
void print_string( int x, int y, int xoff, char *string );
extern LINEA *Linea;
extern VDIESC *Vdiesc;
extern FONTS *Fonts;
extern LINEA_FUNP *Linea_funp;
#endif
/**************************************************************************/


View File

@@ -0,0 +1,403 @@
/*
* MATH.H Math functionality for AHCC & PURE_C
*/
#if ! defined MATH_H
#define MATH_H
#ifdef __NO_FLOAT__
#error floating point not implemented by this compiler
#else
#if __ABC__ || __AHCC__
#define FMATH_H
#define operator __OP__
#define cast __UC__
typedef double FpF(double);
typedef double FpFF(double,double);
FpF ceil, floor;
#ifndef __68881__
FpF sin,cos,tan,asin,acos,atan,log,log10,log2,sqrt,
exp,sinh,asinh,cosh,acosh,tanh,atanh,fabs,
getexp,getman;
/* Of course the following is NON C
* The ANSI standard tells us that standard headers are completely
* implementor defined as long as their function complies the standard.
* They need not even be files at all.
* #include <name> however is the standerd way to invoke them.
* Every implementor has its own way to deal with extracode software.
* I too do it my way.
* Basicly I borrowed this from Algol68, long before I ever heard of C,
* or even C++.
*/
/* ahcc puts every next declaration in front of the table!!
So it is recommended to put these declarations
in ascending order of frequency.
Put the most frequent at the end.
*/
#define __IEEE__
double operator * (double,double) XXmul,
operator / (double,double) XXdiv,
/* operator % (double,double) XXrem, */
operator + (double,double) XXadd,
operator - (double,double) XXsub,
operator - (double) Xneg;
bool operator ! (double) Xnot,
operator < (double,double) XXcmp,
operator > (double,double) XXcmp,
operator <= (double,double) XXcmp,
operator >= (double,double) XXcmp,
operator == (double,double) XXcmp,
operator != (double,double) XXcmp;
unsigned
long cast(double) Xlcnv;
int cast(double) Xlcnv;
unsigned
int cast(double) Xlcnv;
char cast(double) Xlcnv;
unsigned
char cast(double) Xlcnv;
float cast(double) Xfcnv;
long cast(double) Xlcnv;
double cast(float) fXcnv,
cast(unsigned long) ulXcnv,
cast(unsigned int) uiXcnv,
cast(unsigned char) uiXcnv,
cast(char) iXcnv,
cast(int) iXcnv,
cast(long) lXcnv;
#ifdef __IEEE__ /* if allready determined */
/* in fact this is determined by the called software itself,
so here are the names */
float operator * (float,float) FFmul,
operator / (float,float) FFdiv,
/* operator % (float,float) FFrem, */
operator + (float,float) FFadd,
operator - (float,float) FFsub,
operator - (float) Fneg;
bool operator ! (float) Fnot,
operator < (float,float) FFcmp,
operator > (float,float) FFcmp,
operator <= (float,float) FFcmp,
operator >= (float,float) FFcmp,
operator == (float,float) FFcmp,
operator != (float,float) FFcmp;
unsigned
long cast(float) _Flcnv;
int cast(float) _Flcnv;
unsigned
int cast(float) _Flcnv;
char cast(float) _Flcnv;
unsigned
char cast(float) _Flcnv;
long cast(float) _Flcnv;
float cast(unsigned long) _ulFcnv,
cast(unsigned) _uiFcnv,
cast(char) _iFcnv, /* char on stack becomes int */
cast(int) _iFcnv,
cast(long) _lFcnv;
#else
/* here are the old SOZOBON names.
I know some names dont really exist, but this how
it should be done and the missing ones can
be added anytime. */
float operator * (float,float) fpmul,
operator / (float,float) fpdiv,
/* operator % (float,float) fprem, */
operator + (float,float) fpadd,
operator - (float,float) fpsub,
operator - (float) fpneg;
bool operator ! (float) fpnot,
operator < (float,float) fpcmp,
operator > (float,float) fpcmp,
operator <= (float,float) fpcmp,
operator >= (float,float) fpcmp,
operator == (float,float) fpcmp,
operator != (float,float) fpcmp;
unsigned
long cast(float) _fpftol;
int cast(float) _fpftol;
unsigned
int cast(float) _fpftol;
char cast(float) _fpftol;
unsigned
char cast(float) _fpftol;
long cast(float) _fpftol;
float cast(unsigned long) _fpultof,
cast(unsigned) _fpuitof,
cast(char) _fpitof, /* char on stack becomes int */
cast(int) _fpitof,
cast(long) _fpltof;
#endif
#else /* if FPU, built in monadic operators (compiler opt -8) */
#define fabs(f) __FABS__(f)
#define trunc(f) __FINTRZ__(f)
#define fint(f) __FINT__(f)
#define sqrt(f) __FSQRT__(f)
#define fintrz(f) __FINTRZ__(f)
#if ! __COLDFIRE__
#define sin(f) __FSIN__(f)
#define cos(f) __FCOS__(f)
#define tan(f) __FTAN__(f)
#define asin(f) __FASIN__(f)
#define acos(f) __FACOS__(f)
#define atan(f) __FATAN__(f)
#define fetoxm1(f) __FETOXM1__(f)
#define log(f) __FLOGN__(f)
#define flognp1(f) __FLOGNP1__(f)
#define log2(f) __FLOG2__(f)
#define log10(f) __FLOG10__(f)
#define fneg(f) __FNEG__(f)
#define exp(f) __FETOX__(f)
#define sinh(f) __FSINH__(f)
#define cosh(f) __FCOSH__(f)
#define tanh(f) __FTANH__(f)
#define atanh(f) __FATANH__(f)
#define fgetexp(f) __FGETEXP__(f)
#define fgetman(f) __FGETMAN__(f)
#define pow10(f) __FTENTOX__(f)
#define pow2(f) __FTWOTOX__(f)
#else
double atof(const char *);
double ldexp(double b, int n);
double frexp(double b, int *ip);
double modf(double b, double *op);
double fmod( double x, double y );
double cos( double x );
double sin( double x );
double tan( double x );
double acos( double x );
double asin( double x );
double atan( double x );
double cosh( double x );
double sinh( double x );
double tanh( double x );
double atanh( double x );
double log10( double x );
double log2( double x );
double log ( double x );
double exp ( double x );
double pow10( int i );
double pow2 ( double x );
#endif
#endif
FpFF atan2,pow,fmod;
FpF asinh, acosh;
double ldexp(double b, int n);
double frexp(double b, int *ip);
double modf(double b, double *op);
/* Some useful constants, generally to 21 digits */
#define M_E 2.71828182845904523536
#define M_LOG2E 1.44269504088896340736
#define M_LOG10E 0.434294481903251827651
#define M_LN2 0.693147180559945309417
#define M_LN10 2.30258509299404568402
#define M_PI 3.14159265358979323846
#define M_PI_2 1.57079632679489661923
#define M_PI_4 0.785398163397448309116
#define M_1_PI 0.318309886183790671538
#define M_2_PI 0.636619772367581343076
#define M_1_SQRTPI 0.564189583547756286948
#define M_2_SQRTPI 1.12837916709551257390
#define M_SQRT2 1.41421356237309504880
#define M_SQRT_2 0.707106781186547524401
#if __COLDFIRE__
#define MAXREAL (double)1.79769313486232E+308 /* 64 bits */
#else
#define MAXREAL (double)1.189731495357231765E+4932 /* 80 bits */
#endif
#define HUGE_VAL MAXREAL
#define _ABS(x) ((x) < 0 ? -(x) : (x))
#undef operator
#undef cast
#else /* not AHCC */
/* MATH.H
Mathematical Definition Includes
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#define __MATH
#if __COLDFIRE__
#define HUGE_VAL 1.79769313486232E+308 /* 64 bits */
#else
#define HUGE_VAL 1.189731495357231765E+4932 /* 80 bits */
#endif
#define M_E 2.71828182845904523536
#define M_LOG2E 1.44269504088896340736
#define M_LOG10E 0.434294481903251827651
#define M_LN2 0.693147180559945309417
#define M_LN10 2.30258509299404568402
#define M_PI 3.14159265358979323846
#define M_PI_2 1.57079632679489661923
#define M_PI_4 0.785398163397448309116
#define M_1_PI 0.318309886183790671538
#define M_2_PI 0.636619772367581343076
#define M_1_SQRTPI 0.564189583547756286948
#define M_2_SQRTPI 1.12837916709551257390
#define M_SQRT2 1.41421356237309504880
#define M_SQRT_2 0.707106781186547524401
double fabs( double x );
double ceil( double x );
double floor( double x );
/* double round( double x ); */
double trunc( double x );
double fmod( double x, double y );
double exp( double x );
double log( double x );
double log2( double x );
double log10( double x );
double frexp( double x, int *nptr );
double ldexp( double x, int n );
double modf( double x, double *nptr );
double pow( double x, double y );
double pow10( int i );
double pow2( double i );
double sqrt( double x );
double cos( double x );
double sin( double x );
double tan( double x );
void sincos( double x, double *sin, double *cos );
double acos( double x );
double asin( double x );
double atan( double x );
double atan2( double x, double y );
double cosh( double x );
double sinh( double x );
double tanh( double x );
double acosh( double x );
double asinh( double x );
double atanh( double x );
double pow( double x, double y );
short ftoa( double *x, char *resStr, short ndig, short format,
short *decPnt, short *sign );
double atof( const char *digStr );
typedef enum
{
DOMAIN = 1, /* argument domain error -- log (-1) */
SING, /* argument singularity -- pow (0,-2)) */
OVERFLOW, /* overflow range error -- exp (1000) */
UNDERFLOW /* underflow range error -- exp (-1000) */
} mexcep;
struct exception
{
mexcep type;
char *name;
double arg1;
double arg2;
double retval;
};
void setmatherr( short (*errorfunc)( struct exception *e ) );
short fpumode( short dis );
void xdcnv( double *val, void *rep8bytes );
void dxcnv( void *rep8bytes, double *val );
#if defined( __68881__ )
double fint( double x );
double fintrz( double x );
double fgetexp( double x );
double fgetman( double x );
double frem( double x, double y );
double fsgldiv( double x, double y );
double fsglmul( double x, double y );
double fetoxm1( double x );
double flognp1( double x );
double pow2( double x );
#endif
#if defined( __68881__ ) && !defined( __NFPUIN__ )
/* MC68881 extensions */
/* Arithmetische Befehle: */
#define trunc( x ) __FINTRZ__( x )
#define fabs( x ) __FABS__( x )
#define fgetexp( x ) __FGETEXP__( x )
#define fgetman( x ) __FGETMAN__( x )
#define fint( x ) __FINT__( x )
#define fintrz( x ) __FINTRZ__( x )
#define fmod( x, y ) __FMOD__( y, x )
#define frem( x, y ) __FREM__( y, x )
#define ldexp( x, y ) __FSCALE__( y, x )
#define fsgldiv( x, y ) __FSGLDIV__( y, x )
#define fsglmul( x, y ) __FSGLMUL__( y, x )
/* Potenzen und Logarithmen: */
#define exp( x ) __FETOX__( x )
#define fetoxm1( x ) __FETOXM1__( x )
#define log( x ) __FLOGN__( x )
#define flognp1( x ) __FLOGNP1__( x )
#define log10( x ) __FLOG10__( x )
#define log2( x ) __FLOG2__( x )
#define sqrt( x ) __FSQRT__( x )
#define pow10( x ) __FTENTOX__( x )
#define pow2( x ) __FTWOTOX__( x )
/* Trigonometrie: */
#define acos( x ) __FACOS__( x )
#define asin( x ) __FASIN__( x )
#define atan( x ) __FATAN__( x )
#define cos( x ) __FCOS__( x )
#define sin( x ) __FSIN__( x )
#define tan( x ) __FTAN__( x )
/* Hyperbelfunktionen: */
#define atanh( x ) __FATANH__( x )
#define cosh( x ) __FCOSH__( x )
#define sinh( x ) __FSINH__( x )
#define tanh( x ) __FTANH__( x )
/* Conversionsfunktionen nur f<>r TC881LIB.LIB */
double x80x96cnv( void *rep10bytes );
void x96x80cnv( double rep12bytes, void *rep10bytes );
#endif
#endif /* __ABC__ || __AHCC__ */
#endif /* __NO_FLOAT__ */
#endif /* MATH_H */

View File

@@ -0,0 +1,166 @@
/* MATH.H
Mathematical Definition Includes
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __MATH )
#define __MATH
#ifdef __NO_FLOAT__
#error floating point not implemented by this compiler
#else
#define HUGE_VAL 1.189731495357231765E+4932
#define M_E 2.71828182845904523536
#define M_LOG2E 1.44269504088896340736
#define M_LOG10E 0.434294481903251827651
#define M_LN2 0.693147180559945309417
#define M_LN10 2.30258509299404568402
#define M_PI 3.14159265358979323846
#define M_PI_2 1.57079632679489661923
#define M_PI_4 0.785398163397448309116
#define M_1_PI 0.318309886183790671538
#define M_2_PI 0.636619772367581343076
#define M_1_SQRTPI 0.564189583547756286948
#define M_2_SQRTPI 1.12837916709551257390
#define M_SQRT2 1.41421356237309504880
#define M_SQRT_2 0.707106781186547524401
double fabs( double x );
double ceil( double x );
double floor( double x );
double round( double x );
double trunc( double x );
double fmod( double x, double y );
double exp( double x );
double log( double x );
double log10( double x );
double frexp( double x, int *nptr );
double ldexp( double x, int n );
double modf( double x, double *nptr );
double pow( double x, double y );
double pow10( int i );
double sqrt( double x );
double cos( double x );
double sin( double x );
double tan( double x );
void sincos( double x, double *sin, double *cos );
double acos( double x );
double asin( double x );
double atan( double x );
double atan2( double x, double y );
double cosh( double x );
double sinh( double x );
double tanh( double x );
double acosh( double x );
double asinh( double x );
double atanh( double x );
int ftoa( double *x, char *resStr, int ndig, int format,
int *decPnt, int *sign );
double atof( const char *digStr );
typedef enum
{
DOMAIN = 1, /* argument domain error -- log (-1) */
SING, /* argument singularity -- pow (0,-2)) */
OVERFLOW, /* overflow range error -- exp (1000) */
UNDERFLOW /* underflow range error -- exp (-1000) */
} mexcep;
struct exception
{
mexcep type;
char *name;
double arg1;
double arg2;
double retval;
};
void setmatherr( int (*errorfunc)( struct exception *e ) );
int fpumode( int disable );
void xdcnv( double *val, void *rep8bytes );
void dxcnv( void *rep8bytes, double *val );
#if defined( __68881__ )
double fint( double x );
double fintrz( double x );
double fgetexp( double x );
double fgetman( double x );
double frem( double x, double y );
double fsgldiv( double x, double y );
double fsglmul( double x, double y );
double fetoxm1( double x );
double flognp1( double x );
double pow2( double x );
#endif
#if defined( __68881__ ) && !defined( __NFPUIN__ )
/* MC68881 extensions */
/* Arithmetische Befehle: */
#define trunc( x ) __FINTRZ__( x )
#define fint( x ) __FINT__( x )
#define fintrz( x ) __FINTRZ__( x )
#define fabs( x ) __FABS__( x )
#define sqrt( x ) __FSQRT__( x )
#if ! __COLDFIRE__
#define fgetexp( x ) __FGETEXP__( x )
#define fgetman( x ) __FGETMAN__( x )
/* #define fmod( x, y ) __FMOD__( y, x )
*/ #define frem( x, y ) __FREM__( y, x )
/* #define ldexp( x, y ) __FSCALE__( y, x )
*/ #define fsgldiv( x, y ) __FSGLDIV__( y, x )
#define fsglmul( x, y ) __FSGLMUL__( y, x )
/* Potenzen und Logarithmen: */
#define exp( x ) __FETOX__( x )
#define fetoxm1( x ) __FETOXM1__( x )
#define log( x ) __FLOGN__( x )
#define flognp1( x ) __FLOGNP1__( x )
#define log10( x ) __FLOG10__( x )
#define log2( x ) __FLOG2__( x )
#define pow10( x ) __FTENTOX__( x )
#define pow2( x ) __FTWOTOX__( x )
/* Trigonometrie: */
#define acos( x ) __FACOS__( x )
#define asin( x ) __FASIN__( x )
#define atan( x ) __FATAN__( x )
#define cos( x ) __FCOS__( x )
#define sin( x ) __FSIN__( x )
#define tan( x ) __FTAN__( x )
/* Hyperbelfunktionen: */
#define atanh( x ) __FATANH__( x )
#define cosh( x ) __FCOSH__( x )
#define sinh( x ) __FSINH__( x )
#define tanh( x ) __FTANH__( x )
#endif
/* Conversionsfunktionen nur f<>r TC881LIB.LIB */
double x80x96cnv( void *rep10bytes );
void x96x80cnv( double rep12bytes, void *rep10bytes );
#endif
#endif
#endif
/************************************************************************/


View File

@@ -0,0 +1,202 @@
/* signal handling */
#include <trap.h>
#ifndef __NINT_H
#define __NINT_H
#define NSIG 31 /* number of signals recognized */
#ifndef _SIGNAL_H
#define _SIGNAL_H
#define SIGNULL 0 /* not really a signal */
#define SIGHUP 1 /* hangup signal */
#define SIGINT 2 /* sent by ^C */
#define SIGQUIT 3 /* quit signal */
#define SIGILL 4 /* illegal instruction */
#define SIGTRAP 5 /* trace trap */
#define SIGABRT 6 /* abort signal */
#define SIGPRIV 7 /* privilege violation */
#define SIGFPE 8 /* divide by zero */
#define SIGKILL 9 /* cannot be ignored */
#define SIGBUS 10 /* bus error */
#define SIGSEGV 11 /* illegal memory reference */
#define SIGSYS 12 /* bad argument to a system call */
#define SIGPIPE 13 /* broken pipe */
#define SIGALRM 14 /* alarm clock */
#define SIGTERM 15 /* software termination signal */
#define SIGURG 16 /* urgent condition on I/O channel */
#define SIGSTOP 17 /* stop signal not from terminal */
#define SIGTSTP 18 /* stop signal from terminal */
#define SIGCONT 19 /* continue stopped process */
#define SIGCHLD 20 /* child stopped or exited */
#define SIGTTIN 21 /* read by background process */
#define SIGTTOU 22 /* write by background process */
#define SIGIO 23 /* I/O possible on a descriptor */
#define SIGXCPU 24 /* CPU time exhausted */
#define SIGXFSZ 25 /* file size limited exceeded */
#define SIGVTALRM 26 /* virtual timer alarm */
#define SIGPROF 27 /* profiling timer expired */
#define SIGWINCH 28 /* window size changed */
#define SIGUSR1 29 /* user signal 1 */
#define SIGUSR2 30 /* user signal 2 */
#define SIG_DFL 0 /* default signal handler */
#define SIG_IGN 1 /* ignore the signal */
#endif
/* file types */
#ifndef S_IFMT
#define S_IFMT 0170000 /* mask to select file type */
#define S_IFCHR 0020000 /* BIOS special file */
#define S_IFDIR 0040000 /* directory file */
#define S_IFREG 0100000 /* regular file */
#define S_IFIFO 0120000 /* FIFO */
#define S_IMEM 0140000 /* memory region or process */
#define S_IFLNK 0160000 /* symbolic link */
/* special bits: setuid, setgid, sticky bit */
#define S_ISUID 0004000
#define S_ISGID 0002000
#define S_ISVTX 0001000
/* file access modes for user, group, and other*/
#define S_IRUSR 0000400
#define S_IWUSR 0000200
#define S_IXUSR 0000100
#define S_IRGRP 0000040
#define S_IWGRP 0000020
#define S_IXGRP 0000010
#define S_IROTH 0000004
#define S_IWOTH 0000002
#define S_IXOTH 0000001
#define DEFAULT_DIRMODE (0777)
#if 0
#define DEFAULT_MODE (0666)
#endif
typedef struct
{
long msg1;
long msg2;
int pid;
} __MSG;
typedef struct xattr
{
unsigned int mode;
long index;
unsigned int dev;
unsigned int rdev; /* "real" device */
unsigned int nlink;
unsigned int uid;
unsigned int gid;
long size;
long blksize;
long nblocks;
unsigned int mtime, mdate;
unsigned int atime, adate;
unsigned int ctime, cdate;
int attr;
} XATTR;
#define SA_NOCLDSTOP 1
typedef struct
{
void (*sa_handler)( long sig );
long sa_mask;
int sa_flags;
} SIGACTION;
int GEMDOS(0xff) Syield(void);
int GEMDOS(0x100) Fpipe( int *usrh );
int GEMDOS(0x104) Fcntl( int f, long arg, int cmd );
long GEMDOS(0x105) Finstat( int f );
long GEMDOS(0x106) Foutstat( int f );
long GEMDOS(0x107) Fgetchar( int f, int mo );
long GEMDOS(0x108) Fputchar( int f, long c, int mo );
long GEMDOS(0x109) Pwait( void );
int GEMDOS(0x10a) Pnice( int delta );
int GEMDOS(0x10b) Pgetpid( void );
int GEMDOS(0x10c) Pgetppid( void );
int GEMDOS(0x10d) Pgetpgrp( void );
int GEMDOS(0x10e) Psetpgrp( int pid, int newgrp );
int GEMDOS(0x10f) Pgetuid( void );
int GEMDOS(0x110) Psetuid( int id );
int GEMDOS(0x111) Pkill( int pid, int sig );
int GEMDOS(0x113) Pvfork( void );
int GEMDOS(0x114) Pgetgid( void );
int GEMDOS(0x115) Psetgid( int id );
long GEMDOS(0x116) Psigblock( long mask );
long GEMDOS(0x117) Psigsetmask( long mask );
long GEMDOS(0x118) Pusrval( long arg );
void GEMDOS(0x11a) Psigreturn( void );
int GEMDOS(0x11b) Pfork( void );
long GEMDOS(0x11c) Pwait3( int flag, long *rusage );
int GEMDOS(0x11d) Fselect( unsigned int timeout, long *rfds, long *wfds, long *xfds );
void GEMDOS(0x11e) Prusage( long *r );
long GEMDOS(0x11f) Psetlimit( int lim, long value );
long GEMDOS(0x120) Talarm( long secs );
void GEMDOS(0x121) Pause( void );
long GEMDOS(0x122) Sysconf( int n );
long GEMDOS(0x123) Psigpending( void );
long GEMDOS(0x124) Dpathconf( const char * name, int n );
long GEMDOS(0x125) Pmsg( int mo, long mbox, __MSG *msg );
long GEMDOS(0x126) Fmidipipe( int pid, int in, int out );
int GEMDOS(0x127) Prenice( int pid, int delta );
long GEMDOS(0x128) Dopendir( const char *name, int flag );
long GEMDOS(0x129) Dreaddir( int buflen, long dir, char *buf );
long GEMDOS(0x12a) Drewinddir( long dir );
long GEMDOS(0x12b) Dclosedir( long dir );
long GEMDOS(0x12c) Fxattr( int flag, const char *name, XATTR *buf );
long GEMDOS(0x12d) Flink( char *oldname, char *newname );
long GEMDOS(0x12e) Fsymlink( char *oldname, char *newname );
long GEMDOS(0x12f) Freadlink( int size, char *buf, char *name );
long GEMDOS(0x130) Dcntl( int cmd, char *name, long arg );
long GEMDOS(0x131) Fchown( char *name, int uid, int gid );
long GEMDOS(0x132) Fchmod( char *name, int mo );
long GEMDOS(0x133) Pumask( unsigned int mo );
long GEMDOS(0x134) Psemaphore( int mo, long id, long timeout );
long GEMDOS(0x135) Dlock( int mo, int drive );
void GEMDOS(0x136) Psigpause( unsigned long mask );
long GEMDOS(0x137) Psigaction( int sig, SIGACTION *act, SIGACTION *oact );
int GEMDOS(0x138) Pgeteuid( void );
int GEMDOS(0x139) Pgetegid( void );
long GEMDOS(0x13b) Dgetcwd( char *path, int drv, int size );
long GEMDOS(0x13a) Pwaitpid( int pid, int flag, long *rusage );
long GEMDOS(0x13c) Salert(char *msg);
/* The following are not yet official...
long GEMDOS(0x13d) Tmalarm( long secs );
long GEMDOS(0x13e) Psigintr( int vec, int sig);
long GEMDOS(0x13f) Suptime( long *uptime, long *avenrun);
long GEMDOS(0x142) Dxreaddir( int len, long handle, char * buf, long xattr, long *xret );
int GEMDOS(0x143) Dseteuid( int id );
int GEMDOS(0x144) Dsetegid( int id );
int GEMDOS(0x145) Dsetauid( int id );
int GEMDOS(0x146) Dgetauid( int id );
long GEMDOS(0x147) Pgetgroups( int gidsetlen, _GID_T *gidset );
long GEMDOS(0x148) Psetgroups( int gidsetlen, _GID_T *gidset );
long GEMDOS(0x149) Tsetitimer( int which, long *interval, long *value, long *ointerval, long *ovalue );
int GEMDOS(0x14e) Psetreuid( int rid, int eid );
int GEMDOS(0x14f) Psetregid( int rid, int eid );
long GEMDOS(0x150) Sync( void );
void GEMDOS(0x151) Shutdown( long restart );
char * GEMDOS(0x152) Dreadlabel( char *path, char *label, int maxlen );
char * GEMDOS(0x153) Dwritelabel( char *path, char *label);
long GEMDOS(0x154) Ssystem(int mode, long arg1, long arg2);
#define Ssystem(mode, arg1, arg2) Ssystem(mode, (long)(arg1), (long)(arg2))
long GEMDOS(0x155) Tgettimeofday(long tvp, long tzp);
#define Tgettimeofday(tvp, tzp) Tgettimeofday((long)tvp, (long)tzp)
long GEMDOS(0x156) Tsettimeofday(long tvp, long tzp);
#define Tsettimeofday(tvp, tzp) Tsettimeofday((long)tvp, (long)tzp)
long GEMDOS(0x158) Pgetpriority(int which, int who);
long GEMDOS(0x159) Psetpriority(int which, int who, int pri);
*/
#endif /* S_IFMT */
#endif

View File

@@ -0,0 +1,36 @@
/*
* BASEPAGE.H Definition of the basepage structure
*/
#ifndef _MINT_BASEPAGE_H
# define _MINT_BASEPAGE_H 1
#ifndef _FEATURES_H
# include <features.h>
#endif
__BEGIN_DECLS
typedef struct basep {
char *p_lowtpa; /* pointer to self (bottom of TPA) */
char *p_hitpa; /* pointer to top of TPA + 1 */
char *p_tbase; /* base of text segment */
long p_tlen; /* length of text segment */
char *p_dbase; /* base of data segment */
long p_dlen; /* length of data segment */
char *p_bbase; /* base of BSS segment */
long p_blen; /* length of BSS segment */
char *p_dta; /* (UNOFFICIAL, DON'T USE) */
struct basep *p_parent; /* pointer to parent's basepage */
char *p_reserved; /* reserved for future use */
char *p_env; /* pointer to environment string */
char p_junk[8];
long p_undef[18]; /* scratch area... don't touch */
char p_cmdlin[128]; /* command line image */
} BASEPAGE;
extern BASEPAGE *_base;
__END_DECLS
#endif /* _MINT_BASEPAGE_H */

View File

@@ -0,0 +1,569 @@
#ifndef _cookie_h_
#define _cookie_h_
/* This cookie list was generated from cookie.dat (Kelly's MiNT-Setter) */
/* Some defines had had to be renamed because some cookie names containing */
/* 'non-define-able' characters. For this special characters '_' were */
/* inserted (e.g. LP/2 -> C_LP_2, UN*X -> C_UN_X) */
#define C_3DMN 0x33444D4EL /* 3D-Menu */
#define C_3RDB 0x33524442L /* Third Button */
#define C_60Hz 0x3630487AL /* 60Hz resident */
#define C_A2sv 0x41327376L /* Trapsave */
#define C_ACCS 0x41434353L /* ACC.PRG */
#define C_AFnt 0x41466E74L /* AES Font Loader */
#define C_AgK0 0x41674B30L /* AusGuck RAMdisk */
#define C_AHVR 0x41485652L /* VRAM */
#define C_ALHP 0x414C4850L /* Alman HP Deskjet Screendumper */
#define C_ALIC 0x414C4943L /* Alice */
#define C_ALRM 0x414C524DL /* Driver for DIGIFON TDS3000 */
#define C_AmAN 0x416D414EL /* A-MAN */
#define C_AMC1 0x414D4331L /* Monitor Switchbox */
#define C_AMC2 0x414D4332L /* PC Keyboard Driver Software */
#define C_ANSe 0x414E5365L /* ANSI-Emulation */
#define C_APGM 0x4150474DL /* SysGem by Andreas Pietsch */
#define C_ARTS 0x41525453L /* Screen-Artist screensaver */
#define C_asGT 0x61734754L /* Wacom Graphiktablett Driver */
#define C_ASum 0x4153756DL /* ASUNLENK */
#define C_AVmw 0x41566D77L /* Virus Warning Program */
#define C_AVOJ 0x41564F4AL /* Oliver Joppich's Anti Virus program */
#define C_BASH 0x42415348L /* Bourne Again Shell */
#define C_BBD2 0x42424432L /* Bastel-Bus-Treiber V2.xx */
#define C_BCKW 0x42434B57L /* BackWard */
#define C_BGEM 0x4247454DL /* BubbleGEM */
#define C_BGHD 0x42474844L /* BubbleGEM-Help-D<>mon */
#define C_BHdl 0x4248646CL /* BadHandle */
#define C_BHLP 0x42484C50L /* BubbleGEM Konficookie */
#define C_BIGS 0x42494753L /* Big Screen */
#define C_BIOC 0x42494F43L /* Pirosca */
#define C_BLNK 0x424C4E4BL /* Screenblanker */
#define C_BLOW 0x424C4F57L /* Blowup030 */
#define C_BSIM 0x4253494DL /* Drive B Simulator */
#define C_BUG1 0x42554731L /* Bugaboo Debugger */
#define C_C24P 0x43323450L /* CyRel 24Bit-Patch */
#define C_CACH 0x43414348L /* Cache-Control */
#define C_CALD 0x43414C44L /* Computer Aided Loudspeaker Desgin */
#define C_CASE 0x43415345L /* Casing Type Gemini */
#define C_CatS 0x43617453L /* CatStick */
#define C_CaTT 0x43615454L /* CyRel Cattamaran */
#define C_CB2K 0x4342324BL /* Claus Brod GEMDOS Bug Patch */
#define C_CBCE 0x43424345L /* Claus Brod Critical Error Handler Patch */
#define C_CBDF 0x43424446L /* Claus Brod Dabbel Feature */
#define C_CBHD 0x43424844L /* Claus Brod HD Driver */
#define C_CBHY 0x43424859L /* Claus Brod Hyper Format */
#define C_CBIT 0x43424954L /* C'T Bus Interface Driver */
#define C_CCDA 0x43434441L /* Tempus Word */
#define C_cdMC 0x63644D43L /* CDROM.XFS */
#define C_CFIX 0x43464958L /* Console Fix */
#define C_CFsl 0x4346736CL /* Compo FSel */
#define C_CHAM 0x4348414DL /* Chameleon */
#define C_CHN1 0x43484E31L /* Changes */
#define C_CHNG 0x43484E47L /* Changes */
#define C_CHTW 0x43485457L /* Chatwin */
#define C_CISY 0x43495359L /* CISYSTEM */
#define C_CISY 0x43495359L /* Cisystem */
#define C_CJAR 0x434A4152L /* Cookie.prg */
#define C_CJar 0x434A6172L /* JarXXX Program */
#define C_CKBD 0x434B4244L /* Composed Character Deluxe Keyboard Driver */
#define C_CKJR 0x434B4A52L /* Create Cookie Jar Program */
#define C_CLCK 0x434C434BL /* Mega-ST Hardware clock TSR Utilities */
#define C_CLK1 0x434C4B31L /* MEGA ST Clock Utility */
#define C_CLOK 0x434C4F4BL /* CLOK for GMT settings (?) */
#define C_CM16 0x434D3136L /* CyReL's M16 Versatile Installation Program */
#define C_CNTS 0x434E5453L /* CentScreen */
#define C_COLO 0x434F4C4FL /* Colos Mono-Colour Converter */
#define C_CPSL 0x4350534CL /* Caps Lock Display */
#define C_CRAC 0x43524143L /* Protar HD Driver */
#define C_CRIT 0x43524954L /* Crypt-It */
#define C_CSMD 0x43534D44L /* CyReL's Serial Mouse Manager */
#define C_CT60 0x43543630L /* CT60 present */
#define C_CTCH 0x43544348L /* Master-Module Catch.mmx */
#define C_CtCp 0x43744370L /* CapsLock Display */
#define C_CTSF 0x43545346L /* CTS Bug Fix */
#define C_cVDI 0x63564449L /* CyReL's M-16-1280 VDI Driver */
#define C_CWCo 0x4357436FL /* Compo FSel */
#define C_DATE 0x44415445L /* Led Panel Date */
#define C_DATL 0x4441544CL /* TwiLight */
#define C_DAWN 0x4441574EL /* Before Dawn */
#define C_DBFX 0x44424658L /* Diabalo Emulator patch fix for MiNT */
#define C_DCdd 0x44436464L /* Double-Click Software Data Diet */
#define C_DCF7 0x44434637L /* DCF77 */
#define C_DECD 0x44454344L /* DECDriver Cookie */
#define C_DEPI 0x44455049L /* DeskPic */
#define C_DHST 0x44485354L /* Document History Protocol */
#define C_DIG2 0x44494732L /* Digiplay by Emmanuel Jaccard */
#define C_DJBX 0x444A4258L /* DeskJet-Init BIOS-Erweiterung */
#define C_DKEY 0x444B4559L /* Dead Key from Brainstorm */
#define C_DNTR 0x444E5452L /* DNT ramdisk */
#define C_DPRS 0x44505253L /* Printer Buffer */
#define C_DRIV 0x44524956L /* Drive Edit */
#define C_DRRH 0x44525248L /* Wodan Keyboard Layout Program */
#define C_Dsel 0x4473656CL /* Dsel - Systemkern f<>r Fileselector */
#define C_DSSO 0x4453534FL /* Sokrates Keyboard Driver */
#define C_DYJA 0x44594A41L /* CCONRS.PRG */
#define C_DYJD 0x44594A44L /* Dosound */
#define C_DYJT 0x44594A54L /* ToBig */
#define C_DYNL 0x44594E4CL /* Dynamic Link Library Driver */
#define C_DYWL 0x4459574CL /* WIN_LNK */
#define C_EADC 0x45414443L /* Easydisc - Ramdisk */
#define C_EBPO 0x4542504FL /* EB Modeleur Universel Modeler */
#define C_EdDI 0x45644449L /* EdDI by Sven&Wilfried Behne, BELA */
#define C_EDFX 0x45444658L /* EDPBFIX.PRG */
#define C_EGON 0x45474F4EL /* EGON! CD-ROM Driver */
#define C_EMNP 0x454D4E50L /* MNP emulator */
#define C_ENV_ 0x454E565FL /* Desktop environment manager */
#define C_ENVN 0x454E564EL /* Environ.prg - setzt GEM-Environment */
#define C_ENVR 0x454E5652L /* Environment manager */
#define C_EPro 0x4550726FL /* Extendos Pro CD-ROM Driver */
#define C_EURO 0x4555524FL /* Euro-Zeichen */
#define C_EXRA 0x45585241L /* Extra RAM Speeder Card Software */
#define C_EXTD 0x45585444L /* TOS File Name Extender */
#define C_FaKE 0x46614B45L /* FakeMiNT */
#define C_FALT 0x46414C54L /* Faltoff Screen() MEGA STE bufixer */
#define C_FAXR 0x46415852L /* FaxRedirector */
#define C_FHFX 0x46484658L /* F030HFIX - Falcon-GEMDOS-Handle-Fix */
#define C_FIX2 0x46495832L /* FIX24 68030 -> 24 bits */
#define C_FLTP 0x464C5450L /* FlyTop */
#define C_FLXD 0x464C5844L /* Flexdisk */
#define C_fMSX 0x664D5358L /* freeMSXemulators */
#define C_FOse 0x464F7365L /* Fontselector */
#define C_Fose 0x466F7365L /* Font Selector */
#define C_FrmD 0x46726D44L /* Form_do_it */
#define C_FSEL 0x4653454CL /* Extended File Selector (e.g. Selectric<69>,Freedom<6F>) */
#define C_FSER 0x46534552L /* Fast Serial Interface Routines */
#define C_FSMC 0x46534D43L /* Advanced GDOS */
#define C_FSmp 0x46536D70L /* Fileselector */
#define C_FSmp 0x46536D70L /* Martin Patzel File Selector */
#define C_F_3D 0x465F3344L /* Focus 3D */
#define C_GABI 0x47414249L /* Gabrielle Serial Port Typewriter Emulator */
#define C_GBel 0x4742656CL /* GemBell */
#define C_GCOM 0x47434F4DL /* GEM Component Object Model */
#define C_GDEV 0x47444556L /* GNU-C Device-Driver */
#define C_GEHC 0x47454843L /* Hypercache Turbo */
#define C_GEHD 0x47454844L /* Harddisktreiber */
#define C_GEMB 0x47454D42L /* GE Soft HD Driver */
#define C_GENV 0x47454E56L /* GEM Environment Setter */
#define C_Gfix 0x47666978L /* Gamefix for Falcon030 */
#define C_GI30 0x47493330L /* Gandhi */
#define C_GIGA 0x47494741L /* Giga Box ST Driver */
#define C_gk5_ 0x676B355FL /* Treiber f<>r 5.25" HIGH-Density-Drittlaufwerk */
#define C_gkCO 0x676B434FL /* Calamus Thingy */
#define C_GLAS 0x474C4153L /* Free memorydisplay */
#define C_GLBL 0x474C424CL /* GEMLABEL System Extension */
#define C_GMNI 0x474D4E49L /* Gemini */
#define C_GMTC 0x474D5443L /* Timezone CPX */
#define C_GNUC 0x474E5543L /* GNU-C Library */
#define C_Gnva 0x476E7661L /* Geneva Multi-tasking AES */
#define C_GOBJ 0x474F424AL /* ObjectGEM PurePascal library */
#define C_GOff 0x474F6666L /* Grow/Shrinkbox off */
#define C_GSND 0x47534E44L /* Gemsound */
#define C_GSP1 0x47535031L /* GEM Spooler */
#define C_GSXB 0x47535842L /* Generic sound Xbios */
#define C_GULM 0x47554C4DL /* Gulam Shell */
#define C_HABO 0x4841424FL /* Haboo Harddisk Cache */
#define C_hade 0x68616465L /* Hades */
#define C_HAMM 0x48414D4DL /* Melody Maker Software */
#define C_HBFS 0x48424653L /* BoxKite File Selector */
#define C_HcP6 0x48635036L /* NEC P6 Hardcopy Driver */
#define C_HDDR 0x48444452L /* HD Driver */
#define C_HDEX 0x48444558L /* HDDriver-eigenes Interface */
#define C_HDEY 0x48444559L /* Hard Disc Eye */
#define C_HDJR 0x48444A52L /* Hushi HD Interface Driver */
#define C_HDLD 0x48444C44L /* 'HD-LED' */
#define C_HDPR 0x48445052L /* HD Protect */
#define C_HDRC 0x48445243L /* AUDIODRV */
#define C_HDST 0x48445354L /* Eickmann HD Driver */
#define C_HDSW 0x48445357L /* High Density Switcher */
#define C_HFIX 0x48464958L /* Handle Bug Fix */
#define C_hFRB 0x68465242L /* BIOS-Treiber f<>r Rwabs-Transfers */
#define C_HIDS 0x48494453L /* High Density Disk Driver */
#define C_HMDU 0x484D4455L /* HM2 System Memory Dump */
#define C_HMOC 0x484D4F43L /* H<>nisch Modula Object Cache */
#define C_HMRD 0x484D5244L /* H<>nisch Modula Run-Time Debugger */
#define C_HMRS 0x484D5253L /* HM2 Run-Time System */
#define C_HPHC 0x48504843L /* HP Deskjet Hardcopy */
#define C_HPLJ 0x48504C4AL /* HP-Laserjet-Emulator V1.04 */
#define C_HSCD 0x48534344L /* MiNT-CDROM-Treiber */
#define C_HSnd 0x48536E64L /* CrazySounds */
#define C_HWAM 0x4857414DL /* Cookie Jar creator program */
#define C_IBMP 0x49424D50L /* Norwegian->IBM Printer Converter */
#define C_ICFS 0x49434653L /* Iconify Server */
#define C_ICST 0x49435354L /* INETCUST Cookie */
#define C_IDSK 0x4944534BL /* Icon Desk */
#define C_IMAC 0x494D4143L /* Bootsector Guardian */
#define C_IMNE 0x494D4E45L /* Imagine graphics card */
#define C_INSJ 0x494E534AL /* Cookie Jar installer/extendor program */
#define C_INXR 0x494E5852L /* Index generator */
#define C_iPRN 0x6950524EL /* iPRN */
#define C_IRSB 0x49525342L /* SEGA Shutterbrille */
#define C_iTMA 0x69544D41L /* E-Copy ab 2.0, E-Backup ab 2.0, Kobold ab 3.0 */
#define C_JAM1 0x4A414D31L /* Butler James */
#define C_JB2G 0x4A423247L /* Bios2Gdos */
#define C_JCLK 0x4A434C4BL /* Clocky Multiutility */
#define C_JCNB 0x4A434E42L /* JCN Bootselector */
#define C_JCNC 0x4A434E43L /* JCN Multi Accessory */
#define C_JCNH 0x4A434E48L /* Hardcopy Program */
#define C_JCNT 0x4A434E54L /* Cocteau Word Processor */
#define C_JFTP 0x4A465450L /* SCSI driver for generic tape devices */
#define C_JINX 0x4A494E58L /* Jinx */
#define C_JMLB 0x4A4D4C42L /* McBoot */
#define C_JMLS 0x4A4D4C53L /* JML Snapshot */
#define C_JSHD 0x4A534844L /* High Density Control Program */
#define C_JUST 0x4A555354L /* Justify */
#define C_J_Sc 0x4A5F5363L /* SECURE.PRG */
#define C_KbEv 0x4B624576L /* MM2 Keyboard Handling Module */
#define C_KEYT 0x4B455954L /* KEYTAB */
#define C_KGTF 0x4B475446L /* Tos Fix */
#define C_KIDI 0x4B494449L /* RAMdisk */
#define C_KREG 0x4B524547L /* KillRegisters */
#define C_KyMp 0x4B794D70L /* Keyboard Macro & Remapping Utility */
#define C_LACY 0x4C414359L /* LAZy-Shell-III */
#define C_LALA 0x4C414C41L /* Albolala BellHook Sample Player */
#define C_lanc 0x6C616E63L /* MiNT-Net ethernet driver for AMD LANCE */
#define C_LASB 0x4C415342L /* Laserbrain */
#define C_LAWC 0x4C415743L /* Look-Ahead-Write-Cache */
#define C_LDGE 0x4C444745L /* GEM Dynamical Libraries (LDG) */
#define C_LEDP 0x4C454450L /* LED-Panel */
#define C_LLCR 0x4C4C4352L /* Logilex 1st Lock */
#define C_LOGB 0x4C4F4742L /* Logbuch */
#define C_LoSe 0x4C6F5365L /* SER-LOG */
#define C_LP_2 0x4C505F32L /* Malloc 2 Gemdos Vector */
#define C_LPCD 0x4C504344L /* Carrier Detector */
#define C_LPJM 0x4C504A4DL /* Joy Mouse */
#define C_LTMF 0x4C544D46L /* Let 'em Fly */
#define C_M16s 0x4D313673L /* CyRel M16-1280 Graphikkarte */
#define C_M16X 0x4D313658L /* CyReL M16 XBIOS-Emulator */
#define C_macc 0x6D616363L /* Maccel 3 */
#define C_MADD 0x4D414444L /* Add mem for TT */
#define C_MADN 0x4D41444EL /* NEX-Output */
#define C_MagC 0x4D616743L /* Magic Dials Configuration program */
#define C_MagX 0x4D616758L /* MagiC */
#define C_MAST 0x4D415354L /* Master */
#define C_MaTC 0x4D615443L /* Matrix True Colour Graphics Card */
#define C_MBRD 0x4D425244L /* Blit_RD: Ramdisk */
#define C_MCL_ 0x4D434C5FL /* MiNT control */
#define C_McSn 0x4D63536EL /* MacSound */
#define C_MCWR 0x4D435752L /* Microwire DMA sound interface */
#define C_MDIA 0x4D444941L /* Multi-Dialog */
#define C_MDRK 0x4D44524BL /* MegaDark */
#define C_MDSa 0x4D445361L /* Medical Design Software's Serial Fix */
#define C_MFAC 0x4D464143L /* Multi Accessory */
#define C_MFFM 0x4D46464DL /* Marcus' file selector for MiNT */
#define C_MFIX 0x4D464958L /* MONOFIX.PRG */
#define C_MFNT 0x4D464E54L /* Fontloader */
#define C_MGEM 0x4D47454DL /* MultiGEM */
#define C_MgMc 0x4D674D63L /* MagiCMac */
#define C_MgMx 0x4D674D78L /* MagiCMac X */
#define C_MID3 0x4D494433L /* MIDINET3 */
#define C_MIMA 0x4D494D41L /* MIDI Manager */
#define C_MiNT 0x4D694E54L /* Mint/MultiTOS */
#define C_MIPS 0x4D495053L /* SPOOL120.PRG - Druckerspooler */
#define C_MJAF 0x4D4A4146L /* AUTOFONT */
#define C_MKHC 0x4D4B4843L /* Hardcopy Fixer */
#define C_MkJr 0x4D6B4A72L /* Cookie Jar creator program */
#define C_MMAC 0x4D4D4143L /* Magic Mouse Accelerator */
#define C_MMUT 0x4D4D5554L /* Midi Maze II Utility */
#define C_MM_2 0x4D4D5F32L /* Midimaze 2 */
#define C_MNAM 0x4D4E414DL /* Name cookie */
#define C_MOAF 0x4D4F4146L /* ARROWFIX */
#define C_MOGR 0x4D4F4752L /* GEMRAM */
#define C_MPRO 0x4D50524FL /* Magic Pro Config CPX */
#define C_MRAM 0x4D52414DL /* More RAM */
#define C_MSPD 0x4D535044L /* Mouse Speeder */
#define C_MSPO 0x4D53504FL /* Magic Spooler */
#define C_mstx 0x6D737478L /* Mouse Tricks */
#define C_MTft 0x4D546674L /* Trapper */
#define C_MUPF 0x4D555046L /* Mupfel */
#define C_MWHL 0x4D57484CL /* MHweel */
#define C_MZTR 0x4D5A5452L /* TRASH */
#define C_N203 0x4E323033L /* Multi Accessory */
#define C_nAES 0x6E414553L /* N.AES, the AES for MiNT */
#define C_NBEL 0x4E42454CL /* SOUND.PRG */
#define C_NBLL 0x4E424C4CL /* NEWBELL.PRG */
#define C_NCLN 0x4E434C4EL /* NiceLine */
#define C_ne2k 0x6E65326BL /* ne2000.xif */
#define C_NERV 0x4E455256L /* No etv_critic_alert */
#define C_NETS 0x4E455453L /* PAM Novell Software */
#define C_NEXB 0x4E455842L /* NEX-Buffer */
#define C_NEXK 0x4E45584BL /* NEX-Toolkit */
#define C_NFMT 0x4E464D54L /* INFOMAT */
#define C_NFnt 0x4E466E74L /* Neodesk Font Loader */
#define C_NKCC 0x4E4B4343L /* NKCC - Normalized Key Code Converter */
#define C_NLdr 0x4E4C6472L /* Neodesk Loader */
#define C_NO7P 0x4E4F3750L /* Norwegian->7 bit printer converter */
#define C_noCF 0x6E6F4346L /* noSystem */
#define C_NOR5 0x4E4F5235L /* Norwegian Keyboard Driver */
#define C_NOVA 0x4E4F5641L /* NOVA graphics card */
#define C_NSC1 0x4E534331L /* N_Syscom accessory */
#define C_nTAS 0x6E544153L /* TAS-Instruktionen */
#define C_NTK4 0x4E544B34L /* NTK4 Falcon MOD player */
#define C_NUL_ 0x4E554C5FL /* System startup utility */
#define C_NVDI 0x4E564449L /* NewVDI */
#define C_OBNL 0x4F424E4CL /* Load-Time-Linking (kurz "LTL") Protokoll */
#define C_OFLS 0x4F464C53L /* Check Open Files */
#define C_OPMM 0x4F504D4DL /* Open Helper */
#define C_OSBL 0x4F53424CL /* Screen Blaster */
#define C_OSTT 0x4F535454L /* OverScan TT */
#define C_OV24 0x4F563234L /* OverScan Hardcopy Driver 24 pins */
#define C_oVDI 0x6F564449L /* oVDI */
#define C_OVDJ 0x4F56444AL /* Overscan Hardcopytreiber f<>r HP-DeskJet */
#define C_OVDJ 0x4F56444AL /* OverScan Hardcopy Driver HP Deskjet */
#define C_OVEP 0x4F564550L /* OverScan Hardcopy Driver 9 pins */
#define C_OVER 0x4F564552L /* AutoSwitch OverScan Hardware Driver */
#define C_OVEX 0x4F564558L /* OverScan Exception Patch */
#define C_OVFS 0x4F564653L /* OverScan Fileselector Patch */
#define C_OVIM 0x4F56494DL /* OverScan Hardcopy Driver */
#define C_OVLS 0x4F564C53L /* OverScan DMC Laserbrain Patch */
#define C_OVRD 0x4F565244L /* OverScan RamDisk */
#define C_OVUT 0x4F565554L /* OverScan Screen Blanker */
#define C_OVWI 0x4F565749L /* OverScan Window-Size Patch */
#define C_PAMN 0x50414D4EL /* PAM Network Driver */
#define C_PBUG 0x50425547L /* PeaceBug */
#define C_PCI_ 0x5043495FL /* PCI-BIOS */
#define C_PDeb 0x50446562L /* PureDebuggger */
#define C_PDOS 0x50444F53L /* PowerDOS */
#define C_PDRZ 0x5044525AL /* LockGetrez */
#define C_PFIX 0x50464958L /* PTSINFIX Fix */
#define C_Pinp 0x50696E70L /* Parallel Input Port Driver */
#define C_PKSH 0x504B5348L /* PKS-Shell */
#define C_PMMU 0x504D4D55L /* PMMU reprogrammed */
#define C_POIS 0x504F4953L /* Poison! */
#define C_POWM 0x504F574DL /* PowerMouse */
#define C_PRCS 0x50524353L /* CopySTar */
#define C_PRDS 0x50524453L /* Peter Rohde Disk Speeder */
#define C_PRMD 0x50524D44L /* MIDIPRT */
#define C_PRN_ 0x50524E5FL /* WandelSZ */
#define C_PRN_ 0x50524E5FL /* WandelSZ */
#define C_PRO5 0x50524F35L /* Resident virus check/kill/prtotect program */
#define C_PROB 0x50524F42L /* Profibase */
#define C_PROT 0x50524F54L /* Protos Screen Utility */
#define C_PRTD 0x50525444L /* Print to Disk V1.10 */
#define C_PRTO 0x5052544FL /* ST Tools */
#define C_PRTR 0x50525452L /* Protar HD Driver */
#define C_prtr 0x70727472L /* Atari->IBM Printer Converter */
#define C_PSND 0x50534E44L /* ProSound Driver */
#define C_PSSG 0x50535347L /* Paint Shop Hardcopy vector */
#define C_PTOS 0x50544F53L /* ROMRAM: copy TOS in TT-RAM */
#define C_QIKM 0x51494B4DL /* Quick Mouse */
#define C_QMAC 0x514D4143L /* Quick Mouse Driver Accessory */
#define C_QMCP 0x514D4350L /* Chemplot Quick Mouse Driver */
#define C_QST2 0x51535432L /* Quick ST 2 */
#define C_QST3 0x51535433L /* Quick ST 3 */
#define C_QUAN 0x5155414EL /* QuanTOS Multiutility */
#define C_RAIL 0x5241494CL /* Rail Manager */
#define C_RaSn 0x5261536EL /* Rational Sounds */
#define C_RESG 0x52455347L /* RESET GUARD */
#define C_RFLX 0x52464C58L /* AutoSwitch Driver for Reflex Graphics Card */
#define C_RFUS 0x52465553L /* Rufus terminal program */
#define C_RGUS 0x52475553L /* Argus */
#define C_RING 0x52494E47L /* Telefonklingel Detektor */
#define C_ROT8 0x524F5438L /* Rotate */
#define C_RREG 0x52524547L /* Restore Register */
#define C_RSLT 0x52534C54L /* GengTEC VGA Monochrome/16 Colour Driver */
#define C_RSpd 0x52537064L /* RS_SPEED (Serial Fix) */
#define C_RSVE 0x52535645L /* RSVE Patch */
#define C_RSVF 0x52535646L /* RS232 Version Fast (HSMODEM) */
#define C_RTKC 0x52544B43L /* Keyclick */
#define C_RTOB 0x52544F42L /* Optobell */
#define C_RWIN 0x5257494EL /* RootWindow */
#define C_SBKM 0x53424B4DL /* Ring Recognition in Modem Routs */
#define C_SBTE 0x53425445L /* Terminal Program */
#define C_SBTS 0x53425453L /* Trap Spy */
#define C_SCAH 0x53434148L /* Speed Cache */
#define C_SCKM 0x53434B4DL /* MagXNet (SOCKET.DEV) */
#define C_SCRD 0x53435244L /* Screen To Disk */
#define C_SCRN 0x5343524EL /* Screen Scroll */
#define C_SCRS 0x53435253L /* Screen Blanker */
#define C_SCRW 0x53435257L /* Screen Watch */
#define C_SCSI 0x53435349L /* SCSI Driver */
#define C_SCSV 0x53435356L /* Line Art Screensaver */
#define C_SDCH 0x53444348L /* 2C - Second Chance */
#define C_SDES 0x53444553L /* Softdesk */
#define C_SDsk 0x5344736BL /* Softdisk */
#define C_SDWN 0x5344574EL /* ScreenDown */
#define C_SELC 0x53454C43L /* C-Lab File selector */
#define C_SENV 0x53454E56L /* Set Environment */
#define C_SFA_ 0x5346415FL /* Fontloader system */
#define C_SFIX 0x53464958L /* Serial Port Fix */
#define C_SFMN 0x53464D4EL /* SafeMenu */
#define C_ShLk 0x53684C6BL /* Shift Lock */
#define C_shlp 0x73686C70L /* shelhelp */
#define C_SKEY 0x534B4559L /* SpecialKeys */
#define C_SLCT 0x534C4354L /* Selectric */
#define C_SLif 0x534C6966L /* SoundLifter */
#define C_SLIP 0x534C4950L /* Socket library */
#define C_SM00 0x534D3030L /* SOTA Printer Spooler */
#define C_SM01 0x534D3031L /* ReProK Office Management DUO */
#define C_SM02 0x534D3032L /* ReProK International EM-NET II */
#define C_SMAL 0x534D414CL /* Small AES Icon fonts */
#define C_SMAU 0x534D4155L /* Set Mouse Accessory */
#define C_SMon 0x534D6F6EL /* SysMon */
#define C_SMTT 0x534D5454L /* SM-124 Emulator */
#define C_SNAP 0x534E4150L /* That's Snap Accessory */
#define C_SOFS 0x534F4653L /* Softscreen */
#define C_SOSW 0x534F5357L /* Softswitch */
#define C_SpcE 0x53706345L /* Space */
#define C_SPCK 0x5350434BL /* RAMdisk for SPC Modula */
#define C_SPEE 0x53504545L /* Mouse Speeder */
#define C_SPEK 0x5350454BL /* Spektrum-Grafikkarten */
#define C_SPEX 0x53504558L /* Steve's Printing Exzessory */
#define C_Spol 0x53706F6CL /* Flexible Printer Spooler */
#define C_SPRG 0x53505247L /* STARTER.ACC */
#define C_SSND 0x53534E44L /* Petra */
#define C_ST_C 0x53542D43L /* Cache Program */
#define C_ST17 0x53543137L /* ST-68017 */
#define C_STAT 0x53544154L /* StaTOS */
#define C_STEW 0x53544557L /* Stewart */
#define C_STFA 0x53544641L /* Sound treiber fur Atari */
#define C_StIc 0x53744963L /* Stewart Iconserver */
#define C_STiK 0x5354694BL /* ST Internet Kit */
#define C_STMS 0x53544D53L /* ST Magazine Screendump */
#define C_STRX 0x53545258L /* SAT-Trax Antenna driver */
#define C_SVAR 0x53564152L /* Shows MacMiNT */
#define C_SVGA 0x53564741L /* Super VGA Emulator */
#define C_SWAP 0x53574150L /* Outside */
#define C_SwTm 0x5377546DL /* Uhr */
#define C_SYMB 0x53594D42L /* Symbol driver */
#define C_SYNL 0x53594E4CL /* Dynamic Link Library Driver */
#define C_SYNT 0x53594E54L /* Syntex */
#define C_SysE 0x53797345L /* System Editor */
#define C_Syso 0x5379736FL /* ST Sysop */
#define C_SYST 0x53595354L /* Systime */
#define C_SZ_M 0x535A5F4DL /* Dynamic Mouse Speeder */
#define C_S_DR 0x535F4452L /* CDROM SCSI driver */
#define C_T206 0x54323036L /* PATCHX06.PRG */
#define C_T2GM 0x5432474DL /* TOS2GEM */
#define C_TAPE 0x54415045L /* TabeBIOS */
#define C_TASS 0x54415353L /* Turbo Assembler */
#define C_TCFS 0x54434653L /* Turbo C File Selector */
#define C_TCRB 0x54435242L /* Turbo Cache */
#define C_Tenv 0x54656E76L /* Environment Set Program for Terminal */
#define C_TFIX 0x54464958L /* TOS 1.04 fix */
#define C_THNX 0x54484E58L /* Thinx */
#define C_THRM 0x5448524DL /* Temoeraturdatenauswertung */
#define C_THST 0x54485354L /* TurboHST */
#define C_TIM3 0x54494D33L /* Time Driver */
#define C_TIM5 0x54494D35L /* Time Driver plus Screen Blanker */
#define C_TIME 0x54494D45L /* Led Panel Time */
#define C_TK40 0x544B3430L /* MC68040 ToolKit */
#define C_TL3D 0x544C3344L /* Dritte Floppy */
#define C_TLWV 0x544C5756L /* STGAWVBL */
#define C_TMon 0x544D6F6EL /* TempleMon */
#define C_TOpW 0x544F7057L /* Top Manager Watcher */
#define C_TOUC 0x544F5543L /* Touch */
#define C_TPat 0x54506174L /* Tos Patch */
#define C_TPGM 0x5450474DL /* TraPatch */
#define C_TRAK 0x5452414BL /* Track Speed */
#define C_TraP 0x54726150L /* TraPatch */
#define C_TRUE 0x54525545L /* TrueDisk */
#define C_TSEN 0x5453454EL /* TSE Net */
#define C_TSWP 0x54535750L /* TonySoft Write Protection */
#define C_TTTF 0x54545446L /* Thirty Two to Twenty Four */
#define C_TUBS 0x54554253L /* TUBS - The Ultimate Boot Selector */
#define C_TWFS 0x54574653L /* That's Write File Selector Accessory */
#define C_Typ1 0x54797031L /* Daisywheel accessory */
#define C_UFSL 0x5546534CL /* Extended Universal Font Selector */
#define C_UIS3 0x55495333L /* Universal Item Selector 3 */
#define C_UKB1 0x554B4231L /* Fastload */
#define C_UKB3 0x554B4233L /* Fastload plus MIDI Through */
#define C_UN_X 0x554E5F58L /* Unixname (/->\ Converter) */
#define C_USCK 0x5553434BL /* CHECKIT */
#define C_USHD 0x55534844L /* Diskus HD driver */
#define C_USPK 0x5553504BL /* Hard Disk Auto Parker */
#define C_USRS 0x55535253L /* Romspeed */
#define C_UTRK 0x5554524BL /* Ultimate Tracker */
#define C_VBLF 0x56424C46L /* VBLFIX.PRG */
#define C_VDLY 0x56444C59L /* Videlity */
#define C_VECS 0x56454353L /* Vecshow */
#define C_VeiL 0x5665694CL /* Turbo Veille */
#define C_VFIX 0x56464958L /* VDIFix */
#define C_VFNT 0x56464E54L /* VdiFont */
#define C_VGAS 0x56474153L /* VGA Simulator */
#define C_VI_2 0x56495F32L /* Videl Inside */
#define C_View 0x56696577L /* View Protocol */
#define C_VIRA 0x56495241L /* Virus Alarm */
#define C_VMEM 0x564D454DL /* Virtual Memory */
#define C_VPCH 0x56504348L /* VDIPATCH.PRG */
#define C_VRAM 0x5652414DL /* Virtual Memory Management for the TT */
#define C_VREP 0x56524550L /* Vector Guard */
#define C_VSco 0x5653636FL /* Virus Scope */
#define C_VSCR 0x56534352L /* Structure of Virtual Screens */
#define C_VSTM 0x5653544DL /* MIDI Transfer */
#define C_vT52 0x76543532L /* CyRel VT52-Emulator */
#define C_VTFX 0x56544658L /* VT52FIX.PRG */
#define C_VXCK 0x5658434BL /* VoxClock */
#define C_WaHW 0x57614857L /* HIGH_WAY */
#define C_WARP 0x57415250L /* Warp 9 */
#define C_WaSA 0x57615341L /* SATELLIT */
#define C_WBrd 0x57427264L /* Bird's Wing */
#define C_wdlg 0x77646C67L /* Window-Dialog-Library (wdialog) */
#define C_WDOG 0x57444F47L /* Watchdog */
#define C_WEGA 0x57454741L /* WEGA Libraries */
#define C_WFSL 0x5746534CL /* Window File Selector */
#define C_WICO 0x5749434FL /* WinCom */
#define C_WinK 0x57696E4BL /* WinKeys */
#define C_WINX 0x57494E58L /* WINX */
#define C_WINZ 0x57494E5AL /* Luftscho<68>/WinzRAM RAMdisk */
#define C_WPRO 0x5750524FL /* Write Protect */
#define C_WrAp 0x57724170L /* WarpMouse */
#define C_XALT 0x58414C54L /* AlberTT GFX card driver */
#define C_XBTN 0x5842544EL /* Maus-Routine in 'XBOOT' */
#define C_XBTN 0x5842544EL /* Mouse speeder routine from XBOOT */
#define C_XDsk 0x5844736BL /* X-DISK ramdisk */
#define C_XFRB 0x58465242L /* Extended Fast Ram Buffer */
#define C_XFS1 0x58465331L /* Master Module for extended TOS File System */
#define C_xFSL 0x7846534CL /* Extended Font Selector */
#define C_XHDI 0x58484449L /* XHDI driver */
#define C_XKBD 0x584B4244L /* Extended Keyboard */
#define C_XMMU 0x584D4D55L /* TK40's interface for PMMU setting */
#define C_XMuz 0x584D757AL /* Ultra Player */
#define C_xNet 0x784E6574L /* xNet-ST */
#define C_XPCI 0x58504349L /* Xbios functions for PCIbios */
#define C_xRmt 0x78526D74L /* XREMOTE */
#define C_XSND 0x58534E44L /* Digi-Sound */
#define C_XSSI 0x58535349L /* Extended Screen Saver Information */
#define C_XTOS 0x58544F53L /* Extend TOS */
#define C_xUFC 0x78554643L /* Extended Universal Font Selector Configuration Program */
#define C_XWin 0x5857696EL /* Extended Windows moudle */
#define C_zCAC 0x7A434143L /* 680x0 Cache Control CPX */
#define C_zDCF 0x7A444346L /* DCF-Time receiver */
#define C__AFM 0x5F41464DL /* Audio Fun Machine */
#define C__AKP 0x5F414B50L /* Keyboard/Language Configuration */
#define C__CPU 0x5F435055L /* Central Processor Unit Type */
#define C__DOS 0x5F444F53L /* GEMDOS-Einsprung (im GEMDOS 0.30) */
#define C__FDC 0x5F464443L /* Disk Drive Type */
#define C__FLK 0x5F464C4BL /* File Locking Extension */
#define C__FPU 0x5F465055L /* Floating Point Unit Type */
#define C__FRB 0x5F465242L /* Fast Ram Buffer */
#define C__FSR 0x5F465352L /* Patch program for serial (TOS 4.00->4.04) */
#define C__IDT 0x5F494454L /* International Date/Time Format */
#define C__INF 0x5F494E46L /* STEFIX Program */
#define C__ISO 0x5F49534FL /* specifies the real keyboard/font nationality */
#define C__JPD 0x5F4A5044L /* Falcon030 JPEG Decoder by Brainstorm */
#define C__MCH 0x5F4D4348L /* Machine Type */
#define C__MET 0x5F4D4554L /* MetaDOS */
#define C__MIL 0x5F4D494CL /* Milan computer */
#define C__NET 0x5F4E4554L /* GEMDOS Network Support */
#define C__OOL 0x5F4F4F4CL /* Pool Fix */
#define C__PCI 0x5F504349L /* PCIbios */
#define C__PKT 0x5F504B54L /* Paket Driver Cookie */
#define C__PWR 0x5F505752L /* Power Management unit */
#define C__SLM 0x5F534C4DL /* SLM Driver */
#define C__SND 0x5F534E44L /* Sound Hardware */
#define C__SWI 0x5F535749L /* Configuration Switches */
#define C__T2W 0x5F543257L /* TOS2WIN Emulator */
#define C__T30 0x5F543330L /* KAOS TOS */
#define C__VDI 0x5F564449L /* Milan VDI */
#define C__VDO 0x5F56444FL /* Video Type */
#define C___NF 0x5F5F4E46L /* Native features proposal */
#define C__FSC 0x5F465343L /* Falcon Screen */
#define C_MACCEL 0x00AA006EL /* MACCELL */
/* Return values of Getcookie() */
#define C_FOUND 0
#define C_NOTFOUND 1
extern int Getcookie(long cookie, long *val);
#endif

View File

@@ -0,0 +1,507 @@
/*
* This file belongs to FreeMiNT. It's not in the original MiNT 1.12
* distribution. See the file Changes.MH for a detailed log of changes.
*/
/*
* begin: 1998-06
* last change: 1998-09-07
*
* Author: Frank Naumann - <fnaumann@cs.uni-magdeburg.de>
*
* please send suggestions, patches or bug reports to me or
* the MiNT mailing list
*
*
* Description: Constants for Dcntl() and Fcntl() calls.
*
*/
# ifndef _DCNTL_H
# define _DCNTL_H
#ifndef LLONG
# define LLONG
# ifdef __GNUC__
typedef long long llong; /* 64bit int */
# else
typedef struct { long hi; unsigned long lo; } llong; /* 64bit int */
# endif
#endif
# define F_DUPFD 0 /* handled by kernel */
# define F_GETFD 1 /* handled by kernel */
# define F_SETFD 2 /* handled by kernel */
/* flag: */
# define FD_CLOEXEC 1 /* close on exec flag */
# define F_GETFL 3 /* handled by kernel */
# define F_SETFL 4 /* handled by kernel */
# define F_GETLK 5
# define F_SETLK 6
# define F_SETLKW 7
#ifdef __KERNEL__
struct flock
{
short l_type; /* type of lock */
# define F_RDLCK 0
# define F_WRLCK 1
# define F_UNLCK 3
short l_whence; /* SEEK_SET, SEEK_CUR, SEEK_END */
long l_start; /* start of locked region */
long l_len; /* length of locked region */
short l_pid; /* pid of locking process (F_GETLK only) */
};
#endif /* not __KERNEL__ */
# define F_GETOPENS 8 /* handled by kernel */
/* jr: structure for F_GETOPENS */
struct listopens
{
# define LO_FILEOPEN 1
# define LO_DIROPEN 2
# define LO_CURDIR 4
# define LO_CURROOT 8
short lo_pid; /* input: first pid to check;
* output: who's using it? */
short lo_reason; /* input: bitmask of interesting reasons;
* output: why EACCDN? */
short lo_flags; /* file's open flags */
};
/*
* Minix-FS
*/
# define MFS_VERIFY 0x100 /* minixfs/docs/syscall.doc */
# define MFS_MAGIC 0x18970431 /* Magic number from MFS_VERIFY */
# define MFS_SYNC 0x101 /* minixfs/docs/syscall.doc */
# define MFS_CINVALID 0x102 /* minixfs/docs/syscall.doc */
# define MFS_FINVALID 0x103 /* minixfs/docs/syscall.doc */
# define MFS_INFO 0x104 /* minixfs/docs/syscall.doc */
# define MFS_USAGE 0x105 /* minixfs/minixfs.h */
# define MFS_IMODE 0x106 /* minixfs/docs/syscall.doc */
# define MFS_GTRANS 0x107 /* minixfs/docs/syscall.doc */
# define MFS_STRANS 0x108 /* minixfs/docs/syscall.doc */
# define MFS_PHYS 0x109 /* minixfs/minixfs.h */
# define MFS_IADDR 0x10a /* minixfs/docs/syscall.doc */
# define MFS_UPDATE 0x10b /* minixfs/docs/syscall.doc */
# define MFS_MOUNT 0x10c /* minixfs/docs/syscall.doc */
# define MFS_UMOUNT 0x10d /* minixfs/docs/syscall.doc */
# define MFS_LOPEN 0x10e /* minixfs/docs/syscall.doc */
# define MFS_MKNOD 0x10f /* minixfs/docs/syscall.doc */
/*
* MagiC specific calls for filesystem installation (use group 'm'!)
*/
/*# define KER_INSTXFS 0x0200*/ /* mgx_dos.txt */
/*# define KER_SETWBACK 0x0300*/ /* mgx_dos.txt */
/*# define DFS_GETINFO 0x1100*/ /* mgx_dos.txt */
/*# define DFS_INSTDFS 0x1200*/ /* mgx_dos.txt */
/*
* CD-ROMs
*/
# define CDROMREADOFFSET (('C'<< 8) | 0) /* cdromio.h */
# define CDROMPAUSE (('C'<< 8) | 1) /* cdromio.h */
# define CDROMRESUME (('C'<< 8) | 2) /* cdromio.h */
# define CDROMPLAYMSF (('C'<< 8) | 3) /* cdromio.h */
# define CDROMPLAYTRKIND (('C'<< 8) | 4) /* cdromio.h */
# define CDROMREADTOCHDR (('C'<< 8) | 5) /* cdromio.h */
# define CDROMREADTOCENTRY (('C'<< 8) | 6) /* cdromio.h */
# define CDROMSTOP (('C'<< 8) | 7) /* cdromio.h */
# define CDROMSTART (('C'<< 8) | 8) /* cdromio.h */
# define CDROMEJECT (('C'<< 8) | 9) /* cdromio.h */
# define CDROMVOLCTRL (('C'<< 8) | 10) /* cdromio.h */
# define CDROMSUBCHNL (('C'<< 8) | 11) /* cdromio.h */
# define CDROMREADMODE2 (('C'<< 8) | 12) /* cdromio.h */
# define CDROMREADMODE1 (('C'<< 8) | 13) /* cdromio.h */
# define CDROMPREVENTREMOVAL (('C'<< 8) | 14) /* cdromio.h */
# define CDROMALLOWTREMOVAL (('C'<< 8) | 15) /* cdromio.h */
# define CDROMAUDIOCTRL (('C'<< 8) | 16) /* cdromio.h */
# define CDROMREADDA (('C'<< 8) | 17) /* cdromio.h */
# define CDROMGETMCN (('C'<< 8) | 19) /* cdromio.h */
# define CDROMGETTISRC (('C'<< 8) | 20) /* cdromio.h */
/*
* Big-DOS
*/
# define DL_SECSIZ (('D'<< 8) | 0) /* max. bpb->recsiz */
# define DL_MINFAT (('D'<< 8) | 1) /* min. Anzahl FATs */
# define DL_MAXFAT (('D'<< 8) | 2) /* max. Anzahl FATs */
# define DL_MINSPC (('D'<< 8) | 3) /* min. bpb->clsiz */
# define DL_MAXSPC (('D'<< 8) | 4) /* max. bpb->clsiz */
# define DL_CLUSTS (('D'<< 8) | 5) /* max. bpb->numcl FAT16 */
# define DL_MAXSEC (('D'<< 8) | 6) /* max. number of sectors */
# define DL_DRIVES (('D'<< 8) | 7) /* max. number of drives */
# define DL_CLSIZB (('D'<< 8) | 8) /* max. bpb->clsizb */
# define DL_RDLEN (('D'<< 8) | 9) /* max. (bpb->rdlen * bpb->recsiz / 32) */
# define DL_FSIZ (('D'<< 8) | 10) /* max. bpb->fsiz */
# define DL_FATREC (('D'<< 8) | 11) /* max. bpb->fatrec */
# define DL_CLUSTS12 (('D'<< 8) | 12) /* max. bpb->numcl FAT12 */
# define DL_CLUSTS32 (('D'<< 8) | 13) /* max. bpb->l_numcl FAT32 */
# define DL_BFLAGS (('D'<< 8) | 14) /* supported bits in bpb->bflags */
# define DL_FILESYS (('D'<< 8) | 15) /* cookie of the filesystem */
# define DL_VERSION (('D'<< 8) | 16) /* version of the filesystem */
# define DL_CHAR (('D'<< 8) | 17) /* pointer to a string with legal chars */
# define DL_SETCHAR (('D'<< 8) | 18) /* ask or set valid names */
/*
* file
*/
# define FSTAT (('F'<< 8) | 0) /* handled by kernel */
# define FIONREAD (('F'<< 8) | 1)
# define FIONWRITE (('F'<< 8) | 2)
# define FUTIME (('F'<< 8) | 3)
/* structure for FUTIME */
struct mutimbuf
{
unsigned short actime, acdate; /* GEMDOS format */
unsigned short modtime, moddate;
};
# define FTRUNCATE (('F'<< 8) | 4)
# define FIOEXCEPT (('F'<< 8) | 5)
# define FMACOPENRES (('F'<< 8) | 72) /* macmint/macfile.h */
# define FMACGETTYCR (('F'<< 8) | 73) /* macmint/macfile.h */
# define FMACSETTYCR (('F'<< 8) | 74) /* macmint/macfile.h */
# define FMAGICMAC (('F'<< 8) | 75) /* (reserved for MagiCMac) */
/*
* shared memory
*/
# define SHMGETBLK (('M'<< 8) | 0)
# define SHMSETBLK (('M'<< 8) | 1)
/*
* processes
*/
# define PPROCADDR (('P'<< 8) | 1)
# define PBASEADDR (('P'<< 8) | 2)
# define PCTXTSIZE (('P'<< 8) | 3)
# define PSETFLAGS (('P'<< 8) | 4)
# define PGETFLAGS (('P'<< 8) | 5)
# define PTRACESFLAGS (('P'<< 8) | 6)
# define PTRACEGFLAGS (('P'<< 8) | 7)
/* flags: */
# define P_ENABLE (1 << 0) /* enable tracing */
# ifdef NOTYETDEFINED
# define P_DOS (1 << 1) /* trace DOS calls - unimplemented */
# define P_BIOS (1 << 2) /* trace BIOS calls - unimplemented */
# define P_XBIOS (1 << 3) /* trace XBIOS calls - unimplemented */
# endif
# define PTRACEGO (('P'<< 8) | 8) /* these 4 must be together */
# define PTRACEFLOW (('P'<< 8) | 9)
# define PTRACESTEP (('P'<< 8) | 10)
# define PTRACE11 (('P'<< 8) | 11)
# define PLOADINFO (('P'<< 8) | 12)
# define PFSTAT (('P'<< 8) | 13)
struct ploadinfo
{
/* passed */
short fnamelen;
/* returned */
char *cmdlin /* 128 byte */, *fname;
};
/*
* Socket ioctls: these require MiNT-Net 3.0 (or later)
*/
# define SIOCGLOWAT (('S' << 8) | 1)
# define SIOCSLOWAT (('S' << 8) | 2)
# define SIOCGHIWAT (('S' << 8) | 3)
# define SIOCSHIWAT (('S' << 8) | 4)
# define SIOCSPGRP (('S' << 8) | 5)
# define SIOCGPGRP (('S' << 8) | 6)
# define SIOCATMARK (('S' << 8) | 7)
# define SIOCGIFCONF (('S' << 8) | 12) /* get iface list */
# define SIOCGIFFLAGS (('S' << 8) | 13) /* get flags */
# define SIOCSIFFLAGS (('S' << 8) | 14) /* set flags */
# define SIOCGIFADDR (('S' << 8) | 15) /* get iface address */
# define SIOCSIFADDR (('S' << 8) | 16) /* set iface address */
# define SIOCGIFDSTADDR (('S' << 8) | 17) /* get iface remote address */
# define SIOCSIFDSTADDR (('S' << 8) | 18) /* set iface remotw address */
# define SIOCGIFBRDADDR (('S' << 8) | 19) /* get iface ibroadcast address */
# define SIOCSIFBRDADDR (('S' << 8) | 20) /* set iface broadcast address */
# define SIOCGIFNETMASK (('S' << 8) | 21) /* get iface network mask */
# define SIOCSIFNETMASK (('S' << 8) | 22) /* set iface network mask */
# define SIOCGIFMETRIC (('S' << 8) | 23) /* get metric */
# define SIOCSIFMETRIC (('S' << 8) | 24) /* set metric */
# define SIOCGIFMTU (('S' << 8) | 27) /* get MTU size */
# define SIOCSIFMTU (('S' << 8) | 28) /* set MTU size */
# define SIOCADDRT (('S' << 8) | 30) /* add routing table entry */
# define SIOCDELRT (('S' << 8) | 31) /* delete routing table entry */
# define SIOCDARP (('S' << 8) | 40) /* delete ARP table entry */
# define SIOCGARP (('S' << 8) | 41) /* get ARP table entry */
# define SIOCSARP (('S' << 8) | 42) /* set ARP table entry */
/*
* terminals
*/
# define TIOCGETP (('T'<< 8) | 0)
# define TIOCSETN (('T'<< 8) | 1)
# define TIOCGETC (('T'<< 8) | 2)
# define TIOCSETC (('T'<< 8) | 3)
# define TIOCGLTC (('T'<< 8) | 4)
# define TIOCSLTC (('T'<< 8) | 5)
# define TIOCGPGRP (('T'<< 8) | 6)
# define TIOCSPGRP (('T'<< 8) | 7)
# define TIOCFLUSH (('T'<< 8) | 8)
# define TIOCSTOP (('T'<< 8) | 9)
# define TIOCSTART (('T'<< 8) | 10)
# define TIOCGWINSZ (('T'<< 8) | 11)
# define TIOCSWINSZ (('T'<< 8) | 12)
# define TIOCGXKEY (('T'<< 8) | 13)
# define TIOCSXKEY (('T'<< 8) | 14)
# define TIOCIBAUD (('T'<< 8) | 18)
# define TIOCOBAUD (('T'<< 8) | 19)
# define TIOCCBRK (('T'<< 8) | 20)
# define TIOCSBRK (('T'<< 8) | 21)
# define TIOCGFLAGS (('T'<< 8) | 22)
# define TIOCSFLAGS (('T'<< 8) | 23)
# define TIOCOUTQ (('T'<< 8) | 24)
# define TIOCSETP (('T'<< 8) | 25)
# define TIOCHPCL (('T'<< 8) | 26)
# define TIOCCAR (('T'<< 8) | 27)
# define TIOCNCAR (('T'<< 8) | 28)
# define TIOCWONLINE (('T'<< 8) | 29)
# define TIOCSFLAGSB (('T'<< 8) | 30)
# define TIOCGSTATE (('T'<< 8) | 31)
# define TIOCSSTATEB (('T'<< 8) | 32)
# define TIOCGVMIN (('T'<< 8) | 33)
# define TIOCSVMIN (('T'<< 8) | 34)
# define TIOCGHUPCL (('T'<< 8) | 98) /* mdm0 ioctls */
# define TIOCSHUPCL (('T'<< 8) | 99)
# define TIOCGSOFTCAR (('T'<< 8) | 100)
# define TIOCSSOFTCAR (('T'<< 8) | 101)
# define TIOCBUFFER (('T'<< 8) | 128) /* HSMODA/hsm_doku/sersoftst.txt */
# define TIOCCTLMAP (('T'<< 8) | 129)
# define TIOCCTLGET (('T'<< 8) | 130)
# define TIOCCTLSET (('T'<< 8) | 131)
# define TIOCCTLSFAST (('T'<< 8) | 132) /* HSMODA/hsm_doku/sersoftst.txt */
# define TIOCCTLSSLOW (('T'<< 8) | 133) /* HSMODA/hsm_doku/sersoftst.txt */
# define TIONOTSEND (('T'<< 8) | 134)
# define TIOCERROR (('T'<< 8) | 135)
# define TIOCLBIS (('T'<< 8) | 246) /* faked by the MiNT library */
# define TIOCLBIC (('T'<< 8) | 247)
# define TIOCMGET (('T'<< 8) | 248)
/* bits in longword fetched by TIOCMGET: */
# define TIOCM_LE 0001 /* not supported */
# define TIOCM_DTR 0002
# define TIOCM_RTS 0004
# define TIOCM_ST 0010 /* not supported */
# define TIOCM_SR 0020 /* not supported */
# define TIOCM_CTS 0040
# define TIOCM_CAR 0100
# define TIOCM_CD TIOCM_CAR
# define TIOCM_RNG 0200
# define TIOCM_RI TIOCM_RNG
# define TIOCM_DSR 0400 /* not supported */
# define TIOCCDTR (('T'<< 8) | 249)
# define TIOCSDTR (('T'<< 8) | 250)
# define TIOCNOTTY (('T'<< 8) | 251)
# define TIOCGETD (('T'<< 8) | 252) /* not yet implemented in MiNT */
# define TIOCSETD (('T'<< 8) | 253)
# define TIOCLGET (('T'<< 8) | 254)
# define TIOCLSET (('T'<< 8) | 255)
# define NTTYDISC 1
/*
* (V)FAT filesystem extensions (MiNT/MagiC)
*/
# define VFAT_CNFDFLN (('V'<< 8) | 0) /* MiNT/MagiC */
# define VFAT_CNFLN (('V'<< 8) | 1) /* MiNT/MagiC */
# define V_CNTR_SLNK (('V'<< 8) | 2) /* MiNT, works on FAT and VFAT */
# define V_CNTR_RES3 (('V'<< 8) | 3) /* reserved, not used at the moment */
# define V_CNTR_MODE (('V'<< 8) | 4) /* MiNT, works on FAT */
/* name mode flags: */
# define GEMDOS 0
# define ISO 1
# define MSDOS 2
# define V_CNTR_FAT32 (('V'<< 8) | 10) /* MiNT, FAT32 control */
struct control_FAT32
{
unsigned short mode; /* 0 = fill out; 1 = set values */
unsigned short mirr; /* FAT mirroring: 0 = enabled, otherwise active FAT */
unsigned short fats; /* number of FATs */
unsigned short info; /* status of additional info sector */
# define FAT32_info_exist 0x1
# define FAT32_info_active 0x2
# define FAT32_info_reset 0x4
};
# define V_CNTR_WP (('V'<< 8) | 100) /* MiNT, write protect control */
# define V_CNTR_WB (('V'<< 8) | 101) /* MiNT, write back control */
/*
* Ext2 filesystem extensions
*/
# define EXT2_IOC_GETFLAGS (('f'<< 8) | 1)
# define EXT2_IOC_SETFLAGS (('f'<< 8) | 2)
# define EXT2_IOC_GETVERSION (('v'<< 8) | 1)
# define EXT2_IOC_SETVERSION (('v'<< 8) | 2)
/*
* cursor control
*/
# define TCURSOFF (('c'<< 8) | 0)
# define TCURSON (('c'<< 8) | 1)
# define TCURSBLINK (('c'<< 8) | 2)
# define TCURSSTEADY (('c'<< 8) | 3)
# define TCURSSRATE (('c'<< 8) | 4)
# define TCURSGRATE (('c'<< 8) | 5)
# define TCURSSDELAY (('c'<< 8) | 6) /* undocumented! */
# define TCURSGDELAY (('c'<< 8) | 7) /* undocumented! */
/*
* MagiC opcodes (all group 'm' opcodes are reserved for MagiC)
*/
# define MX_KER_GETINFO (('m'<< 8) | 0) /* mgx_dos.txt */
# define MX_KER_DOSLIMITS (('m'<< 8) | 1) /* mgx_dos.txt */
# define MX_KER_INSTXFS (('m'<< 8) | 2) /* mgx_dos.txt */
# define MX_KER_DRVSTAT (('m'<< 8) | 4) /* mgx_dos.txt */
# define MX_KER_XFSNAME (('m'<< 8) | 5) /* mgx_dos.txt */
# define MX_DEV_INSTALL (('m'<< 8) | 0x20) /* mgx_dos.txt */
# define MX_DFS_GETINFO (('m'<< 8) | 0x40) /* mgx_dos.txt */
# define MX_DFS_INSTDFS (('m'<< 8) | 0x41) /* mgx_dos.txt */
/*
* Printers (whole range reserved)
*/
/*# define PNVDI (('p'<< 8) | *)*/ /* NVDI programmer's manual */
/*
* MagiC specific calls for device driver installation (use group 'm'!)
*/
/*# define PROC_CREATE 0xcc00*/ /* mgx_dos.txt */
/*# define DEV_M_INSTALL 0xcd00*/ /* mgx_dos.txt */
/*
* device driver installation
*/
# define DEV_NEWTTY 0xde00
# define DEV_NEWBIOS 0xde01
# define DEV_INSTALL 0xde02
/*
* filesystem installation
*/
# define FS_INSTALL 0xf001 /* let the kernel know about the file system */
# define FS_MOUNT 0xf002 /* make a new directory for a file system */
# define FS_UNMOUNT 0xf003 /* remove a directory for a file system */
# define FS_UNINSTALL 0xf004 /* remove a file system from the list */
/*
* filesystem information
*/
# define FS_INFO 0xf100 /* xfs fill out the following struct */
struct fs_info
{
char name [32]; /* name of the xfs (same as MX_KER_XFSNAME but more space) */
long version; /* upper word: major version; lower word: minor version */
long type; /* upper word: major type; lower word: minor type */
char type_asc[32]; /* human readable version of type */
};
/* values of fs_info.type */
# define _MAJOR_FAT (1L << 16)
# define _MAJOR_VFAT (2L << 16)
# define _MAJOR_MINIX (3L << 16)
# define _MAJOR_RAMFS (4L << 16)
# define _MAJOR_EXT2 (5L << 16)
# define _MAJOR_HSIERRA (6L << 16)
# define _MAJOR_ISO9660 (7L << 16)
# define _MAJOR_JOLIET (8L << 16)
# define _MAJOR_HFS (9L << 16)
# define _MAJOR_CDRAW (10L << 16)
# define _MAJOR_STONX (11L << 16)
# define FS_OLDTOS (0L) /* default/unknown */
# define FS_FAT12 (_MAJOR_FAT | 0) /* MiNT 1.15 */
# define FS_FAT16 (_MAJOR_FAT | 1) /* MiNT 1.15 */
# define FS_FAT32 (_MAJOR_FAT | 2) /* MiNT 1.15 */
# define FS_VFAT12 (_MAJOR_VFAT | 0) /* MiNT 1.15 */
# define FS_VFAT16 (_MAJOR_VFAT | 1) /* MiNT 1.15 */
# define FS_VFAT32 (_MAJOR_VFAT | 2) /* MiNT 1.15 */
# define FS_MINIX (_MAJOR_MINIX) /* MinixFS 0.70p6 */
# define FS_RAMFS (_MAJOR_RAMFS) /* fnRamFS 0.52 */
# define FS_EXT2 (_MAJOR_EXT2) /* Ext2 0.?? */
# define FS_HSIERRA (_MAJOR_HSIERRA) /* Spin 0.35 */
# define FS_ISO9669 (_MAJOR_ISO9660) /* Spin 0.35 */
# define FS_JOLIET (_MAJOR_JOLIET) /* Spin 0.35 */
# define FS_HFS (_MAJOR_HFS) /* Spin 0.35 */
# define FS_CDRAW (_MAJOR_CDRAW) /* Spin 0.35 */
# define FS_STONX (_MAJOR_STONX) /* STonXfs4MiNT */
# define FS_USAGE 0xf101 /* xfs fill out the following struct */
struct fs_usage
{
unsigned long blocksize; /* 32bit: size in bytes of a block */
llong blocks; /* 64bit: number of blocks */
llong free_blocks; /* 64bit: number of free blocks */
llong inodes; /* 64bit: number of inodes or FS_UNLIMITED */
llong free_inodes; /* 64bit: number of free inodes or FS_UNLIMITED */
# define FS_UNLIMITED -1
};
# endif /* _DCNTL_H */

View File

@@ -0,0 +1,757 @@
/* mint/errno.h -- MiNTLib.
Copyright (C) 1999 Guido Flohr <guido@freemint.de>
This file is part of the MiNTLib project, and may only be used
modified and distributed under the terms of the MiNTLib project
license, COPYMINT. By continuing to use, modify, or distribute
this file you indicate that you have read the license and
understand and accept it fully.
*/
#ifndef _MINT_ERRNO_H
# define _MINT_ERRNO_H 1 /* Allow multiple inclusion. */
#ifndef __KERNEL__
# ifndef _FEATURES_H
# include <features.h>
# endif
/* See below. */
#define __KERNEL_NEG(c) c
#else /* __KERNEL__ */
/* The kernel should actually have code like
if (whew_we_dont_know_that)
return -ENOSYS;
instead of the current
if (whew_we_dont_know_that)
return ENOSYS;
That seems to be a matter of taste.
As a convenience we offer both possibilities here:
*/
# ifdef POSITIVE_ERROR_CODES
# define __KERNEL_NEG(c) (c)
# else /* not POSITIVE_ERROR_CODES */
# define __KERNEL_NEG(c) (-(c))
# endif /* not POSITIVE_ERROR_CODES */
/* If you prefer to type E_OK instead of 0 ... */
# define E_OK 0
#endif /* not __KERNEL__ */
/* The original atarierr.h defined quite a few error codes which were
either useless or non-standard. Important codes such as EISDIR,
ENOTEMPTY were missing, others were simply misunderstood (for example
the usual EINVAL would really be an ENOSYS, EINVAL is not invalid
function number but invalid argument) and especially in MiNT
some error codes got really overloaded, for example ENOENT serves
as ENOENT, ESRCH and ECHILD, or EACCES and EPERM were the same.
The codes in this file try to find the closest equivalent for
all error codes currently in use, marks some error codes as
deprecated and tries to be fit for the future by defining all
error codes that may be needed for future enhancement.
*/
/*
The explanations are mostly taken from the GNU libc manual.
Unfortunately they don't always document the current usage in the
MiNT system but rather how it should be. I've marked all current
misusage with either `KERNEL' or `FIXME'.
We provide way too many synonyms for error codes here. Both in
the kernel and the libc only the `official' name (the one in the
top row that bears the actual define) should be used.
*/
/* Where is ENOERR and E_OK? This file is <errno.h> and not <noerror.h>,
no error is 0, basta. */
/* Is this really needed? Deprecated. */
#define EERROR __KERNEL_NEG(1) /* Generic error. */
/* A system resource that can't be shared is already in use. For example
if you try to delete a file that is the root of a currently mounted
filesystem, you get this error.
This used to be EDRNRDY resp. EDRNRDY. */
#define EBUSY __KERNEL_NEG(2) /* Resource busy. */
#ifdef __LOOSE_ERRROR_CODES
# define EDRNRDY EBUSY
# define EDRVNR EBUSY
#endif
/* Deprecated. */
#define EUKCMD __KERNEL_NEG(3) /* Unknown command. */
#ifdef __LOOSE_ERRROR_CODES
# define EUNCMD EUKCMD
#endif
/* Checksum error detected while reading from a block device such as
a floppy drive. Obviously non-standard but often used. */
#define ECRC __KERNEL_NEG(4) /* CRC error. */
#ifdef __LOOSE_ERRROR_CODES
# define E_CRC ECRC
#endif
/* Bad request. */
#define EBADR __KERNEL_NEG(5) /* Bad request. */
#ifdef __LOOSE_ERRROR_CODES
# define EBADREQ EBADR
# define EBADRQ EBADR
#endif
/* Invalid seek operation (such as on a pipe). */
/* KERNEL: The pipe file system currently returns 0 for seek on a pipe! */
#define ESPIPE __KERNEL_NEG(6) /* Illegal seek. */
#ifdef __LOOSE_ERRROR_CODES
# define ESEEK ESPIPE
# define E_SEEK ESPIPE
#endif
/* Wrong medium type. */
#define EMEDIUMTYPE __KERNEL_NEG(7) /* Wrong medium type. */
#ifdef __LOOSE_ERRROR_CODES
# define EUKMEDIA EMEDIUMTYPE
# define EMEDIA EMEDIUMTYPE
#endif
/* A sector that does not exist was addressed in the call to a bock
device function. */
#define ESECTOR __KERNEL_NEG(8) /* Sector not found. */
#ifdef __LOOSE_ERRROR_CODES
# define ESECNF ESECTOR
#endif
/* No paper. No, not at the conveniences, in the printer. */
#define EPAPER __KERNEL_NEG(9) /* No paper. */
/* Read and write faults. Deprecated, be more specific instead. */
#define EWRITE __KERNEL_NEG(10) /* Write fault. */
#ifdef __LOOSE_ERRROR_CODES
# define EWRITEF EWRITE
#endif
#define EREAD __KERNEL_NEG(11) /* Read fault. */
#ifdef __LOOSE_ERRROR_CODES
# define EREADF EREAD
#endif
/* Another generic error. Who can tell the difference to EERROR? */
#define EGENERIC __KERNEL_NEG(12) /* General mishap. */
/* An attempt was made to modify something on a read-only file
file system. */
#define EROFS __KERNEL_NEG(13) /* Write protect. */
/* A removable medium was exchanged before the operation could finish. */
#define ECHMEDIA __KERNEL_NEG(14) /* Media change. */
#ifdef __LOOSE_ERRROR_CODES
# define E_CHNG ECHMEDIA
#endif
/* The wrong type of device was given to a function that expects a
particular sort of device. */
#define ENODEV __KERNEL_NEG(15) /* No such device. */
#ifdef __LOOSE_ERRROR_CODES
# define EUKDEV ENODEV
# define EUNDEV ENODEV
#endif
/* Bad sectors on block device medium found. Uhm, if the driver found
them, mark them as bad and don't bother the user with that.
Deprecated. */
#define EBADSEC __KERNEL_NEG(16) /* Bad sectors found. */
#ifdef __LOOSE_ERRROR_CODES
# define EBADSF EBADSEC
#endif
/* A device with a removable media (such as a floppy) is empty. */
#define ENOMEDIUM __KERNEL_NEG(17) /* No medium found. */
#ifdef __LOOSE_ERRROR_CODES
# define EIDISK ENOMEDIUM
# define EOTHER ENOMEDIUM
#endif
/* MetaDOS error (deprecated). */
#define EINSERT __KERNEL_NEG(18) /* Insert media. */
/* MetaDOS error (deprecated). */
#define EDRVNRSP __KERNEL_NEG(19) /* Drive not responding. */
/* No process matches the specified process ID.
KERNEL: This is a new error code. Currently ENOENT is returned instead. */
#define ESRCH __KERNEL_NEG(20) /* No such process. */
/* There are no child processes. This error happens on operations
that are supposed to manipulate child processes, when there aren't
any processes to manipulate.
KERNEL: This is a new error code. Currently ENOENT is returned instead. */
#define ECHILD __KERNEL_NEG(21) /* No child processes. */
/* Deadlock avoided; allocating a system resource would have resulted
in a deadlock situation. The system does not guarantee that it
will notice all such situations. This error means you got lucky
and the system noticed; it might just hang.
KERNEL: This is a new error code. The kernel currently never returns
it. But that doesn't mean that there are no deadlock situations in
the kernel. */
#define EDEADLK __KERNEL_NEG(22) /* Resource deadlock would occur. */
#define EDEADLOCK EDEADLK
/* A file that isn't a block special file was given in a situation
that requires one. For example, trying to mount an ordinary file
as a file system in Unix gives this error. New code. */
#define ENOTBLK __KERNEL_NEG(23) /* Block device required. */
/* File is a directory; you cannot open a directory for writing, or
create or remove hard links to it.
KERNEL: This is a new error code. Flink() should be fixed. */
#define EISDIR __KERNEL_NEG(24) /* Is a directory. */
/* Invalid argument. This is used to indicate various kinds of
problems with passing the wrong argument to a library function.
FIXME: This used to be the same as `ENOSYS'. In fact that should
be two distinct error codes. For example, the `fchmod' function
should return `EINVAL' if the file descriptor passed as an
argument corresponds to a pipe or socket, not an ordinary file.
But since `fchmod' is a function that is currently only supported
under MiNT the same error would be reported if the operating
system does not support the call at all. It is common practice
to cache such failures because in the case of `ENOSYS' there
is no chance that succeeding calls will proceed. So how do
you want to distinguish between these cases? */
#define EINVAL __KERNEL_NEG(25) /* Invalid argument. */
/* Inappropriate file type or format. The file was the wrong type
for the operation, or a data file had the wrong format.
On some systems `chmod' returns this error if you try to set the
sticky bit on a non-directory file. */
#define EFTYPE __KERNEL_NEG(26) /* Inappropriate file type or format. */
/* While decoding a multibyte character the function came along an
invalid or an incomplete sequence of bytes or the given wide
character is invalid. */
#define EILSEQ __KERNEL_NEG(27) /* Illegal byte sequence. */
/* Function not implemented. Some functions have commands or options
defined that might not be supported in all implementations, and
this is the kind of error you get if your request them and they are
not supported.
KERNEL: This was usually called EINVFN (invalid function number) and
that's why it was probably mixed up with EINVAL (invalid argument).
FIXME: Grep thru the MiNTLib sources for EINVAL and replace it with
the correct ENOSYS. Same for the kernel. */
#define ENOSYS __KERNEL_NEG(32) /* Function not implemented. */
/* This is a "file doesn't exist" error for ordinary files that are
referenced in contexts where they are expected to already exist.
KERNEL/FIXME: This used to be the same as ESRCH and and ECHILD,
in the kernel it was usually called EFILNF. Fix the wrong usage
of ESRCH and ECHILD and replace EFILNF with ENOENT. */
#define ENOENT __KERNEL_NEG(33) /* No such file or directory. */
/* A file that isn't a directory was specified when a directory is
required. The usage of the synonyme EPATH is deprecated! */
#define ENOTDIR __KERNEL_NEG(34) /* Not a directory. */
#ifdef __LOOSE_ERRROR_CODES
# define EPATH ENOTDIR
#endif
/* The current process has too many files open and can't open any
more. Duplicate descriptors do count toward this limit.
In BSD and GNU, the number of open files is controlled by a
resource limit that can usually be increased. If you get this
error, you might want to increase the `RLIMIT_NOFILE' limit
or make it unlimited.
Under MiNT we currently have to live without such luxury. */
#define EMFILE __KERNEL_NEG(35) /* Too many open files. */
/* Permission denied; the file permissions do not allow the
attempted operation.
KERNEL: This used to be mixed up with EPERM (operation not permitted). */
#define EACCES __KERNEL_NEG(36) /* Permission denied. */
#ifdef __LOOSE_ERRROR_CODES
# define EACCESS EACCES
#endif
/* Bad file descriptor; for example, I/O on a descriptor that has been
closed or reading from a descriptor open only for writing (or vice
versa). */
#define EBADF __KERNEL_NEG(37) /* Bad file descriptor. */
/* Operation not permitted; only the owner of the file (or other
resource) or processes with special privileges can perform the
operation.
This is a new error code (used to be a synonyme for EACCES). As
a general rule you can say, whenever you want to disallow something
take EACCES. Only if you positively know that EPERM should be
used, then take this one.
FIXME: Some kernel functions should return EPERM, for example
Tsettimeofday, Tsetdate, Tsettime, Setdate ... */
#define EPERM __KERNEL_NEG(38) /* Operation not permitted. */
/* No memory available. The system cannot allocate more virtual
memory because its capacity is full. */
#define ENOMEM __KERNEL_NEG(39) /* Cannot allocate memory. */
/* Bad address; an invalid pointer was detected. In the GNU system,
this error never happens; you get a signal instead. In the MiNT
system this error often happens, and you get angry mails and flames
on the usenet. */
#define EFAULT __KERNEL_NEG(40) /* Bad address. */
/* No such device or address. The system tried to use the device
represented by a file you specified, and it couldn't find the
device. This can mean that the device file was installed
incorrectly, or that the physical device is missing or not
correctly attached to the computer.
Under MiNT this can also happen if a pathname starts with a
drive letter followed by a colon (e. g. `x:/dont/exist'). This
was called `invalid drive specification' or `invalid drive id'. */
#define ENXIO __KERNEL_NEG(46) /* No such device or address. */
/* An attempt to make an improper link across file systems was
detected. This happens not only when you use `link' (for
hard links) but also when you rename a file with `rename'. */
#define EXDEV __KERNEL_NEG(48) /* Cross-device link. */
/* No more matching file names, only used by Fsnext(2). Don't mix
that up with ENFILE. */
#define ENMFILES __KERNEL_NEG(49) /* No more matching file names. */
#ifdef __LOOSE_ERRROR_CODES
# define ENMFIL ENMFILES
#endif
/* There are too many distinct file openings in the entire system.
Note that any number of linked channels count as just one file
opening. This error never occurs in the GNU system, and it probably
never occurs in the MiNT system, too. */
#define ENFILE __KERNEL_NEG(50) /* File table overflow. */
/* Locking conflict. Deprecated.
KERNEL: If the LOCK_NB flag was selected EWOULDBLOCK should be used
instead. Otherwise the process should be blocked until the lock
is available? */
#define ELOCKED __KERNEL_NEG(58) /* Locking conflict. */
/* Deprecated, should only happen with Dlock(). */
#define ENSLOCK __KERNEL_NEG(59) /* No such lock. */
/* Bad argument, used to be `range error/context unknown'. Deprecated. */
#define EBADARG __KERNEL_NEG(64) /* Bad argument. */
/* Another spurious error, deprecated. */
#define EINTERNAL __KERNEL_NEG(65) /* Internal error. */
#ifdef __LOOSE_ERRROR_CODES
# define EINTRN EINTERNAL
#endif
/* Invalid executable file format. This condition is detected by the
`exec' functions. */
#define ENOEXEC __KERNEL_NEG(66) /* Invalid executable file format. */
#ifdef __LOOSE_ERRROR_CODES
# define EPLFMT ENOEXEC
#endif
/* Can't grow block, deprecated. At least within the library this should
be handled with ENOMEM. */
#define ESBLOCK __KERNEL_NEG(67) /* Memory block growth failure. */
#ifdef __LOOSE_ERRROR_CODES
# define EGSBF ESBLOCK
#endif
/* Terminated with CTRL-C (Kaos, MagiC, BigDOS). Nonsense. */
#define EBREAK __KERNEL_NEG(68) /* Aborted by user. */
/* This looks like a joke but it isn't. Who has introduced that
in the kernel? - fna: comes from MagiC */
#define EXCPT __KERNEL_NEG(69) /* Terminated with bombs. */
/* An attempt to execute a file that is currently open for writing, or
write to a file that is currently being executed. Often using a
debugger to run a program is considered having it open for writing
and will cause this error. (The name stands for "text file
busys".) This is not an error in the GNU system; the text is
copied as necessary. In the MiNT system this error currently cannot
occur. */
#define ETXTBSY __KERNEL_NEG(70) /* Text file busy. */
/* File too big; the size of a file would be larger than allowed by
the system.
KERNEL: This is a new code. If this error condition can occur,
then the correct code should be returned. */
#define EFBIG __KERNEL_NEG(71) /* File too big. */
/* Too many levels of symbolic links were encountered in looking up a
file name. This often indicates a cycle of symbolic links.
KERNEL: There was no difference between EMLINK (too many links and
ELOOP (too many symbolic links). The more common meaning of this
error code is preserved, but whenenver EMLINK should be used, this
has to be fixed in the kernel. */
#define ELOOP __KERNEL_NEG(80) /* Too many symbolic links. */
/* Broken pipe; there is no process reading from the other end of a
pipe. Every function that returns this error code also generates
a `SIGPIPE' signal; this signal terminates the program if not
handled or blocked. Thus, your program will never actually see
`EPIPE' unless it has handled or blocked `SIGPIPE'. */
#define EPIPE __KERNEL_NEG(81) /* Broken pipe. */
/* Too many links; the link count of a single file would become too
large. `rename' can cause this error if the file being renamed
already has as many links as it can take.
KERNEL: This is a new error code. See the note for ELOOP. */
#define EMLINK __KERNEL_NEG(82) /* Too many links. */
/* Directory not empty, where an empty directory was expected. Typically
this error occurs when you are trying to delete a directory.
KERNEL: New error code, for the case of non-empty directories
EEXIST was returned. The new behavior could cause compatibility
problems since inproper implementations of recursive rm commands
could rely on the old error code (85) being returned.
Which error is more probable? */
#define ENOTEMPTY __KERNEL_NEG(83) /* Directory not empty. */
/* File exists; an existing file was specified in a context where it
only makes sense to specify a new file. */
#define EEXIST __KERNEL_NEG(85) /* File exists. */
/* Filename too long (longer than `PATH_MAX') or host name too long
(in `gethostname' or `sethostname'). */
#define ENAMETOOLONG __KERNEL_NEG(86) /* Name too long. */
/* Inappropriate I/O control operation, such as trying to set terminal
modes on ordinary files. */
#define ENOTTY __KERNEL_NEG(87) /* Not a tty. */
/* Range error; used by mathematical functions when the result value
is not representable because of overflow or underflow.
The string to number conversion functions (`strtol', `strtoul',
`strtod', etc. can also return this error. */
#define ERANGE __KERNEL_NEG(88) /* Range error. */
/* Domain error; used by mathematical functions when an argument
value does not fall into the domain over which the function is
defined. */
#define EDOM __KERNEL_NEG(89) /* Domain error. */
/* Input/output error; usually used for physical read or write errors. */
#define EIO __KERNEL_NEG(90) /* I/O error */
/* No space left on device; write operation on a file failed because
the disk is full. */
#define ENOSPC __KERNEL_NEG(91) /* No space left on device. */
/* Error number 92-99 reserved for TraPatch. */
/* This means that the per-user limit on new process would be
exceeded by an attempted `fork'. */
#define EPROCLIM __KERNEL_NEG(100) /* Too many processes for user. */
/* This file quota system is confused because there are too many users. */
#define EUSERS __KERNEL_NEG(101) /* Too many users. */
/* The user's disk quota was exceeded. */
#define EDQUOT __KERNEL_NEG(102) /* Quota exceeded. */
/* Stale NFS handle. This indicates an internal confusion in
the NFS system which is due to file system rearrangements on the
server host. Reparing this condition usually requires unmounting
and remounting the NFS file system on the local host. */
#define ESTALE __KERNEL_NEG(103) /* Stale NFS file handle. */
/* An attempt was made to NFS-mount a remote file system with a file
name that already specifies an NFS-mounted file. (This is an
error on some operating systems, but we expect it to work properly
on the GNU system, making this error code impossible). */
#define EREMOTE __KERNEL_NEG(104) /* Object is remote. */
/* ??? */
#define EBADRPC __KERNEL_NEG(105) /* RPC struct is bad. */
#define ERPCMISMATCH __KERNEL_NEG(106) /* RPC version wrong. */
#define EPROGUNAVAIL __KERNEL_NEG(107) /* RPC program not available. */
#define EPROGMISMATCH __KERNEL_NEG(108) /* RPC program version wrong. */
#define EPROCUNAVAIL __KERNEL_NEG(109) /* RPC bad procedure for program. */
/* No locks available. This is used by the file locking facilities;
This error is never generated by the GNU system, but it can result
from an operation to an NFS server running another operating system. */
#define ENOLCK __KERNEL_NEG(110) /* No locks available. */
/* ??? */
#define EAUTH __KERNEL_NEG(111) /* Authentication error. */
#define ENEEDAUTH __KERNEL_NEG(112) /* Need authenticator. */
/* In the GNU system, servers supporting the `term' protocol return
this error for certain operations when the caller is not in the
foreground process group of the terminal. Users do not usually
see this error because functions such as `read' and `write'
translate it into a `SIGTTIN' or `SIGTTOU' signal. */
#define EBACKGROUND __KERNEL_NEG(113) /* Inappropriate operation for background process. */
/* ??? */
#define EBADMSG __KERNEL_NEG(114) /* Not a data message. */
#define EIDRM __KERNEL_NEG(115) /* Identifier removed. */
#define EMULTIHOP __KERNEL_NEG(116) /* Multihop attempted. */
#define ENODATA __KERNEL_NEG(117) /* No data available. */
#define ENOLINK __KERNEL_NEG(118) /* Link has been severed. */
#define ENOMSG __KERNEL_NEG(119) /* No message of desired type. */
#define ENOSR __KERNEL_NEG(120) /* Out of streams resources. */
#define ENOSTR __KERNEL_NEG(121) /* Device not a stream. */
#define EOVERFLOW __KERNEL_NEG(122) /* Value too large for defined data type. */
#define EPROTO __KERNEL_NEG(123) /* Protocol error. */
#define ETIME __KERNEL_NEG(124) /* Timer expired. */
/* Argument list too long; used when the arguments passed to a new
program being executed with one of the `exec' functions occupy
too much memory space. This condition never arises in the
MiNT system. */
#define E2BIG __KERNEL_NEG(125) /* Argument list too long. */
/* The following error codes are defined by the Linux/i386 kernel.
Some of them are probably useful for MiNT, too. */
#define ERESTART __KERNEL_NEG(126) /* Interrupted system call should be
restarted. */
#define ECHRNG __KERNEL_NEG(127) /* Channel number out of range. */
/* Interrupted function call; an asynchronous signal occured and
prevented completion of the call. When this happens, you should
try the call again.
On other systems you can choose to have functions resume after a
signal handled, rather than failing with `EINTR'. */
#define EINTR __KERNEL_NEG(128) /* Interrupted function call. */
/* Falcon XBIOS errors. */
#define ESNDLOCKED __KERNEL_NEG(129) /* Sound system is already locked. */
#define ESNDNOTLOCK __KERNEL_NEG(130) /* Sound system is not locked. */
#define EL2NSYNC __KERNEL_NEG(131) /* Level 2 not synchronized. */
#define EL3HLT __KERNEL_NEG(132) /* Level 3 halted. */
#define EL3RST __KERNEL_NEG(133) /* Level 3 reset. */
#define ELNRNG __KERNEL_NEG(134) /* Link number out of range. */
#define EUNATCH __KERNEL_NEG(135) /* Protocol driver not attached. */
#define ENOCSI __KERNEL_NEG(136) /* No CSI structure available. */
#define EL2HLT __KERNEL_NEG(137) /* Level 2 halted. */
#define EBADE __KERNEL_NEG(138) /* Invalid exchange. */
#define EXFULL __KERNEL_NEG(139) /* Exchange full. */
#define ENOANO __KERNEL_NEG(140) /* No anode. */
#define EBADRQC __KERNEL_NEG(141) /* Invalid request code. */
#define EBADSLT __KERNEL_NEG(142) /* Invalid slot. */
#define EBFONT __KERNEL_NEG(143) /* Bad font file format. */
#define ENONET __KERNEL_NEG(144) /* Machine is not on the network. */
#define ENOPKG __KERNEL_NEG(145) /* Package is not installed. */
#define EADV __KERNEL_NEG(146) /* Advertise error. */
#define ESRMNT __KERNEL_NEG(147) /* Srmount error. */
#define ECOMM __KERNEL_NEG(148) /* Communication error on send. */
#define EDOTDOT __KERNEL_NEG(149) /* RFS specific error. */
#define ELIBACC __KERNEL_NEG(150) /* Cannot access a needed shared library. */
#define ELIBBAD __KERNEL_NEG(151) /* Accessing a corrupted shared library. */
#define ELIBSCN __KERNEL_NEG(152) /* .lib section in a.out corrupted. */
#define ELIBMAX __KERNEL_NEG(153) /* Attempting to link too many shared
libraries. */
#define ELIBEXEC __KERNEL_NEG(154) /* Cannot exec a shared library directly. */
#define ESTRPIPE __KERNEL_NEG(155) /* Streams pipe error. */
#define EUCLEAN __KERNEL_NEG(156) /* Structure needs cleaning. */
#define ENOTNAM __KERNEL_NEG(157) /* Not a XENIX named type file. */
#define ENAVAIL __KERNEL_NEG(158) /* NO XENIX semaphores available. */
#define EREMOTEIO __KERNEL_NEG(159) /* Remote I/O error. */
#ifdef __KERNEL__
/* This is not really an error but a dummy error code used within the kernel
to indicate that a mount point may have been crossed. */
#define EMOUNT __KERNEL_NEG(200)
#endif
/* There used to be a distinction between MiNTNet errors and ordinary
MiNT errors. This macro is provided for backwards compatibility. */
#define _NE_BASE 300
/* A file that isn't a socket was specified when a socket is required. */
#define ENOTSOCK __KERNEL_NEG(300) /* Socket operation on non-socket. */
/* No default destination address was set for the socket. You get
this error when you try to transmit data over a connectionless
socket, without first specifying a destination for the data with
`connect'. */
#define EDESTADDRREQ __KERNEL_NEG(301) /* Destination address required. */
/* The size of a message sent on a socket was larger than the
supported maximum size. */
#define EMSGSIZE __KERNEL_NEG(302) /* Message too long. */
/* The socket type does not support the requested communications
protocol. */
#define EPROTOTYPE __KERNEL_NEG(303) /* Protocol wrong type for socket. */
/* You specified a socket option that doesn't make sense for the
particular protocol being used by the socket. */
#define ENOPROTOOPT __KERNEL_NEG(304) /* Protocol not available. */
/* The socket domain does not support the requested communications
protocol (perhaps because the requested protocol is completely
invalid). */
#define EPROTONOSUPPORT __KERNEL_NEG(305) /* Protocol not supported. */
/* The socket type is not supported. */
#define ESOCKTNOSUPPORT __KERNEL_NEG(306) /* Socket type not supported. */
/* The operation you requested is not supported. Some socket
functions don't make sense for all type of sockets, and others
may not be implemented for all communications prototcols. In the
GNU system, this error can happen for many calls when the object
does not support the particular operation; it is a generic
indication that the server knows nothing to do for that
cal. */
#define EOPNOTSUPP __KERNEL_NEG(307) /* Operation not supported. */
/* The socket communications protocol family you requested is not
supported. */
#define EPFNOSUPPORT __KERNEL_NEG(308) /* Protocol family not supported. */
/* The address family specified for a socket is not supported; it is
inconsistent with the protocol being used on the socket. */
#define EAFNOSUPPORT __KERNEL_NEG(309) /* Address family not supported
by protocol. */
/* The requested socket address is already in use. */
#define EADDRINUSE __KERNEL_NEG(310) /* Address already in use */
/* The requested socket address is not available; for example, you
tried to give a socket a name that doesn't match the local host
name. */
#define EADDRNOTAVAIL __KERNEL_NEG(311) /* Cannot assign requested address. */
/* A socket operation failed because the network was down. */
#define ENETDOWN __KERNEL_NEG(312) /* Network is down. */
/* A socket operation failed because the subnet containing the remote
host was unreachable. */
#define ENETUNREACH __KERNEL_NEG(313) /* Network is unreachable. */
/* A network connection was reset because the remote host crashed. */
#define ENETRESET __KERNEL_NEG(314) /* Network dropped conn. because of
reset. */
/* A network connnection was aborted locally. */
#define ECONNABORTED __KERNEL_NEG(315) /* Software caused connection abort. */
/* A network connection was closed for reasons outside the control of
the local host, such as by the remote machine rebooting or an
unrecoverable protocol violation. */
#define ECONNRESET __KERNEL_NEG(316) /* Connection reset by peer. */
/* You tried to connect a socket that is already connected. */
#define EISCONN __KERNEL_NEG(317) /* Socket is already connected. */
/* The socket is not connected to anything. You get this error when
you try to transmit data over the socket, without first specifying
a destination for the data. For a connectionless socket (for
datagram protocols, such as UDP), you get `EDESTADDRREQ' instead. */
#define ENOTCONN __KERNEL_NEG(318) /* Socket is not connected. */
/* The socket has already been shut down. */
#define ESHUTDOWN __KERNEL_NEG(319) /* Cannot send after shutdown. */
/* A socket operation with a specified timeout received nor response
during the timeout period. */
#define ETIMEDOUT __KERNEL_NEG(320) /* Connection timed out. */
/* A remote host refused to allow the network connection (typically
because it is not running the requested service). */
#define ECONNREFUSED __KERNEL_NEG(321) /* Connection refused. */
/* The remote host for a requested network connection is down. */
#define EHOSTDOWN __KERNEL_NEG(322) /* Host is down. */
/* The remote host for a requested network connection is not
reachable. */
#define EHOSTUNREACH __KERNEL_NEG(323) /* No route to host. */
/* An operation is already in progress on an object that has
non-blocking mode selected. */
#define EALREADY __KERNEL_NEG(324) /* Operation already in progress. */
/* An operation that cannot complete immediately was initiated on an
object that has non-blocking mode selected. Some functions that
must always block (such as `connect') never return `EAGAIN'. Instead
they return `EINPROGRESS' to indicate that the operation has begun and
will take some time. Attempts to manipulate the object before the
call completes return `EALREADY'. You can use the `select' function
to find out when the pending operation has completed. */
#define EINPROGRESS __KERNEL_NEG(325) /* Operation now in progress. */
/* Resource temporarily unavailable; the call might work if you try
again later. The macro `EWOULDBLOCK' is another name for `EAGAIN';
they are always the same in the MiNT system.
This error can happen in a few different situations:
* An operation that would block was attempted on an object that
has non-blocking mode selected. Trying the same operation
again will block until some external condition makes it
possible to read, write or connect (whatever the operation).
You can use `select' to find out when the operation will be
possible.
Portability Note: In many older Unix systems, this condition
was indicated by `EWOULDBLOCK', which was a distinct error
code different from `EAGAIN'. To make your program portable,
you should check for both codes and treat them the same.
In C programs you should not use a case statement for that
because that will trigger a compile-time error for systems
where `EWOULDBLOCK' and `EAGAIN' expand to the same numerical
value. You should either handle treat it with preprocessor
macros (test if they are equal or not) or use an if conditional.
* A temporary resource shortage made an operation impossible.
`fork' can return this error. It indicates that the shortage
is expected to pass, so your program can try the call again
later and it may succeed. It is probably a good idea to
delay for a few seconds before trying it again, to allow time
for other processes to release scarce resources. Such
shortages are usually fairly serious and affect the whole
system, so usually an interactive program should report the
error to the user and return to its command loop. */
#define EAGAIN __KERNEL_NEG(326) /* Operation would block. */
#define EWOULDBLOCK EAGAIN
/* The kernel's buffer for I/O operations are all in use. In GNU,
this error is always synonymous with `ENOMEM'; you may get one or
the other from network operations. */
#define ENOBUFS __KERNEL_NEG(327) /* No buffer space available. */
/* Too many references: cannot splice. */
#define ETOOMANYREFS __KERNEL_NEG(328) /* Too many references. */
#define _NE_MAX ETOOMANYREFS
#endif /* _MINT_ERRNO_H */

View File

@@ -0,0 +1,462 @@
/*
* GNU-C Bindings for Falcon XBIOS functions
* -- hyc 11-9-1992 (uunet!hanauma.Jpl.Nasa.Gov!hyc)
*/
#ifndef _FALCON_H
#define _FALCON_H 1
#ifndef _MINT_OSBIND_H
# include <mint/osbind.h>
#endif
#ifndef trap_14_wwwwww
#define trap_14_wwwwww(n,a,b,c,d,e) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
short _a = (short)(a); \
short _b = (short)(b); \
short _c = (short)(c); \
short _d = (short)(d); \
short _e = (short)(e); \
\
__asm__ volatile \
("\
movw %6,sp@-; \
movw %5,sp@-; \
movw %4,sp@-; \
movw %3,sp@-; \
movw %2,sp@-; \
movw %1,sp@-; \
trap #14; \
lea sp@(12),sp" \
: "=r"(retvalue) \
: "g"(n), "r"(_a), "r"(_b), "r"(_c), "r"(_d), "r"(_e) \
: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2", "memory"); \
retvalue; \
})
#endif
#ifndef trap_14_wllll
#define trap_14_wllll(n,a,b,c,d) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
long _a = (long)(a); \
long _b = (long)(b); \
long _c = (long)(c); \
long _d = (long)(d); \
\
__asm__ volatile \
("\
movl %5,sp@-; \
movl %4,sp@-; \
movl %3,sp@-; \
movl %2,sp@-; \
movw %1,sp@-; \
trap #14; \
lea sp@(18),sp" \
: "=r"(retvalue) \
: "g"(n), "r"(_a), "r"(_b), "r"(_c), "r"(_d) \
: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2", "memory"); \
retvalue; \
})
#endif
#ifndef trap_14_wllllll
#define trap_14_wllllll(n,a,b,c,d,e,f) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
long _a = (long)(a); \
long _b = (long)(b); \
long _c = (long)(c); \
long _d = (long)(d); \
long _e = (long)(e); \
long _f = (long)(f); \
\
__asm__ volatile \
("\
movl %7,sp@-; \
movl %6,sp@-; \
movl %5,sp@-; \
movl %4,sp@-; \
movl %3,sp@-; \
movl %2,sp@-; \
movw %1,sp@-; \
trap #14; \
lea sp@(26),sp" \
: "=r"(retvalue) \
: "g"(n), "r"(_a), "r"(_b), "r"(_c), "r"(_d), "r"(_e), "r"(_f) \
: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2", "memory"); \
retvalue; \
})
#endif
#ifndef trap_14_wll
#define trap_14_wll(n,a,b) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
long _a = (long)(a); \
long _b = (long)(b); \
\
__asm__ volatile \
("\
movl %3,sp@-; \
movl %2,sp@-; \
movw %1,sp@-; \
trap #14; \
lea sp@(10),sp" \
: "=r"(retvalue) \
: "g"(n), "r"(_a), "r"(_b) \
: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2", "memory"); \
retvalue; \
})
#endif
#ifndef trap_14_wlwl
#define trap_14_wlwl(n,a,b,c) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
long _a = (long)(a); \
short _b = (short)(b); \
long _c = (long)(c); \
\
__asm__ volatile \
("\
movl %4,sp@-; \
movw %3,sp@-; \
movl %2,sp@-; \
movw %1,sp@-; \
trap #14; \
lea sp@(12),sp" \
: "=r"(retvalue) \
: "g"(n), "r"(_a), "r"(_b), "r"(_c) \
: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2", "memory"); \
retvalue; \
})
#endif
/*
* Video
*/
/* Video mode codes */
#define VERTFLAG 0x100 /* double-line on VGA, interlace on ST/TV */
#define STMODES 0x080 /* ST compatible */
#define OVERSCAN 0x040 /* Multiply X&Y rez by 1.2, ignored on VGA */
#define PAL 0x020 /* PAL if set, else NTSC */
#define VGA 0x010 /* VGA if set, else TV mode */
#define COL80 0x008 /* 80 column if set, else 40 column */
#define NUMCOLS 7 /* Mask for number of bits per pixel */
#define BPS16 4
#define BPS8 3
#define BPS4 2
#define BPS2 1
#define BPS1 0
/* VgetMonitor() return values */
enum montypes {STmono=0, STcolor, VGAcolor, TVcolor};
/* VsetSync flags - 0=internal, 1=external */
#define VID_CLOCK 1
#define VID_VSYNC 2
#define VID_HSYNC 4
#define VsetScreen(lscrn,pscrn,rez,mode) \
(void)trap_14_wllww((short)5,(long)(lscrn),(long)(pscrn), \
(short)(rez),(short)(mode))
#define VsetMode(mode) \
(short)trap_14_ww((short)88,(short)(mode))
#define VgetMonitor() \
(short)trap_14_w((short)89)
#define VgetSize(mode) \
(long)trap_14_ww((short)91,(short)(mode))
#define VsetSync(ext) \
(void)trap_14_ww((short)90,(short)(ext))
#define VsetRGB(index,count,array) \
(void)trap_14_wwwl((short)93,(short)(index),(short)(count), \
(long *)(array))
#define VgetRGB(index,count,array) \
(void)trap_14_wwwl((short)94,(short)(index),(short)(count), \
(long *)(array))
#define Validmode(mode) \
(short)trap_14_ww((short)95,(short)(mode))
#define VsetMask(andmask,ormask) \
(short)trap_14_www((short)150,(short)(andmask),(short)(ormask))
/*
* Sound
*/
/* _SND cookie values */
#define SND_PSG 0x01 /* Yamaha PSG */
#define SND_8BIT 0x02 /* 8 bit DMA stereo */
#define SND_16BIT 0x04 /* 16 bit CODEC */
#define SND_DSP 0x08 /* DSP */
#define SND_MATRIX 0x10 /* Connection Matrix */
/* XXX Docs say Falcon shows 0x3f. What does bit 0x20 mean ??? */
/*
* Sound data memory layout - samples are all signed values
*
* (each char = 1 byte, 2 chars = 1 word)
* 1 16 bit stereo track: LLRRLLRRLLRRLLRR
* 1 8 bit stereo track: LRLRLRLR
* 2 16 bit stereo tracks: L0R0L1R1L0R0L1R1
* etc...
*/
/* Setbuffer regions */
#define SR_PLAY 0 /* Set playback registers */
#define SR_RECORD 1 /* Set record registers */
/* Soundcmd Modes */
#define LTATTEN 0 /* Left-channel output attenuation */
#define RTATTEN 1 /* Right channel atten */
#define LTGAIN 2 /* Left input gain */
#define RTGAIN 3 /* Right channel gain */
/* gain and attenuation in 1.5 dB units, 0x00V0, V:0-15 */
#define ADDERIN 4 /* Select inputs to adder 0=off, 1=on */
#define ADCIN 1 /* Input from ADC */
#define MATIN 2 /* Input from connection matrix */
#define ADCINPUT 5 /* Select input to ADC, 0=mic, 1=PSG */
#define ADCRT 1 /* Right channel input */
#define ADCLT 2 /* Left input */
#define SETPRESCALE 6 /* Set TT compatibility prescaler */
#define PREMUTE 0 /* was /1280, now is invalid, mutes */
#define PRE1280 PREMUTE
#define PRE640 1 /* divide by 640 */
#define PRE320 2 /* / 320 */
#define PRE160 3 /* / 160 */
/* Record/Playback modes */
#define STEREO8 0 /* 8 bit stereo */
#define STEREO16 1 /* 16 bit stereo */
#define MONO8 2 /* 8 bit mono */
/* Record/Playback tracks range from 0 to 3 */
/* XXX Doc for Settracks could be clearer. Can we individually set, e.g.,
tracks 0 & 2 for playback, or must track selections be contiguous? */
/* Sound buffer interrupts */
/* sources */
#define SI_TIMERA 0 /* Timer A interrupt */
#define SI_MFPI7 1 /* MFP interrupt 7 */
/* causes */
#define SI_NONE 0 /* No interrupts */
#define SI_PLAY 1 /* Intr at end of play buffer */
#define SI_RECORD 2 /* Intr at end of record buffer */
#define SI_BOTH 3 /* Interrupt for either play or record */
/* Buffoper flags */
#define SB_PLA_ENA 1 /* Play enable */
#define SB_PLA_RPT 2 /* Play repeat (continuous loop mode) */
#define SB_REC_ENA 4 /* Record enable */
#define SB_REC_RPT 8 /* Record repeat */
/* Dsptristate - 0=tristate, 1=enable */
/* Gpio modes */
#define GPIO_SET 0 /* Set I/O direction, 0=in, 1=out */
#define GPIO_READ 1 /* Read bits - only 3 bits on gpio */
#define GPIO_WRITE 2 /* Write gpio data bits */
/* Devconnect (connection matrix) source devices */
#define DMAPLAY 0 /* DMA playback */
#define DSPXMIT 1 /* DSP transmit */
#define EXTINP 2 /* External input */
#define ADC 3 /* Microphone/PSG, see Soundcmd(ADCINPUT) */
/* Devconnect destination devices, bitmapped */
#define DMAREC 1 /* DMA record */
#define DSPRECV 2 /* DSP receive */
#define EXTOUT 4 /* External output */
#define DAC 8 /* Headphone, internal speaker, monitor */
/* Devconnect clock sources */
#define CLK25M 0 /* Internal 25.175 MHz clock */
#define CLKEXT 1 /* External clock */
#define CLK32M 2 /* Internal 32 MHz. Invalid for CODEC */
/* Devconnect clock prescaler values */
/* XXX Doc lists incorrect hz numbers for many of these... */
#define CLKOLD 0 /* TT compatible, see Soundcmd(SETPRESCALE) */
#define CLK50K 1 /* 49170 hz */
#define CLK33K 2 /* 32780 hz */
#define CLK25K 3 /* 24585 hz */
#define CLK20K 4 /* 19668 hz */
#define CLK16K 5 /* 16390 hz */
/* 6 (14049 hz) invalid for CODEC */
#define CLK12K 7 /* 12292 hz */
/* 8 (10927 hz) invalid for CODEC */
#define CLK10K 9 /* 9834 hz */
/* 10 (8940 hz) invalid for CODEC */
#define CLK8K 11 /* 8195 hz */
/* 12 (7565 hz) invalid */
/* 13 (7024 hz) invalid */
/* 14 (6556 hz) invalid */
/* 15 (6146 hz) invalid */
/* Sndstatus command */
#define SND_CHECK 0 /* Check current status */
#define SND_RESET 1 /* Reset sound system */
/*
* Reset effects: DSP tristated, gain=atten=0, matrix reset,
* ADDERIN=0, Mode=STEREO8, Play=Record=Monitor tracks=0,
* interrupts disabled, buffer operation disabled.
*/
/* Sndstatus status return */
#define SS_OK 0 /* No errors */
#define SS_CTRL 1 /* Invalid control field (Data assumed OK) */
#define SS_SYNC 2 /* Invalid sync format (mutes) */
#define SS_SCLK 3 /* Serial clock out of valid range (mutes) */
#define SS_RTCLIP 0x10 /* Right channel is clipping */
#define SS_LTCLIP 0x20 /* Left channel is clipping */
/* Structure used by Buffptr */
typedef struct SndBufPtr {
char *play;
char *record;
long reserve1;
long reserve2;
} SndBufPtr;
#define Locksnd() \
(long)trap_14_w((short)128)
#define Unlocksnd() \
(long)trap_14_w((short)129)
#define Setbuffer(region,beg,end) \
(long)trap_14_wwll((short)131,(short)(region),(long)(beg),(long)(end))
#define Soundcmd(mode,data) \
(long)trap_14_www((short)130,(short)(mode),(short)(data))
#define Setmode(stereo_mode) \
(long)trap_14_ww((short)132,(short)(stereo_mode))
#define Settracks(play,rec) \
(long)trap_14_www((short)133,(short)(play),(short)(rec))
#define Setmontracks(montrack) \
(long)trap_14_ww((short)134,(short)(montrack))
#define Setinterrupt(src_inter,cause) \
(long)trap_14_www((short)135,(short)(src_inter), \
(short)(cause))
#define Buffoper(mode) \
(long)trap_14_ww((short)136,(short)(mode))
#define Dsptristate(dspxmit,dsprec) \
(long)trap_14_www((short)137,(short)(dspxmit), \
(short)(dsprec))
#define Gpio(mode,data) \
(long)trap_14_www((short)138,(short)(mode),(short)(data))
#define Devconnect(src,dst,sclk,pre,proto) \
(long)trap_14_wwwwww((short)139,(short)(src),(short)(dst), \
(short)(sclk),(short)(pre),(short)(proto))
#define Sndstatus(reset) \
(long)trap_14_ww((short)140,(short)(reset))
#define Buffptr(ptr) \
(long)trap_14_wl((short)141,(long)(ptr))
/*
* DSP functions
*
* Don't even *think* of trying to use these without the manual!
*/
#define Dsp_DoBlock(data_in,size_in,data_out,size_out) \
(void)trap_14_wllll((short)96,(long)(data_in),(long)(size_in), \
(long)(data_out),(long)(size_out))
#define Dsp_BlkHandShake(data_in,size_in,data_out,size_out) \
(void)trap_14_wllll((short)97,(long)(data_in),(long)(size_in), \
(long)(data_out),(long)(size_out))
#define Dsp_BlkUnpacked(data_in,size_in,data_out,size_out) \
(void)trap_14_wllll((short)98,(long)(data_in),(long)(size_in), \
(long)(data_out),(long)(size_out))
#define Dsp_BlkWords(data_in,size_in,data_out,size_out) \
(void)trap_14_wllll((short)123,(long)(data_in),(long)(size_in), \
(long)(data_out),(long)(size_out))
#define Dsp_BlkBytes(data_in,size_in,data_out,size_out) \
(void)trap_14_wllll((short)124,(long)(data_in),(long)(size_in), \
(long)(data_out),(long)(size_out))
#define Dsp_MultBlocks(numsend,numrecv,sendblks,recvblks) \
(void)trap_14_wllll((short)127,(long)(numsend),(long)(numrecv), \
(long)(sendblks),(long)(recvblks))
#define Dsp_InStream(data_in,blksiz,numblks,blksdone) \
(void)trap_14_wllll((short)99,(long)(data_in),(long)(blksiz), \
(long)(numblks),(long)(blksdone))
#define Dsp_OutStream(data_out,blksiz,numblks,blksdone) \
(void)trap_14_wllll((short)100,(long)(data_out),(long)(blksiz), \
(long)(numblks),(long)(blksdone))
#define Dsp_IOStream(data_in,data_out,blkisiz,blkosiz,numblks,blksdone) \
(void)trap_14_wllllll((short)101,(long)(data_in),(long)(data_out),\
(long)(blkisiz),(long)(blkosiz),(long)(numblks), \
(long)(blksdone))
#define Dsp_SetVectors(rcvr,xmtr) \
(void)trap_14_wll((short)126,(long)(rcvr),(long)(xmtr))
#define Dsp_RemoveInterrupts(mask) \
(void)trap_14_ww((short)102,(short)(mask))
#define Dsp_GetWordSize() (short)trap_14_w((short)103)
#define Dsp_Lock() (short)trap_14_w((short)104)
#define Dsp_Unlock() (void)trap_14_w((short)105)
#define Dsp_Available(xmem,ymem) \
(void)trap_14_wll((short)106,(long)(xmem),(long)(ymem))
#define Dsp_Reserve(xmem,ymem) \
(short)trap_14_wll((short)107,(long)(xmem),(long)(ymem))
#define Dsp_LoadProg(file,ability,buffer) \
(short)trap_14_wlwl((short)108,(long)(file),(short)(ability), \
(long)(buffer))
#define Dsp_ExecProg(codeptr,codesiz,ability) \
(void)trap_14_wllw((short)109,(long)(codeptr),(long)(codesiz), \
(short)(ability))
#define Dsp_ExecBoot(codeptr,codesiz,ability) \
(void)trap_14_wllw((short)110,(long)(codeptr),(long)(codesiz), \
(short)(ability))
#define Dsp_LodToBinary(file,codeptr) \
(long)trap_14_wll((short)111,(long)(file),(long)(codeptr))
#define Dsp_TriggerHC(vector) \
(void)trap_14_ww((short)112,(short)(vector))
#define Dsp_RequestUniqueAbility() (short)trap_14_w((short)113)
#define Dsp_GetProgAbility() (short)trap_14_w((short)114)
#define Dsp_FlushSubroutines() (void)trap_14_w((short)115)
#define Dsp_LoadSubroutine(ptr,siz,ability) \
(short)trap_14_wllw((short)116,(long)(ptr),(long)(siz), \
(short)(ability))
#define Dsp_InqSubrAbility(ability) \
(short)trap_14_ww((short)117,(short)(ability))
#define Dsp_RunSubroutine(handle) \
(short)trap_14_ww((short)118,(short)(handle))
#define Dsp_Hf0(flag) \
(short)trap_14_ww((short)119,(short)(flag))
#define Dsp_Hf1(flag) \
(short)trap_14_ww((short)120,(short)(flag))
#define Dsp_Hf2() (short)trap_14_w((short)121)
#define Dsp_Hf3() (short)trap_14_w((short)122)
#define Dsp_HStat() (char)trap_14_w((short)125)
#endif /* _FALCON_H */

View File

@@ -0,0 +1,15 @@
#ifndef _IFLINK_H
#define _IFLINK_H 1
#ifndef _FEATURES_H
# include <features.h>
#endif
__EXTERN int if_link __PROTO ((char*, char*));
__EXTERN int if_getlnkflags __PROTO ((char*, short*));
__EXTERN int if_setlnkflags __PROTO ((char*, short));
__EXTERN int if_getifflags __PROTO ((char*, short*));
__EXTERN int if_setifflags __PROTO ((char*, short));
#endif /* mint/iflink.h */

View File

@@ -0,0 +1,997 @@
/*
* Common include file for C interface to low level Line A calls
*
* ++jrb bammi@cadence.com
*/
#ifndef _MINT_LINEA_H
#define _MINT_LINEA_H
#ifndef _FEATURES_H
# include <features.h>
#endif
__BEGIN_DECLS
/*****************************************************************************\
* *
* Defines *
* *
\*****************************************************************************/
/*
* Object colors (default pallette)
*
*/
#define WHITE 0
#define BLACK 1
#define RED 2
#define GREEN 3
#define BLUE 4
#define CYAN 5
#define YELLOW 6
#define MAGENTA 7
#define LWHITE 8
#define LBLACK 9
#define LRED 10
#define LGREEN 11
#define LBLUE 12
#define LCYAN 13
#define LYELLOW 14
#define LMAGENTA 15
/*
* Vdi writing modes
*
*/
#define MD_REPLACE 1
#define MD_TRANS 2
#define MD_XOR 3
#define MD_ERASE 4
/*
* Raster Op Codes
*
*/
#define ALL_WHITE 0
#define S_AND_D 1
#define S_AND_NOTD 2
#define S_ONLY 3
#define NOTS_AND_D 4
#define D_ONLY 5
#define S_XOR_D 6
#define S_OR_D 7
#define NOT_SORD 8
#define NOT_SXORD 9
#define D_INVERT 10
#define NOT_D 10
#define S_OR_NOTD 11
#define NOT_S 12
#define NOTS_OR_D 13
#define NOT_SANDD 14
#define ALL_BLACK 15
/*
* Sprite formats
*
*/
#define SP_VDI 0
#define SP_XOR 1
/*
* Line A Opcodes
*
*/
#define INIT 0
#define PUTPIXEL 1
#define GETPIXEL 2
#define LINE 3
#define HLINE 4
#define RECTANGLE 5
#define FPOLYGON 6
#define BITBLT 7
#define TEXTBLT 8
#define SHOWMOUSE 9
#define HIDEMOUSE 10
#define TRANMOUSE 11
#define USPRITE 12
#define DSPRITE 13
#define CPYRASTER 14
#define FSEEDFILL 15 /* ROM TOS only */
/*****************************************************************************\
* *
* Types *
* *
\*****************************************************************************/
/*
* Global Variables at negative offsets from the Line A parameter
* block address returned by init. (I have no way of telling if this
* list is complete).
*
*/
/* Name Offset Type Description */
/* --------------------------------------------------------------------------*/
/* V_BYTES_LIN -2 W bytes/line for font */
/* V_Y_MAX -4 W Max Y pixel value of the screen */
/* V_STATUS -6 W Text Status byte */
/* Bit Field Zero One */
/* 0 cursor flash disabled enabled */
/* 1 flash state off on */
/* 2 cursor visible no yes */
/* 3 end of line no-wrap wrap */
/* 4 inverse video on off */
/* 5 cursor saved false true */
/* V_OFF_AD -10 L Font offset table address */
/* V_X_MAX -12 W Max X pixel value */
/* V_FNT_WR -14 W Width of Font Form in bytes (see type FONT below) */
/* V_FNT_ST -16 W First font ASCII code (first_ade) */
/* V_FNT_ND -18 W Last font ASCII code (last_ade ) */
/* V_FNT_AD -22 L Font Form address */
/* Mono Spaced, 8 pixels wide and byte aligned, any ht. */
/* V_CUR_TIM -23 B Cursor countdown timer */
/* V_CUR_CNT -24 B Cursor flash interval( in frames) */
/* V_CUR_CY -26 W Y cursor position */
/* V_CUR_CX -28 W X cursor position */
/* V_CUR_OFF -30 W Offset from screen base to first cell (bytes) */
/* V_CUR_AD -34 L Current cursor address */
/* V_COL_FG -36 W Foreground color index */
/* V_COL_BG -38 W Background color index */
/* V_CEL_WR -40 W Offset to next vertical cell (bytes) */
/* V_CEL_MY -42 W Max cells high - 1 */
/* V_CEL_MX -44 W Max cells across - 1 */
/* V_CEL_HT -46 W Cell height in pixels (font form's height) */
/* --------------------------------------------------------------------------*/
/*
* Atari finally named these variables
* so here they are
*
*/
#define V_CEL_HT (*((short *)((char *)__aline + -46L)))
#define V_CEL_MX (*((short *)((char *)__aline + -44L)))
#define V_CEL_MY (*((short *)((char *)__aline + -42L)))
#define V_CEL_WR (*((short *)((char *)__aline + -40L)))
#define V_COL_BG (*((short *)((char *)__aline + -38L)))
#define V_COL_FG (*((short *)((char *)__aline + -36L)))
#define V_CUR_AD (*((char **)((char *)__aline + -34L)))
#define V_CUR_OFF (*((short *)((char *)__aline + -30L)))
#define V_CUR_CX (*((short *)((char *)__aline + -28L)))
#define V_CUR_CY (*((short *)((char *)__aline + -26L)))
#define V_CUR_CNT (*((char *)((char *)__aline + -24L)))
#define V_CUR_TIM (*( ((char *)__aline + -23L)))
#define V_FNT_AD (*((char **)((char *)__aline + -22L)))
#define V_FNT_ND (*((short *)((char *)__aline + -18L)))
#define V_FNT_ST (*((short *)((char *)__aline + -16L)))
#define V_FNT_WR (*((short *)((char *)__aline + -14L)))
#define V_X_MAX (*((short *)((char *)__aline + -12L)))
#define V_OFF_AD (*((char **)((char *)__aline + -10L)))
#define V_STATUS (*((short *)((char *)__aline + -6L)))
#define V_Y_MAX (*((short *)((char *)__aline + -4L)))
#define V_BYTES_LIN (*((short *)((char *)__aline + -2L)))
/* more obscure variables again found at negative offset */
/* pointer to current font */
#define CUR_FONT (*((__FONT **)((char *)__aline + -906L)))
/* Mouse X hot spot */
#define M_POS_HX (*((short *)((char *)__aline + -856L)))
/* Mouse Y hot spot */
#define M_POS_HY (*((short *)((char *)__aline + -854L)))
/* writing mode for mouse */
#define M_PLANES (*((short *)((char *)__aline + -852L)))
/* mouse bkgd color */
#define M_CDB_BG (*((short *)((char *)__aline + -850L)))
/* mouse fgd color */
#define M_CDB_FG (*((short *)((char *)__aline + -848L)))
/* mous form, 32 words alternating words: bkgd-0, fgd-0 ... bkgd-15 fgd-16 */
#define MASK_FORM ((short *)((char *)__aline + -846L))
/* 45 words of vq_extnd */
#define INQ_TAB ((short *)((char *)__aline + -782L))
/* 45 words of v_opnwk */
#define DEV_TAB ((short *)((char *)__aline + -692L))
/* current mous X */
#define GCURX (*((short *)((char *)__aline + -602L)))
/* current mous Y */
#define GCURY (*((short *)((char *)__aline + -600L)))
/* current mous hide cnt */
#define M_HID_CT (*((short *)((char *)__aline + -598L)))
/* mous button stat, bit0 = left, 1 = right, 0=up, 1=down */
#define MOUSE_BT (*((short *)((char *)__aline + -596L)))
/* 3*16 words of vq_color */
#define REQ_COL ((short *)((char *)__aline + -594L))
/* 15 words containing text, line and marker sizes in dev coords
0 min char width
1 min char height
2 max char width
3 max char height
4 min line width
5 reserved
6 max line width
7 reserved
8 min marker width
9 min marker height
10 max marker width
11 max marker height
12-14 RESERVED */
#define SIZ_TAB ((short *)((char *)__aline + -498L))
/* Pointer to current virtual workstation attributes */
#define CUR_WORK (*((short **)((char *)__aline + -464L)))
/* -> default font hdr */
#define DEF_FONT (*((__FONT **)((char *)__aline + -460L)) )
/* FONT_RING is an array of four longword pointers to linked lists of
font headers. The first entry is the head pointer to the font list,
the second and third are continuation fields, and the fourth is a null
terminator. */
#define FONT_RING ((short *)((char *)__aline + -456L))
/* Number of fonts in the FONT_RING lists */
#define FONT_COUNT (*((short *)((char *)__aline + -440L)))
/* Mouse status
Bit 0 = left mouse button status (0=up, 1=down)
Bit 1 = right mouse button status (0=up, 1=down)
Bit 2 = reserved
Bit 3 = reserved
Bit 4 = reserved
Bit 5 = mouse movement flag (0=no movement, 1=movement)
Bit 6 = right mouse button change flag (0=nochange, 1=change)
Bit 7 = left mouse button change flag (0=nochange, 1=change) */
#define CUR_MS_STAT (*((char *)__aline + -348L))
/* Hide depth of alpha cursor */
#define V_HID_CNT (*((short *)((char *)__aline + -346L)))
/* Mouse cursor X position */
#define CUR_X (*((short *)((char *)__aline + -344L)))
/* Mouse cursor Y position */
#define CUR_Y (*((short *)((char *)__aline + -342L)))
/* Nonzero = draw mouse form on VBLANK. */
#define CUR_FLAG (*((char *)__aline + -340L))
/* Non-zero if mouse interrupt processing is enabled */
#define MOUSE_FLAG (*((char *)__aline + -339L))
/* Saved alpha cursor X coord */
#define V_SAV_X (*((short *)((char *)__aline + -334L)))
/* Saved alpha cursor Y coord */
#define V_SAV_Y (*((short *)((char *)__aline + -332L)))
/* height of saved form */
#define SAVE_LEN (*((short *)((char *)__aline + -330L)))
/* Screen address of first word saved from screen */
#define SAVE_ADDR (*((char **)((char *)__aline + -328L)))
/* Save Status
bit 0 => 1 = info in buffer is valid.
0 = info in buffer is not valid.
bit 1 => If 1, double-word wide area was saved.
If zero, word wide area was saved.
bits 2-15 RESERVED */
#define SAVE_STAT (*((short *)((char *)__aline + -324L)))
/* Save up to 4 planes, 16 longwords per plane. */
#define SAVE_AREA ((long *)((char *)__aline + -322L))
/* USER_TIM is a pointer to a user installed routine executed on each
system timer tick. When done, this routine should jump to the
address held in NEXT_TIM. For more information, see the VDI manual
under Exchange Timer Interrupt Vector. */
#define USER_TIM (*((void(**)())((char *)__aline + -66L)))
#define NEXT_TIM (*((void(**)())((char *)__aline + -62L)))
/* User button vector */
#define USER_BUT (*((void(**)())((char *)__aline + -58L)))
/* User cursor vector */
#define USER_CUR (*((void(**)())((char *)__aline + -54L)))
/* User motion vector */
#define USER_MOT (*((void(**)())((char *)__aline + -50L)))
/* A pointer to the type LINEA is returned by the Line A init call
* ($A000), in registers A0 and D0.
* This pointer is saved in the global variable '__aline'.
*
*/
typedef struct {
/* Type Name Offset Function Comments */
/* ------------------------------------------------------------------------- */
short _VPLANES; /* 0 # of Planes Also see CurrRez */
short _VWRAP; /* 2 Bytes / scan line " " " */
/* VWRAP can be changed to implement special effect*/
/* Doubling VWRAP will skip every other scan line */
/* */
/* */
short *_CONTRL; /* 4 Ptr to CONTRL Array Contrl gets set to this */
short *_INTIN; /* 8 Ptr to INTIN Array Intin gets set to this */
short *_PTSIN; /* 12 Ptr to PTSIN Array Ptsin gets set to this */
short *_INTOUT; /* 16 Ptr to INTOUT Array Intout gets set to this */
short *_PTSOUT; /* 20 Ptr to PTSOUT Array Ptsout gets set to this */
/* CONTRL is the control array */
/* INTIN is the array of input parameters */
/* PTSIN is the array of input coordinates */
/* Even entrys are X coordinate */
/* Odd entrys are corresponding Y coodinates */
/* INTOUT is the array of output parameters */
/* PTSOUT is the array of output coordinates */
/* organized like PTSIN. */
/* */
short _COLBIT0; /* 24 Plane 0 Color Value All Three Rez's */
short _COLBIT1; /* 26 Plane 1 Color Value Med and Low Rez only */
short _COLBIT2; /* 28 Plane 2 Color Value Low Rez only */
short _COLBIT3; /* 30 Plane 3 Color Value Low Rez Only */
/* Foreground color COLBIT0 + 2*COLBIT1 + 4*COLBIT2*/
/* + 8*COLBIT3 */
/* */
/* */
short _LSTLIN; /* 32 Draw last pixel of a line? 0=yes non0=no */
/* This prevents two connecting lines from XORing */
/* a common endpoint out of existence */
/* */
short _LNMASK; /* 34 Linemask used when drawing lines, same as Vdi's */
/* line style (rotated to aligned with rightmost */
/* endpoint when drawing lines) */
/* */
short _WMODE; /* 36 Writing mode */
/* 0=Replace Mode-Replace all bits in Dest with src*/
/* 1=Trans. Mode-Only additional bits in src set(OR*/
/* 2=Xor Mode- Src XOR Dest */
/* 3=Inverse Trans.- (NOT src) Or Dest */
/* Values upto 16 are permitted */
/* */
short _X1; /* 38 X1 coordinate used in various calls */
/* */
short _Y1; /* 40 Y1 coordinate used in various calls */
/* */
short _X2; /* 42 X2 coordinate used in various calls */
/* */
short _Y2; /* 44 Y2 coordinate used in various calls */
/* */
/* */
short *_PATPTR; /* 46 Pointer to current fill pattern */
/* Must be integral power of 2 (words) in length */
short _PATMSK; /* 50 I don't know why they call it a mask. It is in */
/* reality the length in words of the current patt.*/
short _MFILL; /* 52 Multi Plane fill flag 1 == Current fill Pattern */
/* is for Muti Plane. */
/* */
/* */
short _CLIP; /* 54 Clipping Flag 1 == TRUE */
short _XMINCL; /* 56 Min X of clipping window */
short _YMINCL; /* 58 Min Y of clipping window */
short _XMAXCL; /* 60 Max X of clipping window */
short _YMAXCL; /* 62 Max Y of clipping window */
/* */
/* */
short _XDDA; /* 64 Accumulator for Scaling, Must be set to 0x08000 */
/* before each call to Text Blt. Done for you in */
/* in aline_text() */
short _DDAINC; /* 66 Scaling factor - Fractional amount to scale char*/
/* When scaling up = 256 *(Size-Textsize)/Textsize */
/* When scaling down = 256*(Size)/Textsize */
/* scaling down does not work */
short _SCALDIR; /* 68 Scaling direction 0 == down */
short _MONO; /* 70 Mono flag 0== current font is a propotional font*/
/* Its Ok for Thickening to increase the width of */
/* the current character. */
/* 1 == current font is mono spaced, so thickening */
/* may not increase the width of the current char */
/* */
short _SOURCEX; /* 72 X coordinate of character in the font form */
/* SOURCEX is calculated from info in the font */
/* header for the current font (see __FONT type) */
/* SOURCEX = off_table[char-first_ade] */
/* SOURCEX is calculated for you in aline_text() */
/* The pointer to a table of font header for the */
/* internal fonts is returned in A2 on init (A000) */
short _SOURCEY; /* 74 Y coodinate of character in the font form */
/* Typically set to 0 (top line of font form) */
short _DESTX; /* 76 X coordinate of character on screen */
short _DESTY; /* 78 Y coordinate of character on screen */
short _DELX; /* 80 Width of Character */
/* Difference between two SOURCEX's */
short _DELY; /* 82 Height of Character */
/* form_height field of FONT_HEAD of current font */
short *_FBASE; /* 84 Pointer to start of font form */
short _FWIDTH; /* 88 Width of the current font's form */
/* */
short _STYLE; /* 90 Vector of style flags */
/* Bit 0 = Thicken Flag */
/* Bit 1 = Lighten Flag */
/* Bit 2 = Skewing Flag */
/* Bit 3 = Underline Flag (ignored) */
/* Bit 4 = Outline Flag */
/* */
short _LITEMASK; /* 92 Mask used for lightening text */
/* The Mask is picked up from the font header */
short _SKEWMASK; /* 94 Mask used for skewing text */
/* The Mask is picked up from the font header */
short _WEIGHT; /* 96 The number of bits by which to thicken text */
/* The number is picked up from the font header */
short _ROFF; /* 98 Offset above baseline when skewing */
/* Again picked up from the font header */
/* */
short _LOFF; /* 100 Offset below character baseline when skewing */
/* Again picked up from the font header */
/* */
short _SCALE; /* 102 Scaling Flag 1 == true */
/* */
short _CHUP; /* 104 Character rotation vector. */
/* 0 = normal (0 degrees) */
/* 1800 = 180 degrees */
/* 2700 = 270 degrees */
/* */
short _TEXTFG; /* 106 Text foreground color */
/* */
char *_SCRTCHP; /* 108 Address of buffer required for creating special */
/* text effects. The size of this buffer should be */
/* 1K according the Internals. The Atari document */
/* of course does not talk about such things :-) */
/* */
short _SCRPT2; /* 112 The offset of the scaling buffer buffer in above*/
/* buffer. Internals suggests an offset of 0x0040 */
/* As usual the Atari document does'nt say a thing */
/* */
short _TEXTBG; /* 114 Text background color (Ram Vdi only) */
/* used for the BitBlt writing modes (4-19) only */
/* */
short _COPYTRAN; /* 116 Copy raster form type flag (Ram vdi only) */
/* 0 => Opaque type */
/* n-plane source -> n-plane dest */
/* BitBlt writing modes (4-19) */
/* ~0 => Transparent type */
/* 1-plane source -> n-plane dest */
/* Vdi writing modes (1-3) */
/* */
short(*_SEEDABORT) __PROTO((void));
/* 118 Pointer to function returning int, which is */
/* called by the fill logic to allow the fill to */
/* be aborted. If the routine returns FALSE (0) */
/* the fill is not aborted. If it returns TRUE (~0)*/
/* the fill is aborted */
/* ------------------------------------------------------------------------- */
} __LINEA; /* P H E W !!!!! */
/* macros for MWC compatibility */
#define VPLANES (__aline->_VPLANES)
#define VWRAP (__aline->_VWRAP)
#define CONTRL (__aline->_CONTRL)
#define INTIN (__aline->_INTIN)
#define PTSIN (__aline->_PTSIN)
#define INTOUT (__aline->_INTOUT)
#define PTSOUT (__aline->_PTSOUT)
#define COLBIT0 (__aline->_COLBIT0)
#define COLBIT1 (__aline->_COLBIT1)
#define COLBIT2 (__aline->_COLBIT2)
#define COLBIT3 (__aline->_COLBIT3)
#define LSTLIN (__aline->_LSTLIN)
#define LNMASK (__aline->_LNMASK)
#define WMODE (__aline->_WMODE)
#define X1 (__aline->_X1)
#define Y1 (__aline->_Y1)
#define X2 (__aline->_X2)
#define Y2 (__aline->_Y2)
#define PATPTR (__aline->_PATPTR)
#define PATMSK (__aline->_PATMSK)
#define MFILL (__aline->_MFILL)
#define CLIP (__aline->_CLIP)
#define XMINCL (__aline->_XMINCL)
#define YMINCL (__aline->_YMINCL)
#define XMAXCL (__aline->_XMAXCL)
#define YMAXCL (__aline->_YMAXCL)
#define XDDA (__aline->_XDDA)
#define DDAINC (__aline->_DDAINC)
#define SCALDIR (__aline->_SCALDIR)
#define MONO (__aline->_MONO)
#define SOURCEX (__aline->_SOURCEX)
#define SOURCEY (__aline->_SOURCEY)
#define DESTX (__aline->_DESTX)
#define DESTY (__aline->_DESTY)
#define DELX (__aline->_DELX)
#define DELY (__aline->_DELY)
#define FBASE (__aline->_FBASE)
#define FWIDTH (__aline->_FWIDTH)
#define STYLE (__aline->_STYLE)
#define LITEMASK (__aline->_LITEMASK)
#define SKEWMASK (__aline->_SKEWMASK)
#define WEIGHT (__aline->_WEIGHT)
#define ROFF (__aline->_ROFF)
#define LOFF (__aline->_LOFF)
#define SCALE (__aline->_SCALE)
#define CHUP (__aline->_CHUP)
#define TEXTFG (__aline->_TEXTFG)
#define SCRTCHP (__aline->_SCRTCHP)
#define SCRPT2 (__aline->_SCRPT2)
#define TEXTBG (__aline->_TEXTBG)
#define COPYTRAN (__aline->_COPYTRAN)
#define SEEDABORT (__aline->_SEEDABORT)
/* A pointer to array of type __FONT is returned by the Line A
* init call ($A000), in register A1.
* This pointer is saved in the global array variable 'fonts[]'.
*
*/
typedef struct _font {
/* Type Name Offset Function Comments */
/* ------------------------------------------------------------------------- */
short font_id; /* 0 Font face identifier 1 == system font */
/* */
short size; /* 2 Font size in points */
/* */
char name[32]; /* 4 Face name */
/* */
short first_ade; /* 36 Lowest ADE value in the face (lowest ASCII value */
/* of displayable character). */
/* */
short last_ade; /* 38 Highest ADE value in the face (highest ASCII valu*/
/* of displayable character). */
/* */
short top; /* 40 Distance of top line relative to baseline */
/* */
short ascent; /* 42 Distance of ascent line relative to baseline */
/* */
short half; /* 44 Distance of half line relative to baseline */
/* */
short descent; /* 46 Distance of decent line relative to baseline */
/* */
short bottom; /* 48 Distance of bottom line relative to baseline */
/* All distances are measured in absolute values */
/* rather than as offsets. They are always +ve */
/* */
short max_char_width; /* 50 Width of the widest character in font */
/* */
short max_cell_width; /* 52 Width of the widest cell character cell in face */
/* */
short left_offset; /* 54 Left Offset see Vdi appendix G */
/* */
short right_offset; /* 56 Right offset " " " */
/* */
short thicken; /* 58 Number of pixels by which to thicken characters */
/* */
short ul_size; /* 60 Width in pixels of the underline */
/* */
short lighten; /* 62 The mask used to lighten characters */
/* */
short skew; /* 64 The mask used to determine when to perform */
/* additional rotation on the character to perform */
/* skewing */
/* */
short flags; /* 66 Flags */
/* bit 0 set if default system font */
/* bit 1 set if horiz offset table should be used */
/* bit 2 byte-swap flag (thanks to Intel idiots) */
/* bit 3 set if mono spaced font */
/* */
char *h_table; /* 68 Pointer to horizontal offset table */
/* */
short *off_table; /* 72 Pointer to character offset table */
/* */
char *dat_table; /* 76 Pointer to font data */
/* */
short form_width; /* 80 Form width (#of bytes /scanline in font data) */
/* */
short form_height;/* 82 Form height (#of scanlines in font data) */
/* */
struct _font *next_font; /* 84 Pointer to next font in face */
/* */
/* ------------------------------------------------------------------------- */
} __FONT;
/* function pointer array
* pointer to array is returned in A2 after a init (A000) call
* array contains pointers to the 16 lineA routines, allowing
* you to call the routines directly without incurring the
* overhead of processing a lineA exception. You must be in
* supervisor mode to call any of the routines directly
*/
typedef short(*FPTR) __PROTO((void));
typedef FPTR *FUNCPTR; /* array of pointers to functions returning short */
/*
* OP_TAB type required for Bit Blt parameter block.
* each entry defines the logic operation to apply for
* the 4 Fore/Back ground bit combinations
*/
typedef struct {
/* Type Name Offset Function Comments */
/* ------------------------------------------------------------------------- */
char fg0bg0; /* 0 Logic op to employ when both FG and BG are 0 */
char fg0bg1; /* 1 Logic op to employ when FG = 0 and BG = 1 */
char fg1bg0; /* 2 Logic op to employ when FG = 1 and BG = 0 */
char fg1bg1; /* 3 Logic op to employ when both FG and BG are 1 */
/* ------------------------------------------------------------------------- */
} OP_TAB;
/*
* Source and destination description blocks
*/
typedef struct {
short bl_xmin; /* Minimum x */
short bl_ymin; /* Minimum y */
char *bl_form; /* short aligned memory form */
short bl_nxwd; /* Offset to next word in line */
short bl_nxln; /* Offset to next line in plane */
short bl_nxpl; /* Offset to next plane */
}SDDB;
/* Offsets to next word in plane */
#define HI_NXWD 2 /* Hi Rez */
#define MED_NXWD 4
#define LOW_NXWD 8 /* lo Rez */
/* Scan line widths of the screen */
#define HI_NXLN 80 /* Hi Rez */
#define MED_NXLN 160
#define LOW_NXLN 160 /* lo Rez */
/*
* Offsets between planes - always the same due to
* the way the STs video memory is laid out
*/
#define NXPL 2
/*
* Bit Blt Parameter Block Type (for function $A007)
*
*/
typedef struct {
/* Type Name Offset Function Comments */
/* ------------------------------------------------------------------------- */
short bb_b_wd; /* width of block in pixels */
short bb_b_ht; /* height of block in pixels */
short bb_plane_ct; /* number of planes to blit */
short bb_fg_col; /* foreground color */
short bb_bg_col; /* back ground color */
OP_TAB bb_op_tab; /* logic for fg x bg combination */
SDDB bb_s; /* source info block */
SDDB bb_d; /* destination info block */
short *bb_p_addr; /* pattern buffer address */
short bb_p_nxln; /* offset to next line in pattern */
short bb_p_nxpl; /* offset to next plane in pattern */
short bb_p_mask; /* pattern index mask */
char bb_fill[24]; /* work space */
/* ------------------------------------------------------------------------- */
} BBPB;
#ifndef __MFDB__
#define __MFDB__
/*
* Memory Form Definition Block
*
*/
typedef struct
{
void *fd_addr; /* Address of upper left corner of first*/
/* plane of raster area. If NULL then */
/* MFDB is for a physical device */
short fd_w; /* Form Width in Pixels */
short fd_h; /* Form Height in Pixels */
short fd_wdwidth; /* Form Width in shorts(fd_w/sizeof(int)*/
short fd_stand; /* Form format 0= device spec 1=standard*/
short fd_nplanes; /* Number of memory planes */
short fd_r1; /* Reserved */
short fd_r2; /* Reserved */
short fd_r3; /* Reserved */
} MFDB;
#endif /* __MFDB__ */
/*
* Sprite definition block
*
*/
typedef struct
{
short sp_xhot; /* Offset to X hot spot */
short sp_yhot; /* Offset to Y hot spot */
short sp_format; /* Format SP_VDI or SP_XOR */
short sp_bg; /* Background color */
short sp_fg; /* Foregroud color */
short sp_data[32]; /* Sprite data - */
/* Alternating words of back/fore */
/* ground data */
/* Note that: */
/* sprite save block is */
/* 10+VPLANES*64 bytes long */
} SFORM;
/*****************************************************************************\
* *
* Global Variables *
* *
\*****************************************************************************/
/*
* Global Variables are defined in alglobal.c, extern every where else
*
*/
/* global vars */
/* Pointer to line a parameter block returned by init */
extern __LINEA *__aline;
/* Array of pointers to the three system font headers
returned by init (in register A1) */
extern __FONT **__fonts;
/* Array of pointers to the 16 line a functions returned
by init (in register A2) only valid in ROM'ed TOS */
extern short (**__funcs) __PROTO((void));
/* Functions */
#ifdef __GNUC_INLINE__
#define linea0() \
({ \
register __LINEA *__xaline __asm__ ("a0"); \
register __FONT **__xfonts __asm__ ("a1"); \
register short (**__xfuncs) (void) __asm__ ("a2"); \
\
__asm__ volatile \
("\
.word 0xA000" \
: "=g"(__xaline), "=g"(__xfonts), "=g"(__xfuncs) /* outputs */ \
: /* inputs */ \
: __CLOBBER_RETURN("a0") __CLOBBER_RETURN("a1") __CLOBBER_RETURN("a2") "d0", "d1", "d2" /* clobbered regs */ \
); \
__aline = __xaline; \
__fonts = __xfonts; \
__funcs = __xfuncs; \
})
#define linea1() \
({ \
\
__asm__ volatile \
("\
.word 0xA001" \
: /* outputs */ \
: /* inputs */ \
: "d0", "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
); \
})
#define linea2() \
({ \
register short retvalue __asm__ ("d0"); \
__asm__ volatile \
("\
.word 0xA002" \
: "=g"(retvalue) /* outputs */ \
: /* inputs */ \
: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
); \
(int)retvalue; \
})
#define linea3() \
({ \
\
__asm__ volatile \
("\
.word 0xA003" \
: /* outputs */ \
: /* inputs */ \
: "d0", "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
); \
})
#define linea4() \
({ \
\
__asm__ volatile \
("\
.word 0xA004" \
: /* outputs */ \
: /* inputs */ \
: "d0", "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
); \
})
#define linea5() \
({ \
\
__asm__ volatile \
("\
.word 0xA005" \
: /* outputs */ \
: /* inputs */ \
: "d0", "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
); \
})
#define linea6() \
({ \
\
__asm__ volatile \
("\
.word 0xA006" \
: /* outputs */ \
: /* inputs */ \
: "d0", "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
); \
})
#define linea7(P) \
({ \
\
__asm__ volatile \
("\
movml d2/a2/a6, sp@-; \
movl %0,a6; \
.word 0xA007; \
movml sp@+, d2/a2/a6" \
: /* outputs */ \
: "r"(P) /* inputs */ \
: "d0", "d1", "a0", "a1" /* clobbered regs */ \
); \
})
#define linea8() \
({ \
\
__asm__ volatile \
("\
.word 0xA008" \
: /* outputs */ \
: /* inputs */ \
: "d0", "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
); \
})
#define linea9() \
({ \
\
__asm__ volatile \
("\
.word 0xA009" \
: /* outputs */ \
: /* inputs */ \
: "d0", "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
); \
})
#define lineaa() \
({ \
\
__asm__ volatile \
("\
.word 0xA00A" \
: /* outputs */ \
: /* inputs */ \
: "d0", "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
); \
})
#define lineab() \
({ \
\
__asm__ volatile \
("\
.word 0xA00B" \
: /* outputs */ \
: /* inputs */ \
: "d0", "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
); \
})
#define lineac(P) \
({ \
\
__asm__ volatile \
("\
movl %0,a2; \
movl a6,sp@-;\
.word 0xA00C; \
movl sp@+,a6"\
: /* outputs */ \
: "g"(P) /* inputs */ \
: "d0", "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
); \
})
#define linead(x, y, sd, ss) __linead((short)x, (short)y, (void *)sd, (void *)ss)
#define __linead(x, y, sd, ss) \
({ \
\
__asm__ volatile \
("\
movw %0,d0; \
movw %1,d1; \
movl %2,a0; \
movl %3,a2; \
movl a6,sp@-;\
.word 0xA00D; \
movl sp@+,a6"\
: /* outputs */ \
: "g"(x), "g"(y), "g"(sd), "g"(ss) /* inputs */ \
: "d0", "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
); \
})
#define lineae() \
({ \
\
__asm__ volatile \
("\
.word 0xA00E" \
: /* outputs */ \
: /* inputs */ \
: "d0", "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
); \
})
#define lineaf() \
({ \
\
__asm__ volatile \
("\
.word 0xA00F" \
: /* outputs */ \
: /* inputs */ \
: "d0", "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
); \
})
#else /* __NO_INLINE__ */
__EXTERN void linea0 __PROTO((void));
__EXTERN void linea1 __PROTO((void));
__EXTERN int linea2 __PROTO((void));
__EXTERN void linea3 __PROTO((void));
__EXTERN void linea4 __PROTO((void));
__EXTERN void linea5 __PROTO((void));
__EXTERN void linea6 __PROTO((void));
__EXTERN void linea7 __PROTO((BBPB *P));
__EXTERN void linea8 __PROTO((void));
__EXTERN void linea9 __PROTO((void));
__EXTERN void lineaa __PROTO((void));
__EXTERN void lineab __PROTO((void));
__EXTERN void lineac __PROTO((void *P));
__EXTERN void linead __PROTO((int x, int y, SFORM *sd, void *ss));
__EXTERN void lineae __PROTO((void));
__EXTERN void lineaf __PROTO((void));
#endif /* __GNUC_INLINE__ */
__END_DECLS
#endif /* _MINT_LINEA_H */

View File

@@ -0,0 +1,612 @@
#ifndef _MINT_MINTBIND_H
#define _MINT_MINTBIND_H 1
#ifndef _FEATURES_H
# include <features.h>
#endif
#ifndef _MINT_OSBIND_H
# include <mint/osbind.h>
#endif
__BEGIN_DECLS
/* see osbind.h for __extension__ and AND_MEMORY */
#define trap_1_wllw(n, a, b, c) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
long _a = (long)(a); \
long _b = (long) (b); \
short _c = (short) (c); \
\
__asm__ volatile \
("\
movw %4,sp@-; \
movl %3,sp@-; \
movl %2,sp@-; \
movw %1,sp@-; \
trap #1; \
lea sp@(10),sp " \
: "=r"(retvalue) /* outputs */ \
: "g"(n), "r"(_a), "r"(_b), "r"(_c) /* inputs */ \
: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
AND_MEMORY \
); \
retvalue; \
})
#define trap_1_wwlw(n, a, b, c) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
short _a = (short)(a); \
long _b = (long) (b); \
short _c = (short) (c); \
\
__asm__ volatile \
("\
movw %4,sp@-; \
movl %3,sp@-; \
movw %2,sp@-; \
movw %1,sp@-; \
trap #1; \
lea sp@(10),sp " \
: "=r"(retvalue) /* outputs */ \
: "g"(n), "r"(_a), "r"(_b), "r"(_c) /* inputs */ \
: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
AND_MEMORY \
); \
retvalue; \
})
#define trap_1_wwww(n, a, b, c) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
short _a = (short)(a); \
short _b = (short)(b); \
short _c = (short)(c); \
\
__asm__ volatile \
("\
movw %4,sp@-; \
movw %3,sp@-; \
movw %2,sp@-; \
movw %1,sp@-; \
trap #1; \
addqw #8,sp " \
: "=r"(retvalue) /* outputs */ \
: "g"(n), "r"(_a), "r"(_b), "r"(_c) /* inputs */ \
: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
AND_MEMORY \
); \
retvalue; \
})
#define trap_1_wwwl(n, a, b, c) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
short _a = (short)(a); \
short _b = (short)(b); \
long _c = (long)(c); \
\
__asm__ volatile \
("\
movl %4,sp@-; \
movw %3,sp@-; \
movw %2,sp@-; \
movw %1,sp@-; \
trap #1; \
lea sp@(10),sp " \
: "=r"(retvalue) /* outputs */ \
: "g"(n), "r"(_a), "r"(_b), "r"(_c) /* inputs */ \
: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
AND_MEMORY \
); \
retvalue; \
})
#define trap_1_wwl(n, a, b) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
short _a = (short)(a); \
long _b = (long) (b); \
\
__asm__ volatile \
("\
movl %3,sp@-; \
movw %2,sp@-; \
movw %1,sp@-; \
trap #1; \
addqw #8,sp " \
: "=r"(retvalue) /* outputs */ \
: "g"(n), "r"(_a), "r"(_b) /* inputs */ \
: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
AND_MEMORY \
); \
retvalue; \
})
#define trap_1_wlllw(n, a, b, c, d) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
long _a = (long) (a); \
long _b = (long) (b); \
long _c = (long) (c); \
short _d = (short) (d); \
\
__asm__ volatile \
(" \
movw %5,sp@-; \
movl %4,sp@-; \
movl %3,sp@-; \
movl %2,sp@-; \
movw %1,sp@-; \
trap #1; \
lea sp@(16),sp " \
: "=r"(retvalue) /* outputs */ \
: "g"(n), "r"(_a), "r"(_b), "r"(_c), "r"(_d) /* inputs */ \
: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
AND_MEMORY \
); \
retvalue; \
})
#define trap_1_wlll(n, a, b, c) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
long _a = (long)(a); \
long _b = (long)(b); \
long _c = (long)(c); \
\
__asm__ volatile \
( \
"movl %4,sp@-;" \
"movl %3,sp@-;" \
"movl %2,sp@-;" \
"movw %1,sp@-;" \
"trap #1;" \
"lea sp@(14),sp" \
: "=r"(retvalue) /* outputs */ \
: "g"(n), "r"(_a), "r"(_b), "r"(_c) /* inputs */ \
: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
AND_MEMORY \
); \
\
retvalue; \
})
#define trap_1_wwllll(n, a, b, c, d, e) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
short _a = (short)(a); \
long _b = (long) (b); \
long _c = (long) (c); \
long _d = (long) (d); \
long _e = (long) (e); \
\
__asm__ volatile \
("\
movl %6,sp@-; \
movl %5,sp@-; \
movl %4,sp@-; \
movl %3,sp@-; \
movw %2,sp@-; \
movw %1,sp@-; \
trap #1; \
lea sp@(20),sp " \
: "=r"(retvalue) /* outputs */ \
: "g"(n), "r"(_a), "r"(_b), "r"(_c), "r"(_d), "r"(_e) /* inputs */ \
: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
AND_MEMORY \
); \
retvalue; \
})
#define trap_1_wllll(n, a, b, c, d) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
long _a = (long)(a); \
long _b = (long)(b); \
long _c = (long)(c); \
long _d = (long)(d); \
\
__asm__ volatile \
( \
"movl %5,sp@-;" \
"movl %4,sp@-;" \
"movl %3,sp@-;" \
"movl %2,sp@-;" \
"movw %1,sp@-;" \
"trap #1;" \
"lea sp@(18),sp" \
: "=r"(retvalue) /* outputs */ \
: "g"(n), "r"(_a), "r"(_b), "r"(_c), \
"r"(_d) /* inputs */ \
: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
AND_MEMORY \
); \
\
retvalue; \
})
#define trap_1_wwlllll(n, a, b, c, d, e, f) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
short _a = (short)(a); \
long _b = (long)(b); \
long _c = (long)(c); \
long _d = (long)(d); \
long _e = (long)(e); \
long _f = (long)(f); \
\
__asm__ volatile \
( \
"movl %7,sp@-;" \
"movl %6,sp@-;" \
"movl %5,sp@-;" \
"movl %4,sp@-;" \
"movl %3,sp@-;" \
"movw %2,sp@-;" \
"movw %1,sp@-;" \
"trap #1;" \
"lea sp@(24),sp" \
: "=r"(retvalue) /* outputs */ \
: "g"(n), "r"(_a), "r"(_b), "r"(_c), \
"r"(_d), "r"(_e), "r"(_f) /* inputs */ \
: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
AND_MEMORY \
); \
\
retvalue; \
})
#define trap_1_wlllll(n, a, b, c, d, e) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
long _a = (long)(a); \
long _b = (long)(b); \
long _c = (long)(c); \
long _d = (long)(d); \
long _e = (long)(e); \
\
__asm__ volatile \
( \
"movl %6,sp@-;" \
"movl %5,sp@-;" \
"movl %4,sp@-;" \
"movl %3,sp@-;" \
"movl %2,sp@-;" \
"movw %1,sp@-;" \
"trap #1;" \
"lea sp@(22),sp" \
: "=r"(retvalue) /* outputs */ \
: "g"(n), "r"(_a), "r"(_b), "r"(_c), \
"r"(_d), "r"(_e) /* inputs */ \
: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
AND_MEMORY \
); \
\
retvalue; \
})
#define trap_1_wllllll(n, a, b, c, d, e, f) \
__extension__ \
({ \
register long retvalue __asm__("d0"); \
long _a = (long)(a); \
long _b = (long)(b); \
long _c = (long)(c); \
long _d = (long)(d); \
long _e = (long)(e); \
long _f = (long)(f); \
\
__asm__ volatile \
( \
"movl %7,sp@-;" \
"movl %6,sp@-;" \
"movl %5,sp@-;" \
"movl %4,sp@-;" \
"movl %3,sp@-;" \
"movl %2,sp@-;" \
"movw %1,sp@-;" \
"trap #1;" \
"lea sp@(26),sp" \
: "=r"(retvalue) /* outputs */ \
: "g"(n), "r"(_a), "r"(_b), "r"(_c), \
"r"(_d), "r"(_e), "r"(_f) /* inputs */ \
: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
AND_MEMORY \
); \
\
retvalue; \
})
#define Srealloc(newsize) \
trap_1_wl(0x15, (long)(newsize))
#define Slbopen(name, path, min_ver, sl, fn) \
trap_1_wlllll(0x16, (long)(name), (long)(path), (long)(min_ver), (long)(sl), (long)(fn))
#define Slbclose(sl) \
trap_1_wl(0x17, (long)(sl))
#define Syield() \
(int)trap_1_w(0xff)
#define Fpipe(ptr) \
(int)trap_1_wl(0x100, (long)(ptr))
#define Ffchown(f, uid, gid) \
trap_1_wwww(0x101, (short)(f), (short)(uid), (short)(gid))
#define Ffchmod(f, mode) \
trap_1_www(0x102, (short)(f), (short)(mode))
#define Fsync(f) \
trap_1_ww(0x103, (short)(f))
#define Fcntl(f, arg, cmd) \
trap_1_wwlw(0x104, (short)(f), (long)(arg), (short)(cmd))
#define Finstat(f) \
trap_1_ww(0x105, (short)(f))
#define Foutstat(f) \
trap_1_ww(0x106, (short)(f))
#define Fgetchar(f, mode) \
trap_1_www(0x107, (short)(f), (short)(mode))
#define Fputchar(f, ch, mode) \
trap_1_wwlw(0x108, (short)(f), (long)(ch), (short)(mode))
#define Pwait() \
trap_1_w(0x109)
#define Pnice(delta) \
(int)trap_1_ww(0x10a, (short)(delta))
#define Pgetpid() \
(int)trap_1_w(0x10b)
#define Pgetppid() \
(int)trap_1_w(0x10c)
#define Pgetpgrp() \
(int)trap_1_w(0x10d)
#define Psetpgrp(pid, grp) \
(int)trap_1_www(0x10e, (short)(pid), (short)(grp))
#define Pgetuid() \
(int)trap_1_w(0x10f)
#define Psetuid(id) \
(int)trap_1_ww(0x110, (short)(id))
#define Pkill(pid, sig) \
(int)trap_1_www(0x111, (short)(pid), (short)(sig))
#define Psignal(sig, handler) \
trap_1_wwl(0x112, (short)(sig), (long)(handler))
#define Pvfork() \
trap_1_w(0x113)
#define Pgetgid() \
(int)trap_1_w(0x114)
#define Psetgid(id) \
(int)trap_1_ww(0x115, (short)(id))
#define Psigblock(mask) \
trap_1_wl(0x116, (unsigned long)(mask))
#define Psigsetmask(mask) \
trap_1_wl(0x117, (unsigned long)(mask))
#define Pusrval(arg) \
trap_1_wl(0x118, (long)(arg))
#define Pdomain(arg) \
(int)trap_1_ww(0x119, (short)(arg))
#define Psigreturn() \
(void)trap_1_w(0x11a)
#define Pfork() \
trap_1_w(0x11b)
#define Pwait3(flag, rusage) \
trap_1_wwl(0x11c, (short)(flag), (long)(rusage))
#define Fselect(time, rfd, wfd, xfd) \
(int)trap_1_wwlll(0x11d, (unsigned short)(time), (long)(rfd), \
(long)(wfd), (long)(xfd))
#define Prusage(rsp) \
(int)trap_1_wl(0x11e, (long)(rsp))
#define Psetlimit(i, val) \
trap_1_wwl(0x11f, (short)(i), (long)(val))
#define Talarm(sec) \
trap_1_wl(0x120, (long)(sec))
#define Pause() \
(void)trap_1_w(0x121)
#define Sysconf(n) \
trap_1_ww(0x122, (short)(n))
#define Psigpending() \
trap_1_w(0x123)
#define Dpathconf(name, which) \
trap_1_wlw(0x124, (long)(name), (short)(which))
#define Pmsg(mode, mbox, msg) \
trap_1_wwll(0x125, (short)(mode), (long)(mbox), (long)(msg))
#define Fmidipipe(pid, in, out) \
trap_1_wwww(0x126, (short)(pid), (short)(in),(short)(out))
#define Prenice(pid, delta) \
(int)trap_1_www(0x127, (short)(pid), (short)(delta))
#define Dopendir(name, flag) \
trap_1_wlw(0x128, (long)(name), (short)(flag))
#define Dreaddir(len, handle, buf) \
trap_1_wwll(0x129, (short)(len), (long)(handle), (long)(buf))
#define Drewinddir(handle) \
trap_1_wl(0x12a, (long)(handle))
#define Dclosedir(handle) \
trap_1_wl(0x12b, (long)(handle))
#define Fxattr(flag, name, buf) \
trap_1_wwll(0x12c, (short)(flag), (long)(name), (long)(buf))
#define Flink(old, new) \
trap_1_wll(0x12d, (long)(old), (long)(new))
#define Fsymlink(old, new) \
trap_1_wll(0x12e, (long)(old), (long)(new))
#define Freadlink(siz, buf, linknm) \
trap_1_wwll(0x12f, (short)(siz), (long)(buf), (long)(linknm))
#define Dcntl(cmd, name, arg) \
trap_1_wwll(0x130, (short)(cmd), (long)(name), (long)(arg))
#define Fchown(name, uid, gid) \
trap_1_wlww(0x131, (long)(name), (short)(uid), (short)(gid))
#define Fchmod(name, mode) \
trap_1_wlw(0x132, (long)(name), (short)(mode))
#define Pumask(mask) \
(int)trap_1_ww(0x133, (short)(mask))
#define Psemaphore(mode, id, tmout) \
trap_1_wwll(0x134, (short)(mode), (long)(id), (long)(tmout))
#define Dlock(mode, drive) \
(int)trap_1_www(0x135, (short)(mode), (short)(drive))
#define Psigpause(mask) \
(void)trap_1_wl(0x136, (unsigned long)(mask))
#define Psigaction(sig, act, oact) \
trap_1_wwll(0x137, (short)(sig), (long)(act), (long)(oact))
#define Pgeteuid() \
(int)trap_1_w(0x138)
#define Pgetegid() \
(int)trap_1_w(0x139)
#define Pwaitpid(pid,flag, rusage) \
trap_1_wwwl(0x13a, (short)(pid), (short)(flag), (long)(rusage))
#define Dgetcwd(path, drv, size) \
trap_1_wlww(0x13b, (long)(path), (short)(drv), (short)(size))
#define Salert(msg) \
trap_1_wl(0x13c, (long)(msg))
/* The following are not yet official... */
#define Tmalarm(ms) \
trap_1_wl(0x13d, (long)(ms))
#define Psigintr(vec, sig) \
trap_1_www(0x13e, (short)(vec), (short)(sig))
#define Suptime(uptime, avenrun) \
trap_1_wll(0x13f, (long)(uptime), (long)(avenrun))
#define Ptrace(request, pid, addr, data) \
trap_1_wwwll(0x140, (short)(request), (short)(pid), \
(long)(addr), (long)(data))
#define Mvalidate(pid,addr,size,flags) \
trap_1_wwlll (0x141, (short)(pid), (long)(addr), (long)(size), (long)(flags))
#define Dxreaddir(len, handle, buf, xattr, xret) \
trap_1_wwllll(0x142, (short)(len), (long)(handle), \
(long)(buf), (long)(xattr), (long)(xret))
#define Pseteuid(id) \
(int)trap_1_ww(0x143, (short)(id))
#define Psetegid(id) \
(int)trap_1_ww(0x144, (short)(id))
#define Psetauid(id) \
(int)trap_1_ww(0x145, (short)(id))
#define Pgetauid() \
(int)trap_1_w(0x146)
#define Pgetgroups(gidsetlen, gidset) \
trap_1_wwl(0x147, (short)(gidsetlen), (long)(gidset))
#define Psetgroups(gidsetlen, gidset) \
trap_1_wwl(0x148, (short)(gidsetlen), (long)(gidset))
#define Tsetitimer(which, interval, value, ointerval, ovalue) \
trap_1_wwllll(0x149, (short)(which), (long)(interval), \
(long)(value), (long)(ointerval), (long)(ovalue))
#define Dchroot(dir) \
trap_1_wl(0x14a, (long)(dir))
#define Fstat64(flag, name, stat) \
trap_1_wwll(0x14b, (short)(flag), (long)(name), (long)(stat))
#define Fseek64(high, low, fh, how, newpos) \
trap_1_wllwwl(0x14c, (long)(high), (long)(low), (short)(fh), \
(short)(how), (long)(newpos))
#define Dsetkey(major, minor, key, cipher) \
trap_1_wlllw(0x14d, (long)(major), (long)(minor), (long)(key), \
(short)(cipher))
#define Psetreuid(rid, eid) \
(int)trap_1_www(0x14e, (short)(rid), (short)(eid))
#define Psetregid(rid, eid) \
(int)trap_1_www(0x14f, (short)(rid), (short)(eid))
#define Sync() \
trap_1_w(0x150)
#define Shutdown(restart) \
trap_1_wl(0x151, (long)(restart))
#define Dreadlabel(path, label, maxlen) \
trap_1_wllw(0x152, (long)(path), (long)(label), (short)(maxlen))
#define Dwritelabel(path, label) \
trap_1_wll(0x153, (long)(path), (long)(label))
#define Ssystem(mode, arg1, arg2) \
trap_1_wwll(0x154, (int)(mode), (long)(arg1), (long)(arg2))
#define Tgettimeofday(tvp, tzp) \
trap_1_wll(0x155, (long)(tvp), (long)(tzp))
#define Tsettimeofday(tvp, tzp) \
trap_1_wll(0x156, (long)(tvp), (long)(tzp))
#define Tadjtime(delta, olddelta) \
trap_1_wll(0x157, (long)(delta), (long)(olddelta))
#define Pgetpriority(which, who) \
trap_1_www(0x158, (short)(which), (short)(who))
#define Psetpriority(which, who, prio) \
trap_1_wwww(0x159, (short)(which), (short)(who), (short)(prio))
/* #define Fpoll(fds, nfds, timeout) \
trap_1_wlll(0x15a,(long)(fds),(long)(nfds),(long)(timeout)) */
#define Fwritev(fh, iovp, iovcnt) \
trap_1_wwll(0x15b,(short)(fh),(long)(iovp),(long)(iovcnt))
#define Freadv(fh, iovp, iovcnt) \
trap_1_wwll(0x15c,(short)(fh),(long)(iovp),(long)(iovcnt))
#define Ffstat64(fh, stat) \
trap_1_wwl(0x15d,(short)(fh),(long)(stat))
#define Psysctl(name, namelen, old, oldlenp, new, newlen) \
trap_1_wllllll(0x15e,(long)(name),(long)(namelen),(long)(old),(long)(oldlenp),(long)(new),(long)(newlen))
#define Pemulation(which, op, a1, a2, a3, a4, a5, a6, a7) \
trap_1_wwwlllllll(0x15f,(short)(which),(short)(op),(long)(a1),(long)(a2),(long)(a3),(long)(a4),(long)(a5),(long)(a6),(long)(a7))
#define Fsocket(domain, type, protocol) \
trap_1_wlll(0x160,(long)(domain),(long)(type),(long)(protocol))
#define Fsocketpair(domain, type, protocol, rsv) \
trap_1_wllll(0x161,(long)(domain),(long)(type),(long)(protocol),(long)(rsv))
#define Faccept(fh, name, namelen) \
trap_1_wwll(0x162,(short)(fh),(long)(name),(long)(namelen))
#define Fconnect(fh, name, namelen) \
trap_1_wwll(0x163,(short)(fh),(long)(name),(long)(namelen))
#define Fbind(fh, name, namelen) \
trap_1_wwll(0x164,(short)(fh),(long)(name),(long)(namelen))
#define Flisten(fh, backlog) \
trap_1_wwl(0x165,(short)(fh),(long)(backlog))
#define Frecvmsg(fh, msg, flags) \
trap_1_wwll(0x166,(short)(fh),(long)(msg),(long)(flags))
#define Fsendmsg(fh, msg, flags) \
trap_1_wwll(0x167,(short)(fh),(long)(msg),(long)(flags))
#define Frecvfrom(fh, buf, len, flags, from, fromlen) \
trap_1_wwlllll(0x168,(short)(fh),(long)(buf),(long)(len),(long)(flags),(long)(from),(long)(fromlen))
#define Fsendto(fh, buf, len, flags, to, tolen) \
trap_1_wwlllll(0x169,(short)(fh),(long)(buf),(long)(len),(long)(flags),(long)(to),(long)(tolen))
#define Fsetsockopt(fh, level, name, val, valsize) \
trap_1_wwllll(0x16a,(short)(fh),(long)(level),(long)(name),(long)(val),(long)(valsize))
#define Fgetsockopt(fh, level, name, val, avalsize) \
trap_1_wwllll(0x16b,(short)(fh),(long)(level),(long)(name),(long)(val),(long)(avalsize))
#define Fgetpeername(fh, addr, addrlen) \
trap_1_wwll(0x16c,(short)(fh),(long)(addr),(long)(addrlen))
#define Fgetsockname(fh, addr, addrlen) \
trap_1_wwll(0x16d,(short)(fh),(long)(addr),(long)(addrlen))
#define Fshutdown(fh, how) \
trap_1_wwl(0x16e,(short)(fh),(long)(how))
/* 0x16f */
#define Pshmget(key, size, shmflg) \
trap_1_wlll(0x170,(long)(key),(long)(size),(long)(shmflg))
#define Pshmctl(shmid, cmd, buf) \
trap_1_wlll(0x171,(long)(shmid),(long)(cmd),(long)(buf))
#define Pshmat(shmid, shmaddr, shmflg) \
trap_1_wlll(0x172,(long)(shmid),(long)(shmaddr),(long)(shmflg))
#define Pshmdt(shmaddr) \
trap_1_wl(0x173,(long)(shmaddr))
#define Psemget(key, nsems, semflg) \
trap_1_wlll(0x174,(long)(key),(long)(nsems),(long)(semflg))
#define Psemctl(semid, semnum, cmd, arg) \
trap_1_wllll(0x175,(long)(semid),(long)(semnum),(long)(cmd),(long)(arg))
#define Psemop(semid, sops, nsops) \
trap_1_wlll(0x176,(long)(semid),(long)(sops),(long)(nsops))
#define Psemconfig(flag) \
trap_1_wl(0x177,(long)(flag))
#define Pmsgget(key, msgflg) \
trap_1_wll(0x178,(long)(key),(long)(msgflg))
#define Pmsgctl(msqid, cmd, buf) \
trap_1_wlll(0x179,(long)(msqid),(long)(cmd),(long)(buf))
#define Pmsgsnd(msqid, msgp, msgsz, msgflg) \
trap_1_wllll(0x17a,(long)(msqid),(long)(msgp),(long)(msgsz),(long)(msgflg))
#define Pmsgrcv(msqid, msgp, msgsz, msgtyp, msgflg) \
trap_1_wlllll(0x17b,(long)(msqid),(long)(msgp),(long)(msgsz),(long)(msgtyp),(long)(msgflg))
/* 0x17c */
#define Maccess(addr,size,mode) \
trap_1_wllw (0x141, (long)(addr), (long)(size), (short)(mode))
/* 0x17e */
/* 0x17f */
#define Fchown16(name, uid, gid, follow_links) \
trap_1_wlwww(0x180, (long)(name), (short)(uid), (short)(gid), (short)follow_links)
__END_DECLS
#endif /* _MINT_MINTBIND_H */

View File

@@ -0,0 +1,25 @@
#ifndef _MINT_MOUSE_H
#define _MINT_MOUSE_H 1
#ifndef _FEATURES_H
# include <features.h>
#endif
__BEGIN_DECLS
/* header file for mouse access */
struct mouse_buf {
int m_buttons; /* button states */
int m_dx; /* change in x since last read */
int m_dy; /* change in y since last read */
};
#define M_LEFT_BUTTON 0x02
#define M_RIGHT_BUTTON 0x01
#define M_MID_BUTTON 0x00 /* there is none! */
__END_DECLS
#endif /* _MINT_MOUSE_H */

View File

@@ -0,0 +1,233 @@
/*
* NFS protocol definitions
*/
/* This is stolen from the linux sources since rpcsvc/bootparam.h needs
the file. Hope it is ok for MiNT. */
/* $Id: nfs.h,v 1.2 2001/07/11 23:59:05 fna Exp $ */
#ifndef _MINT_NFS_H
#define _MINT_NFS_H 1
#ifndef __MINT__
# include <linux/sunrpc/msg_prot.h>
#endif
#define NFS_PORT 2049
#define NFS_MAXDATA 8192
#define NFS_MAXPATHLEN 1024
#define NFS_MAXNAMLEN 255
#define NFS_MAXGROUPS 16
#define NFS_FHSIZE 32
#define NFS_COOKIESIZE 4
#define NFS_FIFO_DEV (-1)
#define NFSMODE_FMT 0170000
#define NFSMODE_DIR 0040000
#define NFSMODE_CHR 0020000
#define NFSMODE_BLK 0060000
#define NFSMODE_REG 0100000
#define NFSMODE_LNK 0120000
#define NFSMODE_SOCK 0140000
#define NFSMODE_FIFO 0010000
enum nfs_stat {
NFS_OK = 0,
NFSERR_PERM = 1,
NFSERR_NOENT = 2,
NFSERR_IO = 5,
NFSERR_NXIO = 6,
NFSERR_EAGAIN = 11,
NFSERR_ACCES = 13,
NFSERR_EXIST = 17,
NFSERR_XDEV = 18,
NFSERR_NODEV = 19,
NFSERR_NOTDIR = 20,
NFSERR_ISDIR = 21,
NFSERR_INVAL = 22, /* that Sun forgot */
NFSERR_FBIG = 27,
NFSERR_NOSPC = 28,
NFSERR_ROFS = 30,
NFSERR_OPNOTSUPP = 45,
NFSERR_NAMETOOLONG = 63,
NFSERR_NOTEMPTY = 66,
NFSERR_DQUOT = 69,
NFSERR_STALE = 70,
NFSERR_WFLUSH = 99
};
enum nfs_ftype {
NFNON = 0,
NFREG = 1,
NFDIR = 2,
NFBLK = 3,
NFCHR = 4,
NFLNK = 5,
NFSOCK = 6,
NFBAD = 7,
NFFIFO = 8
};
struct nfs_fh {
char data[NFS_FHSIZE];
};
#define NFS_PROGRAM 100003
#define NFS_VERSION 2
#define NFSPROC_NULL 0
#define NFSPROC_GETATTR 1
#define NFSPROC_SETATTR 2
#define NFSPROC_ROOT 3
#define NFSPROC_LOOKUP 4
#define NFSPROC_READLINK 5
#define NFSPROC_READ 6
#define NFSPROC_WRITECACHE 7
#define NFSPROC_WRITE 8
#define NFSPROC_CREATE 9
#define NFSPROC_REMOVE 10
#define NFSPROC_RENAME 11
#define NFSPROC_LINK 12
#define NFSPROC_SYMLINK 13
#define NFSPROC_MKDIR 14
#define NFSPROC_RMDIR 15
#define NFSPROC_READDIR 16
#define NFSPROC_STATFS 17
/* Mount support for NFSroot */
#ifdef __KERNEL__
#define NFS_MNT_PROGRAM 100005
#define NFS_MNT_VERSION 1
#define NFS_MNT_PORT 627
#define NFS_MNTPROC_MNT 1
#define NFS_MNTPROC_UMNT 3
#endif
#if defined(__KERNEL__) || defined(NFS_NEED_KERNEL_TYPES)
extern struct rpc_program nfs_program;
extern struct rpc_stat nfs_rpcstat;
struct nfs_time {
__u32 seconds;
__u32 useconds;
};
struct nfs_fattr {
enum nfs_ftype type;
__u32 mode;
__u32 nlink;
__u32 uid;
__u32 gid;
__u64 size;
__u32 blocksize;
__u32 rdev;
__u32 blocks;
__u32 fsid;
__u32 fileid;
struct nfs_time atime;
struct nfs_time mtime;
struct nfs_time ctime;
};
struct nfs_sattr {
__u32 mode;
__u32 uid;
__u32 gid;
__u64 size;
struct nfs_time atime;
struct nfs_time mtime;
};
struct nfs_fsinfo {
__u32 tsize;
__u32 bsize;
__u32 blocks;
__u32 bfree;
__u32 bavail;
};
struct nfs_writeargs {
struct nfs_fh * fh;
__u64 offset;
__u32 count;
const void * buffer;
};
#ifdef NFS_NEED_XDR_TYPES
struct nfs_sattrargs {
struct nfs_fh * fh;
struct nfs_sattr * sattr;
};
struct nfs_diropargs {
struct nfs_fh * fh;
const char * name;
};
struct nfs_readargs {
struct nfs_fh * fh;
__u64 offset;
__u32 count;
void * buffer;
};
struct nfs_createargs {
struct nfs_fh * fh;
const char * name;
struct nfs_sattr * sattr;
};
struct nfs_renameargs {
struct nfs_fh * fromfh;
const char * fromname;
struct nfs_fh * tofh;
const char * toname;
};
struct nfs_linkargs {
struct nfs_fh * fromfh;
struct nfs_fh * tofh;
const char * toname;
};
struct nfs_symlinkargs {
struct nfs_fh * fromfh;
const char * fromname;
const char * topath;
struct nfs_sattr * sattr;
};
struct nfs_readdirargs {
struct nfs_fh * fh;
__u32 cookie;
void * buffer;
unsigned int bufsiz;
};
struct nfs_diropok {
struct nfs_fh * fh;
struct nfs_fattr * fattr;
};
struct nfs_readres {
struct nfs_fattr * fattr;
unsigned int count;
};
struct nfs_readlinkres {
char ** string;
unsigned int * lenp;
unsigned int maxlen;
void * buffer;
};
struct nfs_readdirres {
void * buffer;
unsigned int bufsiz;
};
#endif /* NFS_NEED_XDR_TYPES */
#endif /* __KERNEL__ */
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,214 @@
#ifndef _MINT_OSTRUCT_H
#define _MINT_OSTRUCT_H 1
#ifndef _FEATURES_H
# include <features.h>
#endif
__BEGIN_DECLS
/*
* General OS specific codes here
*
*/
/*
* GEMDOS defines and structures
*/
/* Structure used by Dfree() */
typedef struct {
long b_free; /* number of free clusters */
long b_total; /* total number of clusters */
long b_secsiz; /* number of bytes per sector */
long b_clsiz; /* number of sectors per cluster */
} _DISKINFO;
/* Structure returned by Fdatime() */
typedef struct {
unsigned short time;
unsigned short date;
} _DOSTIME;
/* Structure used by Cconrs */
typedef struct
{
unsigned char maxlen;
unsigned char actuallen;
char buffer[255];
} _CCONLINE;
/* Structure used by Fgetdta(), Fsetdta(), Fsfirst(), Fsnext() */
typedef struct _dta {
char dta_buf[21]; /* reserved */
char dta_attribute; /* file attribute */
unsigned short dta_time; /* file time stamp */
unsigned short dta_date; /* file date stamp */
long dta_size; /* file size */
char dta_name[14]; /* file name */
} _DTA;
/* Codes used with Fsfirst() */
#define FA_RDONLY 0x01
#define FA_HIDDEN 0x02
#define FA_SYSTEM 0x04
#define FA_LABEL 0x08
#define FA_DIR 0x10
#define FA_CHANGED 0x20
/* Codes used with Pexec */
#define PE_LOADGO 0 /* load & go */
#define PE_LOAD 3 /* just load */
#define PE_GO 4 /* just go */
#define PE_CBASEPAGE 5 /* just create basepage */
/* Tos 1.4: like 4, but memory ownership changed to child, and freed
on exit
*/
#define PE_GO_FREE 6 /* just go, then free */
#ifdef __MINT__
/* ers: what exactly does mode 7 do ??? */
# define PE_ASYNC_LOADGO 100 /* load and asynchronously go */
# define PE_ASYNC_GO 104 /* asynchronously go */
# define PE_ASYNC_GO_FREE 106 /* asynchronously go and free */
# define PE_OVERLAY 200 /* load and overlay */
#endif
/*
* BIOS defines and structures
*/
/* Device codes for Bconin(), Bconout(), Bcostat(), Bconstat() */
#define _PRT 0
#define _AUX 1
#define _CON 2
#define _MIDI 3
#define _IKBD 4
#define _RAWCON 5
/* Structure returned by Getbpb() */
typedef struct {
short recsiz; /* bytes per sector */
short clsiz; /* sectors per cluster */
short clsizb; /* bytes per cluster */
short rdlen; /* root directory size */
short fsiz; /* size of file allocation table */
short fatrec; /* startsector of second FAT */
short datrec; /* first data sector */
short numcl; /* total number of clusters */
short bflags; /* some flags */
} _BPB;
/* Structures used by Getmpb() */
/* Memory descriptor */
typedef struct _md {
struct _md *md_next; /* next descriptor in the chain */
long md_start; /* starting address of block */
long md_length; /* length of the block */
long md_owner; /* owner's process descriptor */
} _MD;
/* Memory parameter block */
typedef struct {
_MD *mp_free; /* free memory chunks */
_MD *mp_used; /* used memory descriptors */
_MD *mp_rover; /* rover memory descriptor */
} _MPB;
/*
* XBIOS defines and structures
*/
/* Codes used with Cursconf() */
#define CURS_HIDE 0
#define CURS_SHOW 1
#define CURS_BLINK 2
#define CURS_NOBLINK 3
#define CURS_SETRATE 4
#define CURS_GETRATE 5
/* dont find SCURS_HIDE */
/* Structure returned by Iorec() */
typedef struct {
char *ibuf;
short ibufsiz;
volatile short ibufhd;
volatile short ibuftl;
short ibuflow;
short ibufhi;
} _IOREC;
/* Structure used by Initmouse() */
typedef struct {
char topmode;
char buttons;
char xparam;
char yparam;
short xmax;
short ymax;
short xstart;
short ystart;
} _PARAM;
/* Structure returned by Kbdvbase() */
typedef struct {
void (*midivec) (void);
void (*vkbderr) (void);
void (*vmiderr) (void);
void (*statvec) (void *);
void (*mousevec) (void *);
void (*clockvec) (void *);
void (*joyvec) (void *);
long (*midisys) (void);
long (*ikbdsys) (void);
char kbstate;
} _KBDVECS;
/* Structure returned by Keytbl() */
typedef struct {
char *unshift; /* pointer to unshifted keys */
char *shift; /* pointer to shifted keys */
char *caps; /* pointer to capslock keys */
/* Entries below available
* when _AKP cookie is present.
*/
char *alt; /* pointers to alt translation tables */
char *altshift;
char *altcaps;
/* Entry below is available
* on MilanTOS and as of FreeMiNT 1.16.1
*/
char *altgr;
} _KEYTAB;
/* Structure used by Prtblk() */
typedef struct
{
void *pb_scrptr;
int pb_offset;
int pb_width;
int pb_height;
int pb_left;
int pb_right;
int pb_screz;
int pb_prrez;
void *pb_colptr;
int pb_prtype;
int pb_prport;
void *pb_mask;
} _PBDEF;
__END_DECLS
#endif /* _MINT_OSTRUCT_H */

View File

@@ -0,0 +1,55 @@
/*
* This file belongs to FreeMiNT. It's not in the original MiNT 1.12
* distribution. See the file CHANGES for a detailed log of changes.
*
*
* Copyright 2000 Frank Naumann <fnaumann@freemint.de>
* All rights reserved.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*
* begin: 2000-10-08
* last change: 2000-10-08
*
* Author: Frank Naumann <fnaumann@freemint.de>
*
* Please send suggestions, patches or bug reports to me or
* the MiNT mailing list.
*
*/
# ifndef _MINT_PTRACE_H
# define _MINT_PTRACE_H 1
# define PT_TRACE_ME 0 /* child declares it's being traced */
# define PT_READ_I 1 /* read word in child's I space */
# define PT_READ_D 2 /* read word in child's D space */
# define PT_WRITE_I 4 /* write word in child's I space */
# define PT_WRITE_D 5 /* write word in child's D space */
# define PT_CONTINUE 7 /* continue the child */
# define PT_KILL 8 /* kill the child process */
# define PT_ATTACH 9 /* attach to running process */
# define PT_DETACH 10 /* detach from running process */
# define PT_SYSCALL 11 /* continue and stop at next return from syscall */
# define PT_BASEPAGE 999
# define PT_FIRSTMACH 32 /* for machine-specific requests */
# include "arch/ptrace.h"
# endif /* mint/ptrace.h */

View File

@@ -0,0 +1,71 @@
#ifndef _MINT_SCREEN_H
#define _MINT_SCREEN_H 1
#ifndef _FEATURES_H
# include <features.h>
#endif
__BEGIN_DECLS
/* Data structures for IOCTL on /dev/screen */
#define SCR_NUM_COLORS 256 /* max possible num. of colors (even more on Falcon) */
/* SCR_ALIGN gives a mask telling how the physical screen must be
aligned (for the SCRSETP ioctl call. A typical use might be
newscrn = malloc(size + SCR_ALIGN) & (~SCR_ALIGN)
If SCR_ALIGN is -1, then the physical screen may not be remapped
*/
#define SCR_ALIGN 0x0ffL
/* define the following only if the physical memory occupied by the
screen is not accessible to user programs without an operating
system request to re-map or shar memory (i.e. don't define this
unless you have a version of Minix with a hardware memory
manager
*/
/* #define SCR_VIRT_MEM */ /* screen lives in virtual memory */
/* physical screen attributes; information returned by the
SCRGETPARAM ioctl call */
struct scr_param {
long scr_base; /* physical address of screen */
short scr_width; /* width of screen (pixels) */
short scr_height; /* height of screen (pixels) */
short scr_depth; /* no. of bitplanes on screen */
short scr_mode; /* special mode info about screen */
};
/* Each palette entry for the screen colors holds three entries;
the red, green, and blue values for this color, from 0 (no color)
to 255 (max. color).
The actual number of different values recognized by the hardware
is given by SCR_RGB_VALUES; for example, the atari ST recognizes
only 8 possible values for each of red, green, and blue, for
a total of 512 colors; for it, SCR_RGB_VALUES == 8.
*/
#define SCR_RGB_VALUES 16
/* constants for accessing the scr_rgb array */
#define RED 0
#define BLUE 1
#define GREEN 2
/* data structure returned by SCRGETCOLOR ioctl call */
struct scr_palette {
unsigned char scr_rgb[SCR_NUM_COLORS][3];
};
#define SCRGETPARAM (('S'<<8) | 1)
#define SCRSETPARAM (('S'<<8) | 2)
#define SCRGETCOLOR (('S'<<8) | 3)
#define SCRSETCOLOR (('S'<<8) | 4)
__END_DECLS
#endif /* _MINT_SCREEN_H */

View File

@@ -0,0 +1,35 @@
/*
* Copyright (C) 2000 Konrad Kokoszkiewicz <draco@atari.org.pl>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA
*
*/
# ifndef _MINT_SLB_H
# define _MINT_SLB_H 1
typedef void *SLB_HANDLE;
typedef long (*SLB_EXEC)(SLB_HANDLE sl, long fn, short nargs, ...);
typedef struct {
SLB_HANDLE handle;
SLB_EXEC exec;
} SLB;
long _slbopen (char *fname, char *path, long ver, void *hnd, void *exec);
# endif /* mint/slb.h */

View File

@@ -0,0 +1,68 @@
/*
* This file belongs to FreeMiNT. It's not in the original MiNT 1.12
* distribution. See the file Changes.MH for a detailed log of changes.
*/
# ifndef _MINT_SSYSTEM_H
# define _MINT_SSYSTEM_H 1
#ifdef __KERNEL
# include "include/mint.h"
#endif
# define HAS_SSYSTEM
# define S_OSNAME 0
# define S_OSXNAME 1
# define S_OSVERSION 2
# define S_OSHEADER 3
# define S_OSBUILDDATE 4
# define S_OSBUILDTIME 5
# define S_OSCOMPILE 6
# define S_OSFEATURES 7
# define S_GETCOOKIE 8
# define S_SETCOOKIE 9
# define S_GETLVAL 10
# define S_GETWVAL 11
# define S_GETBVAL 12
# define S_SETLVAL 13
# define S_SETWVAL 14
# define S_SETBVAL 15
# define S_SECLEVEL 16
# define S_RUNLEVEL 17 /* currently disabled, reserved */
# define S_TSLICE 18
# define S_FASTLOAD 19
# define S_SYNCTIME 20
# define S_BLOCKCACHE 21
# define S_FLUSHCACHE 22
# define S_CTRLCACHE 23
# define S_INITIALTPA 24
# define S_CTRLALTDEL 25 /* ctraltdel behavoiur */
# define S_DELCOOKIE 26
# define S_LOADKBD 27 /* reload the keyboard table */
# define S_CLOCKUTC 100
# define S_TIOCMGET 0x54f8 /* 21752 */
/* experimental - need feedback
* additional informations about the kernel
* reserved 900 - 999
*/
# define S_KNAME 900 /* kernel name - arg1 pointer to a buffer of arg2 len */
# define S_CNAME 910 /* compiler name - arg1 pointer to a buffer of arg2 len */
# define S_CVERSION 911 /* compiler version - arg1 pointer to a buffer of arg2 len */
# define S_CDEFINES 912 /* compiler definitions - arg1 pointer to a buffer of arg2 len */
# define S_COPTIM 913 /* compiler flags - arg1 pointer to a buffer of arg2 len */
/* debug section
* reserved 1000 - 1999
*/
# define S_DEBUGLEVEL 1000 /* debug level */
# define S_DEBUGDEVICE 1001 /* BIOS device number */
# define S_DEBUGKMTRACE 1100 /* KM_TRACE debug feature */
# ifdef __KERNEL__
long _cdecl s_system (int mode, ulong arg1, ulong arg2);
# endif
# endif /* _MINT_SSYSTEM_H */

View File

@@ -0,0 +1,191 @@
/*
* $Id: sysctl.h,v 1.3 2001/07/11 23:59:06 fna Exp $
*
* This file belongs to FreeMiNT. It's not in the original MiNT 1.12
* distribution. See the file CHANGES for a detailed log of changes.
*
*
* Modified for FreeMiNT by Frank Naumann <fnaumann@freemint.de>
*
* Please send suggestions, patches or bug reports to me or
* the MiNT mailing list.
*
*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Mike Karels at Berkeley Software Design, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)sysctl.h 8.1 (Berkeley) 6/2/93
*/
# ifndef _MINT_SYSCTL_H
# define _MINT_SYSCTL_H 1
/*
* Definitions for sysctl call. The sysctl call uses a hierarchical name
* for objects that can be examined or modified. The name is expressed as
* a sequence of integers. Like a file path name, the meaning of each
* component depends on its place in the hierarchy. The top-level and kern
* identifiers are defined here, and other identifiers are defined in the
* respective subsystem header files.
*/
# define CTL_MAXNAME 12 /* largest number of components supported */
/*
* Each subsystem defined by sysctl defines a list of variables
* for that subsystem. Each name is either a node with further
* levels defined below it, or it is a leaf of some particular
* type given below. Each sysctl level defines a set of name/type
* pairs to be used by sysctl(1) in manipulating the subsystem.
*/
struct ctlname
{
const char *ctl_name; /* subsystem name */
int ctl_type; /* type of name */
};
# define CTLTYPE_NODE 1 /* name is a node */
# define CTLTYPE_INT 2 /* name describes an integer */
# define CTLTYPE_STRING 3 /* name describes a string */
# define CTLTYPE_QUAD 4 /* name describes a 64-bit number */
# define CTLTYPE_STRUCT 5 /* name describes a structure */
/*
* Top-level identifiers
*/
# define CTL_UNSPEC 0 /* unused */
# define CTL_KERN 1 /* "high kernel" */
# define CTL_HW 2 /* generic cpu/io */
# define CTL_MACHDEP 3 /* machine dependent */
# define CTL_DEBUG 4 /* debugging parameters */
# define CTL_MAXID 5 /* number of valid top-level ids */
# define CTL_NAMES \
{ \
{ 0, 0 }, \
{ "kern", CTLTYPE_NODE }, \
{ "hw", CTLTYPE_NODE }, \
{ "machdep", CTLTYPE_NODE }, \
{ "debug", CTLTYPE_NODE }, \
}
/*
* CTL_KERN identifiers
*/
# define KERN_OSTYPE 1 /* string: system version */
# define KERN_OSRELEASE 2 /* string: system release */
# define KERN_OSREV 3 /* int: system revision */
# define KERN_VERSION 4 /* string: compile time info */
# define KERN_HOSTNAME 5 /* string: hostname */
# define KERN_DOMAINNAME 6 /* string: (YP) domainname */
# define KERN_SECURELVL 7 /* int: system security level */
# define KERN_MAXPROC 8 /* int: max processes */
# define KERN_MAXFILES 9 /* int: max open files */
# define KERN_NGROUPS 10 /* int: # of supplemental group ids */
# define KERN_IOV_MAX 11 /* int: max iovec's for readv(2) etc. */
# define KERN_LOGIN_NAME_MAX 12 /* int: max length login name + NUL */
# define KERN_BOOTTIME 13 /* struct: time kernel was booted */
# define KERN_INITIALTPA 14 /* int: max TPA size of a process */
# define KERN_MAXID 15 /* number of valid kern ids */
# define CTL_KERN_NAMES \
{ \
{ 0, 0 }, \
{ "ostype", CTLTYPE_STRING }, \
{ "osrelease", CTLTYPE_STRING }, \
{ "osrevision", CTLTYPE_INT }, \
{ "version", CTLTYPE_STRING }, \
{ "hostname", CTLTYPE_STRING }, \
{ "domainname", CTLTYPE_STRING }, \
{ "securelevel", CTLTYPE_INT }, \
{ "maxproc", CTLTYPE_INT }, \
{ "maxfiles", CTLTYPE_INT }, \
{ "ngroups", CTLTYPE_INT }, \
{ "iov_max", CTLTYPE_INT }, \
{ "login_name_max", CTLTYPE_INT }, \
{ "boottime", CTLTYPE_STRUCT }, \
{ "initialtpa", CTLTYPE_INT }, \
}
/*
* CTL_HW identifiers
*/
# define HW_MACHINE 1 /* string: machine class */
# define HW_MACHINE_ARCH 2 /* string: machine architecture */
# define HW_MODEL 3 /* string: specific machine model */
# define HW_NCPU 4 /* int: number of cpus */
# define HW_BYTEORDER 5 /* int: machine byte order */
# define HW_PAGESIZE 6 /* int: software page size */
# define HW_FREEPHYSMEM 7 /* int: free physical memory */
# define HW_MAXID 8 /* number of valid hw ids */
# define CTL_HW_NAMES \
{ \
{ 0, 0 }, \
{ "machine", CTLTYPE_STRING }, \
{ "machine_arch", CTLTYPE_STRING }, \
{ "model", CTLTYPE_STRING }, \
{ "ncpu", CTLTYPE_INT }, \
{ "byteorder", CTLTYPE_INT }, \
{ "pagesize", CTLTYPE_INT }, \
{ "freephysmem", CTLTYPE_INT }, \
}
/*
* CTL_DEBUG definitions
*
* Second level identifier specifies which debug variable.
* Third level identifier specifies which stucture component.
*/
# define CTL_DEBUG_NAME 0 /* string: variable name */
# define CTL_DEBUG_VALUE 1 /* int: variable value */
# define CTL_DEBUG_MAXID 20
# ifndef __KERNEL__
int __sysctl (int *name, unsigned long namelen, void *old, unsigned long *oldlenp,
const void *new, unsigned long newlen);
int sysctl (int *name, unsigned long namelen, void *old, unsigned long *oldlenp,
const void *new, unsigned long newlen);
# endif
# endif /* _MINT_SYSCTL_H */

View File

@@ -0,0 +1,127 @@
/* definitions for various GEMDOS system variables in low memory */
/* WARNING: this file is not compatible with the old one */
/*
* Convention:
* the address for each variable is defined.
*/
#ifndef _SYSVARS_H
# define _SYSVARS_H 1
#ifndef _FEATURES_H
# include <features.h>
#endif
__BEGIN_DECLS
/* Processor state and post mortem dump area */
#define PROC_LIVES_MAGIC 0x12345678L /* proc_lives if dump is valid */
#define proc_lives ((unsigned long *) 0x380L)
struct __post_mortem_dump {
unsigned long d0, d1, d2, d3, d4, d5, d6, d7;
void *a0, *a1, *a2, *a3, *a4, *a5, *a6, *a7; /* a7 == ssp */
void *pc; /* first byte is exception # */
void *usp;
unsigned short stk[16]; /* sixteen word of super stack */
};
#define proc_post_mortem_dump_p ((struct __post_mortem_dump *) 0x384L)
#define proc_dregs (&proc_post_mortem_dump_p->d0)
#define proc_aregs (&proc_post_mortem_dump_p->a0)
#define proc_pc (proc_post_mortem_dump_p->pc)
#define proc_usp (proc_post_mortem_dump_p->usp)
#define proc_utk (proc_post_mortem_dump_p->stk)
/* timer, crit error and process termination handoff vectors */
#define etv_timer (((void (**)()) 0x400L))
#define etv_critic (((void (**)()) 0x404L))
#define etv_term (((void (**)()) 0x408L))
/* memory controller */
#define MEMVALID_MAGIC 0x752019F3L /* once memory is sized */
#define memvalid (((unsigned long *) 0x420L))
#define mencntlr (((unsigned char *) 0x424L))
/* 0 = 128K, 4 = 512K 0 = 256k(2banks) 5 = 1M */
/* reset vector, jump through resvector if resvalid on reset */
#define RESVALID_MAGIC 0x31415926L
#define resvalid ((unsigned long *) 0x426L)
#define resvector ((void (**)()) 0x42aL)
/* do a jmp 0x24L(a6) at end to go to system reset */
/* mem */
#define phystop (((unsigned long *) 0x42eL)) /* physical top of ram */
#define _membot (((unsigned long *) 0x432L)) /* bottom of avail */
#define _memtop (((unsigned long *) 0x436L)) /* top of avail */
#define MEMVAL2_MAGIC 0x237698AAL /* after suc. coldstart && memvalid */
#define memval2 (((unsigned long *) 0x43aL))
/* floppy */
#define flock (((short *) 0x43eL)) /* lock usage of DMA chip */
#define seekrate (((short *) 0x440L)) /* 0=6ms 1=12ms 2=2ms 3=3ms */
#define _timr_ms (((short *) 0x442L)) /* timer calib == 20ms */
#define _fverify (((short *) 0x444L)) /* write verify flag */
#define _bootdev (((short *) 0x446L))
/* video */
#define palmode (((short *) 0x448L)) /* PAL video mode flag */
#define defshiftmd (((unsigned char *) 0x44aL)) /* default video rez */
#define sshiftmd (((short *) 0x44cL)) /* shadow of hdwr. shiftmd reg */
/* 0=Lo 1=med 2=Hi rez */
#define _v_bas_ad (((void *) 0x44eL)) /* screen mem base */
#define vblsem ((short *) 0x452L)) /* vbl semaphore */
#define nvbls (((short *) 0x454L)) /* # of vbl entries def. == 8 */
#define _vblqueue (((void (***)()) 0x456L)) /* vbl queue pointer */
#define colorptr (((short **) 0x45aL)) /* pal. on next vblank if!NULL */
#define _vbclock (((unsigned long *) 0x462L)) /* vbi counter */
#define _frclock (((unsigned long *) 0x466L)) /* #vbi not vblsem'ed */
#define _hz_200 ((unsigned long *) 0x4baL)
#define conterm (*((char *) 0x484L))
#define savptr ((long *) 0x4A2L)
#define _nflops ((short *) 0x4A6L)
#define _sysbase ((long *) 0x4F2L)
#define _shell_p ((long *) 0x4F6L)
typedef struct {
short puns;
char v_p_un[16];
long pstart[16];
short bpbs[1]; /* really 16 BPB's (bios parameter block) */
} HDINFO;
#define pun_ptr ((HDINFO *) 0x516L)
#define _p_cookies ((long **) 0x5A0L)
/* os header */
typedef struct _osheader
{
unsigned short os_entry; /* 0x00 BRA to reset handler */
unsigned short os_version; /* 0x02 TOS version */
void (*reseth) __PROTO((void)); /* 0x04 -> reset handler */
struct _osheader *os_beg; /* 0x08 -> base of OS */
void *os_end; /* 0x0c -> end of OS ram usage */
char *os_rsv1; /* 0x10 reserved */
char *os_magic; /* 0x14 GEM memory usage param */
long os_date; /* 0x18 Build date 0xMMDDYYYY */
unsigned short os_conf; /* 0x1c OS conf bits */
unsigned short os_dosdate; /* 0x1e DOS format build date */
/* the following available on TOS version >= 1.2 */
char **p_root; /* 0x20 -> base of OS pool */
char **pkbshift; /* 0x24 -> kbd shift state var */
char **p_run; /* 0x28 -> PID of current proc */
char *p_rsv2; /* 0x2c reserved */
} OSHEADER;
/* zzzz to-do more */
extern long get_sysvar (void *var) __THROW;
extern void set_sysvar_to_long (void *var, long val) __THROW;
__END_DECLS
#endif /* _SYSVARS_H */

View File

@@ -0,0 +1,49 @@
#ifndef _MINT_XBRA_H
# define _MINT_XBRA_H 1
#ifndef _FEATURES_H
# include <features.h>
#endif
__BEGIN_DECLS
typedef void (*xptr) __PROTO((void));
typedef struct __xbra
{
long xbra_magic;
long gnuc_magic;
xptr next;
short jump;
void (*this) __PROTO((void));
} xbra_struct;
#define _XBRA_MAGIC 0x58425241L /* "XBRA" */
#define _GNUC_MAGIC 0x474E5543L /* "GNUC" */
#define _JMP_OPCODE 0x4EF9
#define _JSR_OPCODE 0x4EB9
#define _XBRA_VEC(x) ((void (*) __PROTO((void))) &(x.jump))
#define _XBRA_INIT(fn) { \
_XBRA_MAGIC, \
_GNUC_MAGIC, \
(xptr) 0, \
_JMP_OPCODE, \
(void (*) __PROTO((void))) fn \
}
#define _TRAP_VEC(n,x) ((void (*) __PROTO((void))) (((long) n << 24) | (long) &(x.jump)))
#define _TRAP_INIT(fn) { \
_XBRA_MAGIC, \
_GNUC_MAGIC, \
(xptr) 0, \
_JSR_OPCODE, \
(void (*) __PROTO((void))) fn \
}
__END_DECLS
#endif /* _XBRA_H */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,294 @@
/*******************************************************************************
*
* Project name : NORMALIZED KEY CODE CONVERTER (NKCC)
* Module name : Global definitions
* Symbol prefix: nkc
*
* Author : Harald Siegmund (HS)
* Co-Authors : -
* Write access : HS
*
* Notes : -
*-------------------------------------------------------------------------------
* Things to do : -
*
*-------------------------------------------------------------------------------
* History:
*
* 1990:
* May 23-24: creation of file
* Jul 09: nkc_kstate()
* Aug 03: nkc_cmp(); NK_MASK
* Sep 15: nkc_init(): beflag,vdihnd; BE_...
* nkc_exit() has now a result
* Sep 16: nkc_timer()
* Oct 03: nkc_vlink()/vunlink(); NKXM_...
* Oct 07: removing NK_MASK (use nkc_cmp() for key code comparism!)
* Nov 13: NK_LEFT/NK_RIGHT exchanged
* Dec 11: MU_XTIMER
* 1991:
* Apr 13: nkc_conv() renamed to nkc_tconv()
* nkc_gconv()
* rearranging prototypes
* May 29: nkc_toupper, nkc_tolower
* Aug 22: NKS_DEADKEY changed
* NKS_D_...
* nkc_set() changed
* nkc_init() now returns version #
* Aug 26: NK_INVALID
* Sep 07: NK_TERM
* Sep 14: NKF_IGNUM
* Nov 16: NKS_CTRL
* Dec 29: NK_RVD...
* 1992:
* Jan 03: redefining BE_...
* NKI_...
* first parameter of nkc_init() is now of type 'unsigned long'
* Jan 12: NK_TERM: int-cast added
* 1993:
* Dec 11: new file header
* adding documentation markers and section headers
* nkc_toupper() and nkc_tolower() are functions now
* Dec 12: new: nkc_n2tos(), nkc_n2gem()
*
***************************************************************************/
/*KEY _NAME="Global NKCC definitions (C language)" */
/*END*/
#ifndef __NKCC
#define __NKCC
/*KEY _END */
/*******************************************************************************
* *
* MACROS *
* *
*******************************************************************************/
/*START*/
/* flags for NKCC initialization */
#define NKI_BUTHND 0x00000001UL /* install button event handler */
#define NKI_BHTOS 0x00000002UL /* additional flag: only if TOS has */
/* mouse click bug */
#define NKI_NO200HZ 0x00000004UL /* don't install 200 Hz clock interrupt */
/* (this flag is ignored if the button */
/* event handler is being activated) */
/*END*/
/*START*/
/* flag combinations for compatibility with old versions of NKCC */
#define BE_ON NKI_BUTHND
#define BE_OFF 0
#define BE_TOS (NKI_BUTHND | NKI_BHTOS)
/*END*/
/*START*/
/* flags for special key code handling */
#define NKS_ALTNUM 0x00000001UL /* Alt + numeric pad -> ASCII */
#define NKS_CTRL 0x00000002UL /* Control key emulation */
/* deadkey management: */
#define NKS_D_CIRCUM 0x00010000UL /* ^ accent circumflex */
#define NKS_D_TILDE 0x00020000UL /* ~ accent tilde */
#define NKS_D_AGUI 0x00040000UL /* ' accent agui */
#define NKS_D_GRAVE 0x00080000UL /* ` accent grave */
#define NKS_D_UMLAUT 0x00100000UL /* <20> umlaut */
#define NKS_D_QUOTE 0x00200000UL /* " quote, synonym for umlaut */
#define NKS_D_SMOERE 0x00400000UL /* <20> smoerebroed */
#define NKS_D_CEDIL 0x00800000UL /* , cedil */
#define NKS_D_SLASH 0x01000000UL /* / slash, for scandinavian characters */
#define NKS_DEADKEY 0xffff0000UL /* all deadkeys */
/*END*/
/*START*/
/* NKCC key code flags */
#define NKF_FUNC 0x8000 /* function */
#define NKF_RESVD 0x4000 /* resvd, ignore it! */
#define NKF_NUM 0x2000 /* numeric pad */
#define NKF_CAPS 0x1000 /* CapsLock */
#define NKF_ALT 0x0800 /* Alternate */
#define NKF_CTRL 0x0400 /* Control */
#define NKF_SHIFT 0x0300 /* any Shift key */
#define NKF_LSH 0x0200 /* left Shift key */
#define NKF_RSH 0x0100 /* right Shift key */
#define NKF_IGNUM NKF_RESVD /* special flag for nkc_cmp() */
/*END*/
/*START*/
/* special key codes for keys performing a function */
#define NK_INVALID 0x00 /* invalid key code */
#define NK_UP 0x01 /* cursor up */
#define NK_DOWN 0x02 /* cursor down */
#define NK_RIGHT 0x03 /* cursor right */
#define NK_LEFT 0x04 /* cursor left */
#define NK_RVD05 0x05 /* reserved! */
#define NK_RVD06 0x06 /* reserved! */
#define NK_RVD07 0x07 /* reserved! */
#define NK_BS 0x08 /* Backspace */
#define NK_TAB 0x09 /* Tab */
#define NK_ENTER 0x0a /* Enter */
#define NK_INS 0x0b /* Insert */
#define NK_CLRHOME 0x0c /* Clr/Home */
#define NK_RET 0x0d /* Return */
#define NK_HELP 0x0e /* Help */
#define NK_UNDO 0x0f /* Undo */
#define NK_F1 0x10 /* function key #1 */
#define NK_F2 0x11 /* function key #2 */
#define NK_F3 0x12 /* function key #3 */
#define NK_F4 0x13 /* function key #4 */
#define NK_F5 0x14 /* function key #5 */
#define NK_F6 0x15 /* function key #6 */
#define NK_F7 0x16 /* function key #7 */
#define NK_F8 0x17 /* function key #8 */
#define NK_F9 0x18 /* function key #9 */
#define NK_F10 0x19 /* function key #10 */
#define NK_RVD1A 0x1a /* reserved! */
#define NK_ESC 0x1b /* Esc */
#define NK_RVD1C 0x1c /* reserved! */
#define NK_RVD1D 0x1d /* reserved! */
#define NK_RVD1E 0x1e /* reserved! */
#define NK_DEL 0x1f /* Delete */
/* terminator for key code tables */
#define NK_TERM ((short)(NKF_FUNC | NK_INVALID))
/*END*/
/*START*/
/* ASCII codes less than 32 */
#define NUL 0x00 /* Null */
#define SOH 0x01 /* Start Of Header */
#define STX 0x02 /* Start Of Text */
#define ETX 0x03 /* End Of Text */
#define EOT 0x04 /* End Of Transmission */
#define ENQ 0x05 /* Enquiry */
#define ACK 0x06 /* positive Acknowledgement */
#define BEL 0x07 /* Bell */
#define BS 0x08 /* BackSpace */
#define HT 0x09 /* Horizontal Tab */
#define LF 0x0a /* Line Feed */
#define VT 0x0b /* Vertical Tab */
#define FF 0x0c /* Form Feed */
#define CR 0x0d /* Carriage Return */
#define SO 0x0e /* Shift Out */
#define SI 0x0f /* Shift In */
#define DLE 0x10 /* Data Link Escape */
#define DC1 0x11 /* Device Control 1 */
#define XON 0x11 /* same as DC1 */
#define DC2 0x12 /* Device Control 2 */
#define DC3 0x13 /* Device Control 3 */
#define XOFF 0x13 /* same as DC3 */
#define DC4 0x14 /* Device Control 4 */
#define NAK 0x15 /* Negative Acknowledgement */
#define SYN 0x16 /* Synchronize */
#define ETB 0x17 /* End of Transmission Block */
#define CAN 0x18 /* Cancel */
#define EM 0x19 /* End of Medium */
#define SUB 0x1a /* Substitute */
#define ESC 0x1b /* Escape */
#define FS 0x1c /* Form Separator */
#define GS 0x1d /* Group Separator */
#define RS 0x1e /* Record Separator */
#define US 0x1f /* Unit Separator */
/*END*/
/*START*/
/* XBRA vector link/unlink modes */
#define NKXM_NUM 0 /* by vector number */
#define NKXM_ADR 1 /* by vector address */
/*END*/
/*START*/
/* additional flag in event mask */
#define MU_XTIMER 0x100
/*END*/
/*******************************************************************************
* *
* PROTOTYPES *
* *
*******************************************************************************/
/* install NKCC */
short nkc_init(unsigned long flags,short vdihnd,short *pglobal);
/* deinstall NKCC */
short nkc_exit(void);
/* set special key flags */
void nkc_set(unsigned long flags);
/* NKCC key input via GEMDOS */
short nkc_conin(void);
/* console input status via GEMDOS */
short nkc_cstat(void);
/* NKCC multi event */
short cdecl nkc_multi(
short mflags,
short mbclicks,short mbmask,short mbstate,
short mm1flags,short mm1x,short mm1y,short mm1width,short mm1height,
short mm2flags,short mm2x,short mm2y,short mm2width,short mm2height,
short *mmgpbuff,
short mtlocount,short mthicount,
short *mmox,short *mmoy,short *mmbutton,short *mmokstate,
short *mkreturn,short *mbreturn);
/* convert key code in TOS format to normalized format */
short nkc_tconv(long toskey);
/* convert key code in GEM format to normalized format */
short nkc_gconv(short gemkey);
/* convert key code in normalized format to TOS format */
long nkc_n2tos(short nkcode);
/* convert key code in normalized format to GEM format */
short nkc_n2gem(short nkcode);
/* return shift key state */
short nkc_kstate(void);
/* get 200 Hz system clock counter */
unsigned long nkc_timer(void);
/* compare two key codes due to standard comparism rules */
short nkc_cmp(short refkey,short kcode);
/* link function to XBRA vector list */
void nkc_vlink(long vector,short mo,void *pfnc);
/* unlink function from XBRA vector list */
short nkc_vunlink(long vector,short mo,void *pfnc);
/* convert character to upper case */
unsigned char nkc_toupper(unsigned char chr);
/* convert character to lower case */
unsigned char nkc_tolower(unsigned char chr);
#endif /* #ifndef __NKCC */
/* End Of File */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,388 @@
/* VDI.H
GEM VDI Definitions
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __VDI__ )
#define __VDI__
#define VDI_H
typedef struct
{
int contrl[15];
int intin[132];
int intout[140];
int ptsin[145];
int ptsout[145];
} VDIPARBLK;
typedef struct
{
int *contrl;
int *intin;
int *ptsin;
int *intout;
int *ptsout;
} VDIPB;
extern VDIPARBLK _VDIParBlk;
void vdi( VDIPB *vdipb );
/****** Control definitions *********************************************/
void v_opnwk( int *work_in, int *handle, int *work_out);
void v_clswk( int handle );
void v_opnvwk( int *work_in, int *handle, int *work_out);
void v_clsvwk( int handle );
void v_clrwk( int handle );
void v_updwk( int handle );
int vst_load_fonts( int handle, int select );
void vst_unload_fonts( int handle, int select );
void vs_clip( int handle, int clip_flag, int *pxyarray );
/****** Output definitions **********************************************/
void v_pline( int handle, int count, int *pxyarray );
void v_pmarker( int handle, int count, int *pxyarray );
void v_gtext( int handle, int x, int y, char *string );
void v_fillarea( int handle, int count, int *pxyarray );
void v_cellarray( int handle, int *pxyarray, int row_length,
int el_used, int num_rows, int wrt_mode,
int *colarray );
void v_contourfill( int handle, int x, int y, int index );
void vr_recfl( int handle, int *pxyarray );
void v_bar( int handle, int *pxyarray );
void v_arc( int handle, int x, int y, int radius,
int begang, int endang );
void v_pieslice( int handle, int x, int y, int radius,
int begang, int endang );
void v_circle( int handle, int x, int y, int radius );
void v_ellarc( int handle, int x, int y, int xradius,
int yradius, int begang, int endang );
void v_ellpie( int handle, int x, int y, int xradius,
int yradius, int begang, int endang );
void v_ellipse( int handle, int x, int y, int xradius,
int yradius );
void v_rbox ( int handle, int *pxyarray );
void v_rfbox ( int handle, int *pxyarray );
void v_justified( int handle,int x, int y, char *string,
int length, int word_space,
int char_space );
/****** Attribute definitions *****************************************/
#define IP_HOLLOW 0
#define IP_1PATT 1
#define IP_2PATT 2
#define IP_3PATT 3
#define IP_4PATT 4
#define IP_5PATT 5
#define IP_6PATT 6
#define IP_SOLID 7
/* gsx modes */
#define MD_REPLACE 1
#define MD_TRANS 2
#define MD_XOR 3
#define MD_ERASE 4
/* gsx styles */
#define FIS_HOLLOW 0
#define FIS_SOLID 1
#define FIS_PATTERN 2
#define FIS_HATCH 3
#define FIS_USER 4
/* bit blt rules */
#define ALL_WHITE 0
#define S_AND_D 1
#define S_AND_NOTD 2
#define S_ONLY 3
#define NOTS_AND_D 4
#define D_ONLY 5
#define S_XOR_D 6
#define S_OR_D 7
#define NOT_SORD 8
#define NOT_SXORD 9
#define D_INVERT 10
#define NOT_D 11
#define S_OR_NOTD 12
#define NOTS_OR_D 13
#define NOT_SANDD 14
#define ALL_BLACK 15
/* linetypes */
#define SOLID 1
#define LONGDASH 2
#define DOT 3
#define DASHDOT 4
#define DASH 5
#define DASH2DOT 6
#define USERLINE 7
#define SQUARE 0
#define ARROWED 1
#define ROUND 2
/* Lattice C should better use the TF_xxx-constants anyway... */
#define THICKENED 0x01
#define SHADED 0x02
#define SKEWED 0x04
#define UNDERLINED 0x08
#define OUTLINE 0x10
#define SHADOW 0x20
int vswr_mode( int handle, int mo );
void vs_color( int handle, int index, int *rgb_in );
int vsl_type( int handle, int style );
void vsl_udsty( int handle, int pattern );
int vsl_width( int handle, int width );
int vsl_color( int handle, int color_index );
void vsl_ends( int handle, int beg_style, int end_style );
int vsm_type( int handle, int symbol );
int vsm_height( int handle, int height );
int vsm_color( int handle, int color_index );
void vst_height( int handle, int height, int *char_width,
int *char_height, int *cell_width,
int *cell_height );
int vst_point( int handle, int point, int *char_width,
int *char_height, int *cell_width,
int *cell_height );
int vst_rotation( int handle, int angle );
int vst_font( int handle, int font );
int vst_color( int handle, int color_index );
int vst_effects( int handle, int effect );
void vst_alignment( int handle, int hor_in, int vert_in,
int *hor_out, int *vert_out );
int vsf_interior( int handle, int style );
int vsf_style( int handle, int style_index );
int vsf_color( int handle, int color_index );
int vsf_perimeter( int handle, int per_vis );
void vsf_udpat( int handle, int *pfill_pat, int planes );
/****** Raster definitions *********************************************/
typedef struct
{
void * fd_addr;
int fd_w,
fd_h,
fd_wdwidth,
fd_stand,
fd_nplanes,
fd_r1,
fd_r2,
fd_r3;
} MFDB;
void vro_cpyfm( int handle, int vr_mode, int *pxyarray,
MFDB *psrcMFDB, MFDB *pdesMFDB );
void vrt_cpyfm( int handle, int vr_mode, int *pxyarray,
MFDB *psrcMFDB, MFDB *pdesMFDB,
int *color_index );
void vr_trnfm( int handle, MFDB *psrcMFDB, MFDB *pdesMFDB );
void v_get_pixel( int handle, int x, int y, int *pel,
int *index );
/****** Input definitions **********************************************/
void vsin_mode( int handle, int dev_type, int mo );
void vrq_locator( int handle, int x, int y, int *xout,
int *yout, int *term );
int vsm_locator( int handle, int x, int y, int *xout,
int *yout, int *term );
void vrq_valuator( int handle, int valuator_in,
int *valuator_out, int *terminator );
void vsm_valuator( int handle, int val_in, int *val_out,
int *term, int *status );
void vrq_choice( int handle, int ch_in, int *ch_out );
int vsm_choice( int handle, int *choice );
void vrq_string( int handle, int max_length, int echo_mode,
int *echo_xy, char *string );
int vsm_string( int handle, int max_length, int echo_mode,
int *echo_xy, char *string );
void vsc_form( int handle, MFORM *pcur_form );
void vex_timv( int handle, int (*tim_addr)(), int (**otim_addr)(),
int *tim_conv );
void v_show_c( int handle, int reset );
void v_hide_c( int handle );
void vq_mouse( int handle, int *pstatus, int *x, int *y );
void vex_butv( int handle, int (*pusrcode)(), int (**psavcode)() );
void vex_motv( int handle, int (*pusrcode)(), int (**psavcode)() );
void vex_curv( int handle, int (*pusrcode)(), int (**psavcode)() );
void vex_whlv( int handle, int (*pusrcode)(), int (**psavcode)() ); /* HR 111002: wheel support */
void vq_key_s( int handle, int *pstatus );
/****** Inquire definitions *******************************************/
void vq_extnd( int handle, int owflag, int *work_out );
int vq_color( int handle, int color_index,
int set_flag, int *rgb );
void vql_attributes( int handle, int *attrib );
void vqm_attributes( int handle, int *attrib );
void vqf_attributes( int handle, int *attrib );
void vqt_attributes( int handle, int *attrib );
void vqt_extent( int handle, char *string, int *extent );
int vqt_width( int handle, int character,
int *cell_width, int *left_delta,
int *right_delta );
int vqt_name( int handle, int element_num, char *name );
void vq_cellarray( int handle, int *pxyarray,
int row_length, int num_rows,
int *el_used, int *rows_used,
int *status, int *colarray );
void vqin_mode( int handle, int dew_type, int *input_mode );
void vqt_fontinfo( int handle, int *minADE, int *maxADE,
int *distances, int *maxwidth,
int *effects );
/****** Escape definitions *********************************************/
void vq_chcells( int handle, int *rows, int *columns );
void v_exit_cur( int handle );
void v_enter_cur( int handle );
void v_curup( int handle );
void v_curdown( int handle );
void v_curright( int handle );
void v_curleft( int handle );
void v_curhome( int handle );
void v_eeos( int handle );
void v_eeol( int handle );
void vs_curaddress( int handle, int Row, int Column );
void v_curaddress( int handle, int Row, int Column );
void v_curtext( int handle, char *string );
void v_rvon( int handle );
void v_rvoff( int handle );
void vq_curaddress( int handle, int *Row, int *Column );
int vq_tabstatus( int handle );
void v_hardcopy( int handle );
void v_dspcur( int handle, int x, int y );
void v_rmcur( int handle );
void v_form_adv( int handle );
void v_output_window( int handle, int *xyarray );
void v_clear_disp_list( int handle );
void v_bit_image( int handle, const char *filename,
int aspect, int x_scale, int y_scale,
int h_align, int v_align, int *xyarray );
void vq_scan( int handle, int *g_slice, int *g_page,
int *a_slice, int *a_page, int *div_fac);
void v_alpha_text( int handle, char *string );
void vs_palette( int handle, int palette );
void v_sound( int handle, int frequency, int duration );
int vs_mute( int handle, int action );
void vqp_films( int handle, char *film_names );
void vqp_state( int handle, int *port, char *film_name,
int *lightness, int *interlace,
int *planes, int *indexes );
void vsp_state( int handle, int port, int film_num,
int lightness, int interlace, int planes,
int *indexes );
void vsp_save( int handle );
void vsp_message( int handle );
int vqp_error( int handle );
void v_meta_extents( int handle, int min_x, int min_y,
int max_x, int max_y );
void v_write_meta( int handle,
int num_intin, int *intin,
int num_ptsin, int *ptsin );
void vm_coords( int handle, int llx, int lly, int urx, int ury );
void vm_filename( int handle, const char *filename );
void vm_pagesize( int handle, int pgwidth, int pdheight );
void v_offset( int handle, int offset );
void v_fontinit( int handle, int fh_high, int fh_low );
void v_escape2000( int handle, int times );
void vt_resolution( int handle, int xres, int yres,
int *xset, int *yset );
void vt_axis( int handle, int xres, int yres,
int *xset, int *yset );
void vt_origin( int handle, int xorigin, int yorigin );
void vq_tdimensions( int handle, int *xdimension, int *ydimension );
void vt_alignment( int handle, int dx, int dy );
void vsp_film( int handle, int index, int lightness );
void vsc_expose( int handle, int state );
#define GDOS_NONE -2L /* no GDOS installed */
#define GDOS_FSM 0x5F46534DL /* '_FSM' - FSMGDOS installed */
#define GDOS_FNT 0x5F464E54L /* '_FNT' - FONTGDOS installed */
int vq_gdos( void );
long vq_vgdos( void );
int v_bez_on( int handle );
void v_bez_off( int handle );
void v_set_app_buff( int handle, void *address, int nparagraphs );
void v_bez( int handle, int count, int *xyarr,
char *bezarr, int *extent, int *totpts, int *totmoves );
void v_bez_fill( int handle, int count, int *xyarr,
char *bezarr, int *extent, int *totpts,
int *totmoves );
int v_bez_qual( int handle, int prcnt, int *actual );
/****** SpeedoGDOS definitions ********************************************/
typedef long fix31;
void vqt_f_extent( int handle, char *string, int *extent );
void v_ftext( int handle, int x, int y, char *string );
void v_ftext_offset( int handle, int x, int y, char *string, int *offset );
void v_killoutline( int handle, void *component );
void v_getoutline( int handle, int ch, int *xyarray,
char *bezarray, int maxverts, int *numverts );
void vst_scratch( int handle, int mo );
void vst_error( int handle, int mo, int *errorvar );
void vqt_advance( int handle, int ch, int *advx, int *advy,
int *remx, int *remy );
void vqt_advance32( int handle, int ch, fix31 *advx, fix31 *advy );
int vst_arbpt( int handle, int point, int *chwd, int *chht,
int *cellwd, int *cellht );
fix31 vst_arbpt32( int handle, fix31 point, int *chwd, int *chht,
int *cellwd, int *cellht );
void vst_charmap( int handle, int mo );
void v_getbitmap_info( int handle, int ch, fix31 *advx, fix31 *advy,
fix31 *xoff, fix31 *yoff, fix31 *width,
fix31 *height );
void vqt_pairkern( int handle, int ch1, int ch2, fix31 *x, fix31 *y );
void vqt_trackkern( int handle, fix31 *x, fix31 *y );
void vqt_fontheader( int handle, char *buffer, char *pathname );
void vst_kern( int handle, int tmode, int pmode, int *tracks,
int *pairs );
fix31 vst_setsize32( int handle, fix31 point, int *chwd, int *chht,
int *cellwd, int *cellht );
void vqt_devinfo( int handle, int devnum, int *devexits,
char *devstr );
int v_flushcache( int handle );
void vqt_cachesize( int handle, int which_cache, long *size );
void vqt_get_table( int handle, int **map );
int v_loadcache( int handle, char *filename, int mo );
int v_savecache( int handle, char *filename );
int vst_setsize( int handle, int point, int *chwd, int *chht,
int *cellwd, int *cellht );
int vst_skew( int handle, int skew );
#endif
/***********************************************************************/

View File

@@ -0,0 +1,4 @@
#include <tos.h>

View File

@@ -0,0 +1,54 @@
/* This file is part of the AHCC C Library.
The AHCC C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The AHCC C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#if defined DEFENUM
#define deferrno(n, s, t) n = s
#elif defined DEFLIST
#define deferrno(n, s, t) {t, #n, n}
#else
#error invalid macro definition
#endif
deferrno(ENOERR, 0, "no error"),
deferrno(EPERM, 1, "file permission denied"),
deferrno(ENOENT, 2, "File not found"),
deferrno(EIO, 5, "general i/o error"),
deferrno(EBADF, 9, "invalid file handle"),
deferrno(EILLSPE, 10, "illegal file specification "),
deferrno(EINVMEM, 11, "invalid heap block "),
deferrno(ENOMEM, 12, "heap overflow"),
deferrno(EACCES, 13, "file access mode error"),
deferrno(EEXIST, 17, "file already exists"),
deferrno(EPLFMT, 18, "program load format error"),
deferrno(ENODEV, 19, "device error"),
deferrno(ENOTDIR, 20, "path not found"),
deferrno(EINVAL, 22, "invalid parameter"),
deferrno(ENFILE, 23, "file table overflow"),
deferrno(EMFILE, 24, "too many open files"),
deferrno(ENOSPC, 28, "disk full"),
deferrno(ESPIPE, 29, "seek error"),
deferrno(EROFS, 30, "read only device"),
deferrno(ENOSYS, 32, "function not implemented"),
deferrno(EDOM, 33, "Domain error"),
deferrno(ERANGE, 34, "range error"),
deferrno(ENMFILE, 35, "no more matching file"),
#undef DEFENUM
#undef DEFLIST
#undef deferrno

View File

@@ -0,0 +1,24 @@
/* PORTAB.H
For use with rsh output of RCS
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __PORTAB__ )
#define __PORTAB__
typedef void VOID;
typedef char BYTE;
typedef int WORD;
typedef long LONG;
typedef unsigned char UBYTE;
typedef unsigned int UWORD;
typedef unsigned long ULONG;
typedef unsigned char UCHAR;
#endif
/***********************************************************************/


View File

@@ -0,0 +1,103 @@
/* (c) 1991-2008 by H. Robbers te Amsterdam
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef PRELUDE_H
#define PRELUDE_H
/* HR: the word global should really be kept reserved for (future?)
use as the opposite of auto, local or static. */
#undef TRUE
#undef FALSE
#undef true
#undef false
#undef NULL
#undef null
#undef NIL
#undef nil
#ifndef __NO_FLOAT__
typedef double real;
#endif
#if ! __ABC__ /* FOR_A 0; Not for 'A' compiler. */
/* These are otherwise builtin */
#define and && /* ISO646 */
#define or || /* ISO646 */
#define not !
#define eq ==
#define ne !=
#define ge >=
#define le <=
#define mod %
#if ! _PC_
#define global /* might clash with declaration in aes.h */
#endif
#define nil 0L
#define esac break;
#define elif else if
#define od while(1); /* ; no mistake */
#ifndef __NO_FLOAT__
typedef double extended;
typedef float single;
typedef struct { double re, im; } complex;
typedef complex compl;
#endif
#endif /* !__ABC__ */
#if ! __bool_true_false_are_defined
/* these are otherwise built in or provided by stdbool.h */
typedef enum
{
false = 0,
true
} _Bool, bool;
#define __bool_true_false_are_defined 1
#elif __AHCC__
typedef _Bool bool;
#endif
#define othw }else{
#define NULL 0L
#define null 0L
#define NIL 0L
#define FALSE false
#define TRUE true
typedef const char Cchar;
typedef const char * Cstr;
typedef char * Wstr;
typedef unsigned char uchar;
typedef unsigned short uint, ushort;
typedef unsigned long ulong;
#if __AHCC__
typedef short bits; /* use these for bitfields */
typedef unsigned short ubits;
#else
/* Pure C doesnt accept short for bit fields */
typedef int bits; /* use these for bitfields */
typedef unsigned int ubits;
#endif
#define K *1024
#define fall_thru
#define EOS '\0'
#endif

View File

@@ -0,0 +1,20 @@
/* PROCESS.H
Process Definition Includes
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __PROCESS )
#define __PROCESS
int exec( char *filename, char *cmdlstr, char *envstr, int *retcode );
#endif
/************************************************************************/


View File

@@ -0,0 +1,45 @@
/* Copyright (c) 2014 by H. Robbers.
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Also usable with Pure C */
#ifndef ROTATE_H
#define ROTATE_H
#if __COLDFIRE__
/* rotate macros for Coldfire compatible code */
#define __rorb(a,n) (((unsigned char)a>>n)|((unsigned char)a<<((sizeof(a)*8)-n)))
#define __ror (a,n) (((unsigned int)a>>n)|((unsigned int)a<<((sizeof(a)*8)-n)))
#define __rorl(a,n) (((unsigned long)a>>n)|((unsigned long)a<<((sizeof(a)*8)-n)))
#define __rolb(a,n) (((unsigned char)a<<n)|((unsigned char)a>>((sizeof(a)*8)-n)))
#define __rol (a,n) (((unsigned int)a<<n)|((unsigned int)a>>((sizeof(a)*8)-n)))
#define __roll(a,n) (((unsigned long)a<<n)|((unsigned long)a>>((sizeof(a)*8)-n)))
#else
/* rotate macros for M68K code */
int rorb(char a, int n) 0161070;
int ror (int a, int n) 0161170;
int rorl(long a, int n) 0161270;
int rolb(char a, int n) 0161470;
int rol (int a, int n) 0161570;
int roll(long a, int n) 0161670;
#endif
#endif

View File

@@ -0,0 +1,143 @@
/********************************/
/* file scancode.h */
/* Holger Weets & Frank Specht */
/* letzte Aenderung: 28.01.90 */
/* back to UK HR: 15.04.92 */
/********************************/
#ifndef __SCANCODE_H
#define __SCANCODE_H
typedef enum
{
CNTRL_A = 0x1e01,
CNTRL_B = 0x3002,
CNTRL_C = 0x2e03,
CNTRL_D = 0x2004,
CNTRL_E = 0x1205,
CNTRL_F = 0x2106,
CNTRL_G = 0x2207,
CNTRL_H = 0x2308,
CNTRL_I = 0x1709,
CNTRL_J = 0x240a,
CNTRL_K = 0x250b,
CNTRL_L = 0x260c,
CNTRL_M = 0x320d,
CNTRL_N = 0x310e,
CNTRL_O = 0x180f,
CNTRL_P = 0x1910,
CNTRL_Q = 0x1011,
CNTRL_R = 0x1312,
CNTRL_S = 0x1f13,
CNTRL_T = 0x1414,
CNTRL_U = 0x1615,
CNTRL_V = 0x2f16,
CNTRL_W = 0x1117,
CNTRL_X = 0x2d18,
CNTRL_Y = 0x1519, /* 4'92 */
CNTRL_Z = 0x2c1a, /* 4'92 */
CNTRL_AE = 0X2804,
CNTRL_OE = 0x2714,
CNTRL_UE = 0x1a01,
CNTRL_1 = 0x0211,
CNTRL_2 = 0x0300,
CNTRL_3 = 0x0413,
CNTRL_4 = 0x0514,
CNTRL_5 = 0x0615,
CNTRL_6 = 0x071e,
CNTRL_7 = 0x0817,
CNTRL_8 = 0x0918,
CNTRL_9 = 0x0a19,
CNTRL_0 = 0x0b10,
CNTRL_CL = 0x7300,
CNTRL_CR = 0x7400,
CNTRL_HOME = 0x7700,
CNTRL_DEL = 0x531F,
CNTRL_SP = 0x3900,
ALT_A = 0x1e00,
ALT_B = 0x3000,
ALT_C = 0x2e00,
ALT_D = 0x2000,
ALT_E = 0x1200,
ALT_F = 0x2100,
ALT_G = 0x2200,
ALT_H = 0x2300,
ALT_I = 0x1700,
ALT_J = 0x2400,
ALT_K = 0x2500,
ALT_L = 0x2600,
ALT_M = 0x3200,
ALT_N = 0x3100,
ALT_O = 0x1800,
ALT_P = 0x1900,
ALT_Q = 0x1000,
ALT_R = 0x1300,
ALT_S = 0x1f00,
ALT_T = 0x1400,
ALT_U = 0x1600,
ALT_V = 0x2f00,
ALT_W = 0x1100,
ALT_X = 0x2d00,
ALT_Y = 0x2c00,
ALT_Z = 0x1500,
ALT_AE = 0x285d,
ALT_OE = 0x275b,
ALT_UE = 0x1a40,
ALT_1 = 0x7800, /* ab TOS x.06 allein alpha blok */
ALT_2 = 0x7900,
ALT_3 = 0x7a00,
ALT_4 = 0x7b00,
ALT_5 = 0x7c00,
ALT_6 = 0x7d00,
ALT_7 = 0x7e00,
ALT_8 = 0x7f00,
ALT_9 = -0x8000,
ALT_0 = -0x7f00,
SH_ALT_AE = 0x287d,
SH_ALT_OE = 0x277b,
SH_ALT_UE = 0x1a5c,
ESCAPE = 0x011b,
BACKSPACE = 0x0e08,
DELETE = 0x537f,
INSERT = 0x5200,
SHFT_INS = 0x5230,
RETURN = 0x1c0d,
ENTER = 0x720d,
CUR_UP = 0x4800,
SHFT_CU = 0x4838,
CUR_LEFT = 0x4b00,
SHFT_CL = 0x4b34,
CUR_RIGHT = 0x4d00,
SHFT_CR = 0x4d36,
CUR_DOWN = 0x5000,
SHFT_CD = 0x5032,
HOME = 0x4700,
SHFT_HOME = 0x4737,
UNDO = 0x6100,
TAB = 0x0f09,
HELP = 0x6200,
F1 = 0x3b00,
SHFT_F1 = 0x5400,
F2 = 0x3c00,
SHFT_F2 = 0x5500,
F3 = 0x3d00,
SHFT_F3 = 0x5600,
F4 = 0x3e00,
SHFT_F4 = 0x5700,
F5 = 0x3f00,
SHFT_F5 = 0x5800,
F6 = 0x4000,
SHFT_F6 = 0x5900,
F7 = 0x4100,
SHFT_F7 = 0x5a00,
F8 = 0x4200,
SHFT_F8 = 0x5b00,
F9 = 0x4300,
SHFT_F9 = 0x5c00,
F10 = 0x4400,
SHFT_F10 = 0x5d00
} SCANCODE;
#endif

View File

@@ -0,0 +1,88 @@
/* SCREEN.H
VT52 Macro Includes
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __VT52 )
#define __VT52
#if !defined( __TOS )
#include <tos.h> /* tos.h already included ? */
#endif
/**** Strings ***********************************************************/
#define NEXT_LINE "\r\n"
#define CUR_UP "\33A"
#define CUR_DOWN "\33B"
#define CUR_RIGHT "\33C"
#define CUR_LEFT "\33D"
#define CLEAR_HOME "\33E"
#define CUR_HOME "\33H"
#define SCROLL_UP "\33I"
#define CLEAR_DOWN "\33J"
#define CLEAR_EOL "\33K"
#define INS_LINE "\33L"
#define DEL_LINE "\33M"
#define GOTO_POS "\33Y"
#define INK "\33b"
#define PAPER "\33c"
#define CLEAR_UP "\33d"
#define CUR_ON "\33e"
#define CUR_OFF "\33f"
#define SAVE_POS "\33j"
#define LOAD_POS "\33k"
#define CLEAR_LINE "\33l"
#define CLEAR_SOL "\33o"
#define REV_ON "\33p"
#define REV_OFF "\33q"
#define WRAP_ON "\33v"
#define WRAP_OFF "\33w"
/**** Functionmacros ****************************************************/
#define Bell() Cconout('\a')
#define Tab() Cconout('\t')
#define Return() Cconout('\r')
#define Line_feed() Cconout('\n')
#define Next_line() Cconws(NEXT_LINE)
#define Cur_up() Cconws(CUR_UP)
#define Cur_down() Cconws(CUR_DOWN)
#define Cur_right() Cconws(CUR_RIGHT)
#define Cur_left() Cconws(CUR_LEFT)
#define Clear_home() Cconws(CLEAR_HOME)
#define Cur_home() Cconws(CUR_HOME)
#define Scroll_up() Cconws(SCROLL_UP)
#define Clear_down() Cconws(CLEAR_DOWN)
#define Clear_eol() Cconws(CLEAR_EOL)
#define Ins_line() Cconws(INS_LINE)
#define Del_line() Cconws(DEL_LINE)
#define Goto_pos(x,y) (Cconws(GOTO_POS), Cconout(' ' + x), Cconout(' ' + y))
#define Ink(c) (Cconws(INK), Cconout(c))
#define Paper(c) (Cconws(PAPER), Cconout(c))
#define Clear_up() Cconws(CLEAR_UP)
#define Cur_on() Cursconf(1, 0)
#define Cur_off() Cursconf(0, 0)
#define Blink_on() Cursconf(2, 0)
#define Blink_off() Cursconf(3, 0)
#define Set_blink(rate) Cursconf(4, rate)
#define Get_blink() Cursconf(5, 0)
#define Save_pos() Cconws(SAVE_POS)
#define Load_pos() Cconws(LOAD_POS)
#define Clear_line() Cconws(CLEAR_LINE)
#define Clear_sol() Cconws(CLEAR_SOL)
#define Rev_on() Cconws(REV_ON)
#define Rev_off() Cconws(REV_OFF)
#define Wrap_on() Cconws(WRAP_ON)
#define Wrap_off() Cconws(WRAP_OFF)
#endif
/************************************************************************/


View File

@@ -0,0 +1,25 @@
/* SETJMP.H
Context Switch Definition Includes
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __SETJMP )
#define __SETJMP
#ifdef __68881__
typedef char jmp_buf[12*4 + 5*12];
#else
typedef char jmp_buf[12*4];
#endif
void longjmp( jmp_buf jmp_buffer, int return_value );
int setjmp( jmp_buf jmp_buffer );
#endif
/************************************************************************/

View File

@@ -0,0 +1,103 @@
/* SIGNAL.H
Signal Definitions
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __SIGNAL__ )
#define __SIGNAL__
#define SIGABRT 80 /* ANSI, abort */
#define SIGTERM 81 /* ANSI, termination */
#define SIGFPE 82 /* ANSI, floating point error */
#define SIGINT 83 /* ANSI, break request: ^d */
#define SIGALRM 84 /* UNIX, Alarm clock */
#define SIGKILL 85 /* UNIX, Kill Process */
#define SIGUSR1 88 /* UNIX, User defined Signal 1 */
#define SIGUSR2 89 /* UNIX, User defined Signal 2 */
#define SIGSEGV 2 /* ANSI, bus error (segment violation) */
#define SIGADR 3 /* adress error */
#define SIGILL 4 /* ANSI, illegal instruction */
#define SIGDIV0 5 /* division by zero */
#define SIGCHK 6 /* CHK */
#define SIGTRAPV 7 /* TRAPV */
#define SIGPRIV 8 /* privilege violation */
#define SIGTRACE 9 /* TRACE */
#define SIGLINEA 10 /* LINEA */
#define SIGLINEF 11 /* LINEF */
#define SIGCPVIO 13 /* Coprocessor Protocol Violation (resd.) */
#define SIGFORMAT 14 /* Format Error (reserved) */
#define SIGUNINT 15 /* Uninitialized Interrupt (reserved) */
#define SIGSPURI 24 /* spurious interrupt */
#define SIGAUTO1 25 /* auto interrupt #1 */
#define SIGAUTO2 26 /* auto interrupt #2, Hblank */
#define SIGAUTO3 27 /* auto interrupt #3 */
#define SIGAUTO4 28 /* auto interrupt #4, Vblank */
#define SIGAUTO5 29 /* auto interrupt #5 */
#define SIGAUTO6 30 /* auto interrupt #6 */
#define SIGAUTO7 31 /* auto interrupt #7 */
#define SIGTRAP0 32 /* TRAP # 0 */
#define SIGTRAP1 33 /* TRAP # 1, GEMDOS */
#define SIGTRAP2 34 /* TRAP # 2, AES/VDI */
#define SIGTRAP3 35 /* TRAP # 3 */
#define SIGTRAP4 36 /* TRAP # 4 */
#define SIGTRAP5 37 /* TRAP # 5 */
#define SIGTRAP6 38 /* TRAP # 6 */
#define SIGTRAP7 39 /* TRAP # 7 */
#define SIGTRAP8 40 /* TRAP # 8 */
#define SIGTRAP9 41 /* TRAP # 9 */
#define SIGTRAP10 42 /* TRAP #10 */
#define SIGTRAP11 43 /* TRAP #11 */
#define SIGTRAP12 44 /* TRAP #12 */
#define SIGTRAP13 45 /* TRAP #13, BIOS */
#define SIGTRAP14 46 /* TRAP #14, XBIOS */
#define SIGTRAP15 47 /* TRAP #15 */
#define SIGFPU0 48 /* FPU Unordered Condition (reserved) */
#define SIGFPU1 49 /* FPU Inexact result (reserved) */
#define SIGFPU2 50 /* FPU Divide by zero (reserved) */
#define SIGFPU3 51 /* FPU Underflow (reserved) */
#define SIGFPU4 52 /* FPU Operand Error (reserved) */
#define SIGFPU5 53 /* FPU Overflow (reserved) */
#define SIGFPU6 54 /* FPU Signaling NaN (reserved) */
#define SIGMMU0 56 /* MMU Configuration Error (reserved) */
#define SIGMMU1 57 /* MMU (reserved) */
#define SIGMMU2 58 /* MMU (reserved) */
#define SIGMFP0 64 /* MFP 0, CENTRONICS (disabled) */
#define SIGMFP1 65 /* MFP 1, RS232 CD (disabled) */
#define SIGMFP2 66 /* MFP 2, RS232 CTS (disabled) */
#define SIGMFP3 67 /* MFP 3, Blitter (disabled) */
#define SIGMFP4 68 /* MFP 4, RS232 Baud Rate (disabled) */
#define SIGMFP5 69 /* MFP 5, 200Hz Clock (enabled) */
#define SIGMFP6 70 /* MFP 6, KEYBD, MIDI (enabled) */
#define SIGMFP7 71 /* MFP 7, FDC/HDC (disabled) */
#define SIGMFP8 72 /* MFP 8, Hsync (disabled) */
#define SIGMFP9 73 /* MFP 9, RS232 transmit error */
#define SIGMFP10 74 /* MFP 10, RS232 transmit buffer empty */
#define SIGMFP11 75 /* MFP 11, RS232 receive error */
#define SIGMFP12 76 /* MFP 12, RS232 receive buffer full */
#define SIGMFP13 77 /* MFP 13, Timer A (disabled) */
#define SIGMFP14 78 /* MFP 14, RS232 RI (disabled) */
#define SIGMFP15 79 /* MFP 15, Monitor (disabled) */
typedef void (*sigfunc_t)( int );
#define SIG_SYS (sigfunc_t)0L
#define SIG_DFL (sigfunc_t)-1L
#define SIG_IGN (sigfunc_t)-2L
#define SIG_ERR (sigfunc_t)-3L
sigfunc_t signal( int sig, sigfunc_t func );
int raise( int sig );
void signal_mode( int mode );
typedef int sig_atomic_t;
#endif
/************************************************************************/


View File

@@ -0,0 +1,27 @@
/* STDARG.H
Parameter List Definition Includes
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined(__STDARG)
#define __STDARG
typedef char *va_list;
#define va_start(ap, parmN) ((ap) = (char *)...)
#define va_arg(ap, type) \
((sizeof(type) == 1) ? \
(*(type *)((ap += 2) - 1)) : \
(*((type *)(ap))++))
#define va_end(ap) (void)0
#endif
/************************************************************************/


View File

@@ -0,0 +1,43 @@
/* (c) 1991-2008 by H. Robbers te Amsterdam
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#if ! __bool_true_false_are_defined /* always defined by AHCC itself */
typedef enum
{
false = 0,
true
} _Bool, bool;
# define __bool_true_false_are_defined 1
#elif __AHCC__
/* AHCC has builtin boolean constants 'false' and 'true'.
and basic boolean type _Bool (C99) */
typedef _Bool bool;
#endif
#if ! defined FALSE
# define FALSE false
# define TRUE true
#endif

View File

@@ -0,0 +1,30 @@
/* STDDEF.H
Standard Type Definition Includes
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __STDDEF )
#define __STDDEF
typedef unsigned long size_t;
#ifndef _COMPILER_H
typedef unsigned long __SIZE_TYPEDEF__;
#endif
typedef long ptrdiff_t;
#define _SIZE_T
#if __AHCC__
#define offsetof(type, ident) __offsetof__ type.ident
#else
#define offsetof(type,ident) ((size_t)&(((type *)0)->ident))
#endif
#ifndef NULL
#define NULL 0L
#endif
#endif

View File

@@ -0,0 +1,158 @@
/* STDIO.H
Standard I/O Definition Includes
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __STDIO )
#define __STDIO
#include <stdarg.h>
#if !defined( __STDDEF )
#include <stddef.h>
#endif
typedef unsigned long fpos_t;
typedef struct
{
void *BufPtr; /* next byte write */
void *BufLvl; /* next byte read */
void *BufStart; /* first byte of buffer */
void *BufEnd; /* first byte after buffer */
int Handle; /* gemdos handle */
char Flags; /* some Flags */
char resv;
char ChrBuf; /* little buffer */
char ungetFlag;
} FILE;
/****** FileIo constants ************************************************/
#ifndef NULL
#define NULL ((void *)0)
#endif
#define OPEN_MAX 32
#define FOPEN_MAX 32
#define FILENAME_MAX 128
#define PATH_MAX 128
#define BUFSIZ 1024
#define EOF (-1)
#define O_RDONLY 0x00
#define O_WRONLY 0x01
#define O_RDWR 0x02
#define O_APPEND 0x08
#define O_CREAT 0x20
#define O_TRUNC 0x40
#define O_EXCL 0x80
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#define TMP_MAX 65535
#define L_tmpnam 13
#define _IOFBF 0
#define _IOLBF 1
#define _IONBF 2
#define stdout (&_StdOutF)
#define stdin (&_StdInF)
#define stderr (&_StdErrF)
#define stdaux (&_StdAuxF)
#define stdprn (&_StdPrnF)
/****** External data **************************************************/
extern FILE _StdOutF;
extern FILE _StdInF;
extern FILE _StdErrF;
extern FILE _StdAuxF;
extern FILE _StdPrnF;
extern int errno;
extern char *sys_errlist[];
/****** FileIo routines *************************************************/
void clearerr( FILE *stream );
int fclose( FILE *stream );
int feof( FILE *stream );
int ferror( FILE *stream );
int fflush( FILE *stream );
int fgetc( FILE *stream );
int getc( FILE *stream );
int getchar( void );
int fgetpos( FILE *stream, fpos_t *pos );
char *fgets( char *str, int n, FILE *stream );
FILE *fopen( const char *filename, const char *mode );
int fprintf( FILE *stream, const char *format, ... );
int fputc( int ch, FILE *stream );
int putc( int ch, FILE *stream );
int putchar( int c );
int fputs( const char *str, FILE *stream );
size_t fread( void *buf, size_t elem_Siz, size_t count, FILE *stream );
FILE *freopen( const char *filename, const char *mode, FILE *stream );
int fscanf( FILE *stream, const char *format, ... );
int fseek( FILE *stream, long offset, int mode );
void rewind( FILE *stream);
int fsetpos( FILE *stream, const fpos_t *pos );
long ftell( FILE *stream );
size_t fwrite( const void *buf, size_t elem_Siz, size_t count,
FILE *stream );
char *gets( char *str );
void perror( char *s );
int printf( const char *format, ... );
int puts( const char *str );
int scanf( const char *format, ... );
void setbuf( FILE *stream, char *buf );
int setvbuf( FILE *stream, char *buf, int type, size_t size );
int sprintf( char *string, const char *format, ... );
int sscanf( const char *string, const char *format, ... );
char *tmpnam( char *s );
FILE *tmpfile( void );
int ungetc( int ch, FILE *stream );
int vfprintf( FILE *stream, const char *format, va_list param );
int vprintf( const char *format, va_list param );
int vsprintf( char *string, const char *format, va_list param );
int vfscanf( FILE *stream, const char *format, va_list param );
int vscanf( const char *format, va_list param );
int vsscanf( char *string, const char *format, va_list param );
int fileno( FILE *stream );
/****** FileIo macros ***************************************************/
#define getc( c ) fgetc( c )
#define getchar() fgetc( &_StdInF )
#define putc( c, s ) fputc( c, s )
#define putchar( c ) fputc( c, &_StdOutF )
#define fileno( s ) ( s )->Handle
/****** Handle level FileIo routines ***********************************/
int open( const char *filename, int access, ... );
int close( int handle );
int creat( const char *filename, ... );
size_t read( int handle, void *buf, size_t nbyte );
size_t write( int handle, void *buf, size_t nbyte );
size_t lseek( int handle, size_t offset, int mode );
int remove( const char *filename );
int unlink( const char *filename );
int rename( const char *oldname, const char *newname );
#endif
/***********************************************************************/


View File

@@ -0,0 +1,81 @@
/* STDLIB.H
Standard Library Includes
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __STDLIB )
#define __STDLIB
#if !defined( __STDDEF )
#include <stddef.h>
#endif
#define EXIT_FAILURE !0
#define EXIT_SUCCESS 0
#define RAND_MAX 32767
typedef struct
{
int quot;
int rem;
} div_t;
typedef struct
{
long quot;
long rem;
} ldiv_t;
#ifndef __NO_FLOAT__
double atof( const char *str );
char *ecvt( double d, int ndig, int *dec, int *sign );
char *fcvt( double d, int ndig, int *dec, int *sign );
char *gcvt( double value, int dec, char * buf );
double strtod( const char *s, char **endptr );
#endif
int atoi( const char *str );
long atol( const char *str );
char *itoa( int value, char *string, int radix );
char *ltoa( long value, char *string, int radix );
char *ultoa( unsigned long value, char *string, int radix );
void *malloc( size_t size );
void *lalloc( size_t size );
void *calloc( size_t elt_count, size_t elt_size );
void free( void *ptr );
void *realloc( void *ptr, size_t size );
int abs( int x );
long labs( long x );
div_t div( int n, int d );
ldiv_t ldiv( long n, long d );
int rand( void );
void srand( unsigned int seed );
#define random( x ) (rand() % (x))
int system( const char *command );
void exit( int status );
void abort( void );
int atexit( void (*func)( void ) );
char *getenv( const char *name );
void *bsearch( const void *key, const void *base,
size_t nmemb, size_t size,
int (*compar)() );
void qsort( void *base, size_t nmemb, size_t size,
int (*compar)() );
#endif
/************************************************************************/


View File

@@ -0,0 +1,68 @@
/* STRING.H
String Definitions
Copyright (C) Borland International 1990
All Rights Reserved.
*/
#if !defined( __STRING )
#define __STRING
#if !defined( __STDDEF )
#include <stddef.h>
#endif
char *strcat( char *s1, const char *s2 );
char *strncat( char *s1, const char *s2, size_t n );
int strcmp( const char *s1, const char *s2 );
int stricmp( const char *s1, const char *s2 );
int strcmpi( const char *s1, const char *s2 );
int strncmp( const char *s1, const char *s2, size_t n );
int strnicmp( const char *s1, const char *s2, size_t n );
int strncmpi( const char *s1, const char *s2, size_t n );
char *strcpy( char *s1, const char *s2 );
char *strncpy( char *s1, const char *s2, size_t n );
char *strdup( const char *s );
size_t strlen( const char *s );
char *strchr( const char *s, int c );
char *strrchr( const char *s, int c );
size_t strspn( const char *s, const char *set );
size_t strcspn( const char *s, const char *set );
char *strpbrk( const char *s, const char *set );
char *strstr( const char *src, const char *sub );
char *strtok( char *str, const char *set );
char *strupr( char *s );
char *strlwr( char *s );
char *strrev( char *s );
char *strset( char *s, int c );
char *strnset( char *s, int c, size_t n );
#ifndef __NO_FLOAT__
double strtod( const char *s, char **endptr );
#endif
long strtol( const char *str, char **ptr, int base );
unsigned long strtoul( const char *str, char **ptr, int base );
char *strerror( int errnum );
void *memchr( const void *ptr, int val, size_t len );
int memcmp( const void *ptr1, const void *ptr2, size_t len );
void *memcpy( void *dest, const void *src, size_t len );
void *memmove( void *dest, const void *src, size_t len );
void *memset( void *ptr, int val, size_t len );
#define zero(x) memset(&(x), 0, sizeof(x))
#define pzero(x) memset(x, 0, sizeof(*(x)))
#endif
/************************************************************************/


View File

@@ -0,0 +1,57 @@
/* Copyright (c) 2006 by H. Robbers.
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* STAT.H
*
* Useful subset of POSIX sys/stat.h functionality:
* http://pubs.opengroup.org/onlinepubs/007908799/xsh/sysstat.h.html
*/
#ifndef _SYS_STAT_H
#define _SYS_STAT_H
/* sys/types.h needs to be included before this as specified
* by stat()/fstat() manual page(s).
*/
#define S_IFCHR 0020000
#define S_IFDIR 0040000
#define S_IFREG 0100000
#define S_IEXEC 0000100
#define S_IREAD 0000400
#define S_IWRITE 0000200
struct stat
{
int st_dev;
int st_ino;
int st_mode;
int st_nlink;
int st_uid;
int st_gid;
int st_rdev;
size_t st_size;
long st_atime;
long st_mtime;
long st_ctime;
};
int fstat( int handle, struct stat *statbuf );
int stat( char *path, struct stat *buff );
#endif

View File

@@ -0,0 +1,34 @@
/* Copyright (c) 2006 by H. Robbers.
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* TYPES.H
*
* Dummy POSIX sys/types.h header for compatibility:
* http://pubs.opengroup.org/onlinepubs/007908799/xsh/systypes.h.html
*/
#ifndef _SYS_TYPES_H
#define _SYS_TYPES_H
/* sys/types.h typedefs types used by in POSIX stat struct, but
* as AHCC stat struct uses just ints & size_t, this is enough:
*/
#include <stddef.h>
#endif

View File

@@ -0,0 +1,65 @@
/* TIME.H
ANSI Time functions
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __TIME )
#define __TIME
#define CLK_TCK 200
#define CLOCKS_PER_SEC CLK_TCK
#if !defined( __STDDEF )
#include <stddef.h>
#endif
typedef long time_t;
typedef long _TIME_T;
typedef long clock_t;
#define _TIME_T
extern long timezone;
extern int daylight;
struct tm
{
int tm_sec; /* seconds after the minute -- [0, 59] */
int tm_min; /* minutes after the hour -- [0, 59] */
int tm_hour; /* hours since midnight -- [0, 23] */
int tm_mday; /* day of the month -- [1, 31] */
int tm_mon; /* months since January -- [0, 11] */
int tm_year; /* years since 1900 -- [ ] */
int tm_wday; /* day since Sunday -- [0, 6] */
int tm_yday; /* day since January 1 -- [0, 365] */
int tm_isdst; /* daylight saving time flag */
};
char *asctime( const struct tm *tblock );
char *ctime( const time_t *timer );
struct tm *gmtime( const time_t *clock );
struct tm *localtime( const time_t *clock );
time_t time( time_t *timer );
time_t mktime( struct tm *timeptr );
clock_t clock( void );
size_t strftime( char *s, size_t max_size, const char *format,
const struct tm *timeptr );
#ifndef __NO_FLOAT__
double difftime( time_t time2, time_t time1 );
#endif
#endif
/***********************************************************************/


View File

@@ -0,0 +1,667 @@
/* TOS.H
Tos Definition Includes
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __TOS )
#define __TOS
#include <trap.h> /* AHCC: __syscall__ */
typedef struct /* used by Cconrs */
{
unsigned char maxlen;
unsigned char actuallen;
char buffer[255];
} LINE;
typedef struct /* used by Fsetdta, Fgetdta */
{
char d_reserved[21];
unsigned char d_attrib;
unsigned int d_time;
unsigned int d_date;
unsigned long d_length;
char d_fname[14];
} DTA;
typedef struct /* used by Dfree */
{
unsigned long b_free;
unsigned long b_total;
unsigned long b_secsiz;
unsigned long b_clsiz;
} DISKINFO;
typedef struct baspag /* used by Pexec */
{
void *p_lowtpa;
void *p_hitpa;
void *p_tbase;
long p_tlen;
void *p_dbase;
long p_dlen;
void *p_bbase;
long p_blen;
DTA *p_dta;
struct baspag *p_parent;
long p_resrvd0;
char *p_env;
char p_stdfh[6];
char p_resrvd1;
char p_curdrv;
long p_resrvd2[18];
char p_cmdlin[128];
} BASPAG;
typedef struct /* used by Getbpb */
{
int recsiz;
int clsiz;
int clsizb;
int rdlen;
int fsiz;
int fatrec;
int datrec;
int numcl;
int bflags;
} BPB;
typedef struct
{
unsigned int time;
unsigned int date;
} DOSTIME;
typedef struct /* used by Iorec */
{
void *ibuf;
int ibufsiz;
int ibufhd;
int ibuftl;
int ibuflow;
int ibufhi;
} IOREC;
typedef struct /* used by Kbdvbase */
{
void (*kb_midivec)();
void (*kb_vkbderr)();
void (*kb_vmiderr)();
void (*kb_statvec)();
void (*kb_mousevec)();
void (*kb_clockvec)();
void (*kb_joyvec)();
void (*kb_midisys)();
void (*kb_kbdsys)();
} KBDVBASE;
typedef struct /* used by Pexec */
{
unsigned char length;
char command_tail[128];
} COMMAND;
typedef struct /* used by Initmouse */
{
char topmode;
char buttons;
char x_scale;
char y_scale;
int x_max;
int y_max;
int x_start;
int y_start;
} MOUSE;
typedef struct /* used by Prtblk */
{
void *pb_scrptr;
int pb_offset;
int pb_width;
int pb_height;
int pb_left;
int pb_right;
int pb_screz;
int pb_prrez;
void *pb_colptr;
int pb_prtype;
int pb_prport;
void *pb_mask;
} PBDEF;
typedef struct /* used by Keytbl */
{
char *unshift;
char *shift;
char *capslock;
} KEYTAB;
typedef struct __md
{
struct __md *m_link;
void *m_start;
long m_length;
BASPAG *m_own;
} MD;
typedef struct /* used by Getmpb */
{
MD *mp_mfl;
MD *mp_mal;
MD *mp_rover;
} MPB;
typedef struct
{
int (*Bconstat) ();
long (*Bconin) ();
int (*Bcostat) ();
void (*Bconout) ();
long (*Rsconf) ();
IOREC *iorec;
} MAPTAB;
typedef struct
{
MAPTAB *maptab;
int maptabsize;
} BCONMAP;
/* system variable _sysbase (0x4F2L) points to next structure */
typedef struct _syshdr
{
unsigned os_entry; /* $00 BRA to reset handler */
unsigned os_version; /* $02 TOS version number */
void *os_start; /* $04 -> reset handler */
struct _syshdr *os_base; /* $08 -> baseof OS */
void *os_membot; /* $0c -> end BIOS/GEMDOS/VDI ram usage */
void *os_rsv1; /* $10 << unused,reserved >> */
long *os_magic; /* $14 -> GEM memoryusage parm. block */
long os_gendat; /* $18 Date of system build($MMDDYYYY) */
int os_palmode; /* $1c OS configuration bits */
int os_gendatg; /* $1e DOS-format date of systembuild */
/*
The next three fields are only available in TOS versions 1.2 and
greater
*/
void *_root; /* $20 -> base of OS pool */
long *kbshift; /* $24 -> keyboard shift state variable */
BASPAG **_run; /* $28 -> GEMDOS PID of current process */
void *p_rsv2; /* $2c << unused, reserved >> */
} SYSHDR;
/* attributes for Fcreate/Fsfirst/Fsnext: */
#define FA_READONLY 0x01
#define FA_HIDDEN 0x02
#define FA_SYSTEM 0x04
#define FA_VOLUME 0x08
#define FA_SUBDIR 0x10
#define FA_ARCHIVE 0x20
/* Fopen modes: */
#define FO_READ 0
#define FO_WRITE 1
#define FO_RW 2
extern BASPAG *_BasPag;
extern unsigned long _PgmSize;
long TRAP( 1) gemdos( void, ... );
long TRAP(13) bios ( void, ... );
long TRAP(14) xbios ( void, ... );
/****** Tos *************************************************************/
void GEMDOS(0) Pterm0( void );
long GEMDOS(1) Cconin( void );
void GEMDOS(2) Cconout( int c );
int GEMDOS(3) Cauxin( void );
void GEMDOS(4) Cauxout( int c );
int GEMDOS(5) Cprnout( int c );
long GEMDOS(6) Crawio( int w );
long GEMDOS(7) Crawcin( void );
long GEMDOS(8) Cnecin( void );
int GEMDOS(9) Cconws( const char *buf );
void GEMDOS(10) Cconrs( LINE *buf );
int GEMDOS(11) Cconis( void );
long GEMDOS(14) Dsetdrv( int drv );
int GEMDOS(16) Cconos( void );
int GEMDOS(17) Cprnos( void );
int GEMDOS(18) Cauxis( void );
int GEMDOS(19) Cauxos( void );
int GEMDOS(25) Dgetdrv( void );
void GEMDOS(26) Fsetdta( DTA *buf );
long GEMDOS(32) Super( void *stack );
unsigned int GEMDOS(42) Tgetdate( void );
unsigned int GEMDOS(43) Tsetdate( unsigned int date );
unsigned int GEMDOS(44) Tgettime( void );
unsigned int GEMDOS(45) Tsettime( unsigned int time );
DTA * GEMDOS(47) Fgetdta( void );
int GEMDOS(48) Sversion( void );
void GEMDOS(49) Ptermres( long keepcnt, int retcode );
int GEMDOS(54) Dfree( DISKINFO *buf, int driveno );
int GEMDOS(57) Dcreate( const char *path );
int GEMDOS(58) Ddelete( const char *path );
int GEMDOS(59) Dsetpath( const char *path );
long GEMDOS(60) Fcreate( const char *filename, int attr );
long GEMDOS(61) Fopen( const char *filename, int mo );
int GEMDOS(62) Fclose( int handle );
long GEMDOS(63) Fread( int handle, long count, void *buf );
long GEMDOS(64) Fwrite( int handle, long count, void *buf );
int GEMDOS(65) Fdelete( const char *filename );
long GEMDOS(66) Fseek( long offset, int handle, int seekmode );
int GEMDOS(67) Fattrib( const char *filename, int wflag, int attrib );
long GEMDOS(69) Fdup( int handle );
int GEMDOS(70) Fforce( int stch, int nonstdh );
int GEMDOS(71) Dgetpath( char *path, int driveno );
void * GEMDOS(72) Malloc( long number );
int GEMDOS(73) Mfree( void *block );
int GEMDOS(74) Mshrink( int zero, void *block, long newsiz );
long GEMDOS(75) Pexec( int mo, char *ptr1, void *ptr2, void *ptr3 );
void GEMDOS(76) Pterm( int retcode );
int GEMDOS(78) Fsfirst( const char *filename, int attr );
int GEMDOS(79) Fsnext( void );
int GEMDOS(86) Frename( int zero, const char *oldname, const char *newname );
int GEMDOS(87) Fdatime( DOSTIME *timeptr, int handle, int wflag );
int GEMDOS(0x119) Pdomain( int newdom );
void * GEMDOS(0x112) Psignal( int sig, void *handler );
/****** TOS 030 Gemdos Extension ****************************************/
void * GEMDOS(68) Mxalloc( long number, int mo );
long GEMDOS(20) Maddalt( void *start, long size );
/****** Network Gemdos Extension ****************************************/
long GEMDOS(92) Flock( int handle, int mo, long start, long length );
/****** Bios ************************************************************/
void BIOS( 0) Getmpb( MPB *ptr );
int BIOS( 1) Bconstat( int dev );
long BIOS( 2) Bconin( int dev );
long BIOS( 3) Bconout( int dev, int c );
long BIOS( 4) Rwabs( int rwflag, void *buf, int cnt, int recnr, int dev );
void (* BIOS(5) Setexc( int number, void (*exchdlr)() )) ();
long BIOS( 6) Tickcal( void );
BPB * BIOS( 7) Getbpb( int dev );
long BIOS( 8) Bcostat( int dev );
long BIOS( 9) Mediach( int dev );
long BIOS(10) Drvmap( void );
long BIOS(11) Kbshift( int mo );
long BIOS(12) Lrwabs( int rwflag, void *buf, int cnt, int recnr, int dev );
/****** XBios ***********************************************************/
void XBIOS(0) Initmouse( int type, MOUSE *par, void (*mousevec)() );
void * XBIOS(1) Ssbrk( int count );
void * XBIOS(2) Physbase( void );
void * XBIOS(3) Logbase( void );
int XBIOS(4) Getrez( void );
void XBIOS(5) Setscreen( void *laddr, void *paddr, int rez );
void XBIOS(6) Setpalette( void *pallptr );
int XBIOS(7) Setcolor( int colornum, int color );
int XBIOS(8) Floprd( void *buf, void *filler, int devno, int sectno,
int trackno, int sideno, int count );
int XBIOS(9) Flopwr( void *buf, void *filler, int devno, int sectno,
int trackno, int sideno, int count );
int XBIOS(10) Flopfmt( void *buf, void *filler, int devno, int spt, int trackno,
int sideno, int interlv, long magic, int virgin );
void XBIOS(12) Midiws( int cnt, void *ptr );
void XBIOS(13) Mfpint( int erno, void (*vector)() );
IOREC * XBIOS(14) Iorec( int dev );
long XBIOS(15) Rsconf( int baud, int ctr, int ucr, int rsr, int tsr, int scr );
KEYTAB *XBIOS(16) Keytbl( void *unshift, void *shift, void *capslock );
long XBIOS(17) Random( void );
void XBIOS(18) Protobt( void *buf, long serialno, int disktype, int execflag );
int XBIOS(19) Flopver( void *buf, void *filler, int devno, int sectno,
int trackno, int sideno, int count );
void XBIOS(20) Scrdmp( void );
int XBIOS(21) Cursconf( int func, int rate );
void XBIOS(22) Settime( unsigned long time );
unsigned
long XBIOS(23) Gettime( void );
void XBIOS(24) Bioskeys( void );
void XBIOS(25) Ikbdws( int count, void *ptr );
void XBIOS(26) Jdisint( int number );
void XBIOS(27) Jenabint( int number );
char XBIOS(28) Giaccess( char data, int regno );
void XBIOS(29) Offgibit( int bitno );
void XBIOS(30) Ongibit( int bitno );
void XBIOS(31) Xbtimer( int timer, int control, int data, void (*vector)() );
void * XBIOS(32) Dosound( void *buf );
int XBIOS(33) Setprt( int config );
KBDVBASE * XBIOS(34)Kbdvbase( void );
int XBIOS(35) Kbrate( int initial, int repeat );
void XBIOS(36) Prtblk( PBDEF *par );
void XBIOS(37) Vsync( void );
typedef long Supfunc(void);
long XBIOS(38) Supexec( Supfunc * );
void XBIOS(39) Puntaes( void );
int XBIOS(41) Floprate( int devno, int newrate );
int XBIOS(64) Blitmode( int mo );
/* TOS030 XBios */
int XBIOS(42) DMAread( long sector, int count, void *buffer, int devno );
int XBIOS(43) DMAwrite( long sector, int count, void *buffer, int devno );
long XBIOS(44) Bconmap( int devno );
int XBIOS(46) NVMaccess( int opcode, int start, int count, void *buffer );
int XBIOS(80) Esetshift( int shftMode );
int XBIOS(81) Egetshift( void );
int XBIOS(82) EsetBank( int bankNum );
int XBIOS(83) EsetColor( int colorNum, int color );
void XBIOS(84) EsetPalette( int colorNum, int count, int *palettePtr );
void XBIOS(85) EgetPalette( int colorNum, int count, int *palettePtr );
int XBIOS(86) EsetGray( int swtch );
int XBIOS(87) EsetSmear( int swtch );
#if !defined( __SIGNAL__ )
#define __SIGNAL__
/* signal handling */
#define NSIG 31 /* number of signals recognized */
#define SIGNULL 0 /* not really a signal */
#define SIGHUP 1 /* hangup signal */
#define SIGINT 2 /* sent by ^C */
#define SIGQUIT 3 /* quit signal */
#define SIGILL 4 /* illegal instruction */
#define SIGTRAP 5 /* trace trap */
#define SIGABRT 6 /* abort signal */
#define SIGPRIV 7 /* privilege violation */
#define SIGFPE 8 /* divide by zero */
#define SIGKILL 9 /* cannot be ignored */
#define SIGBUS 10 /* bus error */
#define SIGSEGV 11 /* illegal memory reference */
#define SIGSYS 12 /* bad argument to a system call */
#define SIGPIPE 13 /* broken pipe */
#define SIGALRM 14 /* alarm clock */
#define SIGTERM 15 /* software termination signal */
#define SIGURG 16 /* urgent condition on I/O channel */
#define SIGSTOP 17 /* stop signal not from terminal */
#define SIGTSTP 18 /* stop signal from terminal */
#define SIGCONT 19 /* continue stopped process */
#define SIGCHLD 20 /* child stopped or exited */
#define SIGTTIN 21 /* read by background process */
#define SIGTTOU 22 /* write by background process */
#define SIGIO 23 /* I/O possible on a descriptor */
#define SIGXCPU 24 /* CPU time exhausted */
#define SIGXFSZ 25 /* file size limited exceeded */
#define SIGVTALRM 26 /* virtual timer alarm */
#define SIGPROF 27 /* profiling timer expired */
#define SIGWINCH 28 /* window size changed */
#define SIGUSR1 29 /* user signal 1 */
#define SIGUSR2 30 /* user signal 2 */
#define SIG_DFL 0 /* default signal handler */
#define SIG_IGN 1 /* ignore the signal */
#endif
#ifndef S_IFMT
/* file types (Could be already in mint.h) */
#define S_IFMT 0170000 /* mask to select file type */
#define S_IFCHR 0020000 /* BIOS special file */
#define S_IFDIR 0040000 /* directory file */
#define S_IFREG 0100000 /* regular file */
#define S_IFIFO 0120000 /* FIFO */
#define S_IMEM 0140000 /* memory region or process */
#define S_IFLNK 0160000 /* symbolic link */
/* special bits: setuid, setgid, sticky bit */
#define S_ISUID 0004000
#define S_ISGID 0002000
#define S_ISVTX 0001000
/* file access modes for user, group, and other*/
#define S_IRUSR 0000400
#define S_IWUSR 0000200
#define S_IXUSR 0000100
#define S_IRGRP 0000040
#define S_IWGRP 0000020
#define S_IXGRP 0000010
#define S_IROTH 0000004
#define S_IWOTH 0000002
#define S_IXOTH 0000001
#define DEFAULT_DIRMODE (0777)
#if 0
#define DEFAULT_MODE (0666)
#endif
typedef struct
{
long msg1;
long msg2;
int pid;
} MSG;
typedef struct
{
unsigned int mode;
long index;
unsigned int dev;
unsigned int reserved1;
unsigned int nlink;
unsigned int uid;
unsigned int gid;
long size;
long blksize;
long nblocks;
int mtime;
int mdate;
int atime;
int adate;
int ctime;
int cdate;
int attr;
int reserved2;
long reserved3[2];
} XATTR;
#define SA_NOCLDSTOP 1
typedef struct
{
void (*sa_handler)( long sig );
long sa_mask;
int sa_flags;
} SIGACTION;
typedef struct
{
long msg1;
long msg2;
int pid;
} __MSG;
#endif /* S_IFMT */
int GEMDOS(0xff) Syield( void );
int GEMDOS(0x100) Fpipe( int *usrh );
int GEMDOS(0x104) Fcntl( int f, long arg, int cmd );
long GEMDOS(0x105) Finstat( int f );
long GEMDOS(0x106) Foutstat( int f );
long GEMDOS(0x107) Fgetchar( int f, int mo );
long GEMDOS(0x108) Fputchar( int f, long c, int mo );
long GEMDOS(0x109) Pwait( void );
int GEMDOS(0x10a) Pnice( int delta );
int GEMDOS(0x10b) Pgetpid( void );
int GEMDOS(0x10c) Pgetppid( void );
int GEMDOS(0x10d) Pgetpgrp( void );
int GEMDOS(0x10e) Psetpgrp( int pid, int newgrp );
int GEMDOS(0x10f) Pgetuid( void );
int GEMDOS(0x110) Psetuid( int id );
int GEMDOS(0x111) Pkill( int pid, int sig );
int GEMDOS(0x113) Pvfork( void );
int GEMDOS(0x114) Pgetgid( void );
int GEMDOS(0x115) Psetgid( int id );
long GEMDOS(0x116) Psigblock( long mask );
long GEMDOS(0x117) Psigsetmask( long mask );
long GEMDOS(0x118) Pusrval( long arg );
void GEMDOS(0x11a) Psigreturn( void );
int GEMDOS(0x11b) Pfork( void );
long GEMDOS(0x11c) Pwait3( int flag, long *rusage );
int GEMDOS(0x11d) Fselect( unsigned int timeout, long *rfds, long *wfds, long *xfds );
void GEMDOS(0x11e) Prusage( long *r );
long GEMDOS(0x11f) Psetlimit( int lim, long value );
long GEMDOS(0x120) Talarm( long secs );
void GEMDOS(0x121) Pause( void );
long GEMDOS(0x122) Sysconf( int n );
long GEMDOS(0x123) Psigpending( void );
long GEMDOS(0x124) Dpathconf( char *name, int n );
long GEMDOS(0x125) Pmsg( int mo, long mbox, __MSG *msg );
long GEMDOS(0x126) Fmidipipe( int pid, int in, int out );
int GEMDOS(0x127) Prenice( int pid, int delta );
long GEMDOS(0x128) Dopendir( const char *name, int flag );
long GEMDOS(0x129) Dreaddir( int buflen, long dir, char *buf );
long GEMDOS(0x12a) Drewinddir( long dir );
long GEMDOS(0x12b) Dclosedir( long dir );
long GEMDOS(0x12c) Fxattr( int flag, const char *name, XATTR *buf );
long GEMDOS(0x12d) Flink( char *oldname, char *newname );
long GEMDOS(0x12e) Fsymlink( char *oldname, char *newname );
long GEMDOS(0x12f) Freadlink( int size, char *buf, char *name );
long GEMDOS(0x130) Dcntl( int cmd, char *name, long arg );
long GEMDOS(0x131) Fchown( char *name, int uid, int gid );
long GEMDOS(0x132) Fchmod( char *name, int mo );
long GEMDOS(0x133) Pumask( unsigned int mo );
long GEMDOS(0x134) Psemaphore( int mo, long id, long timeout );
long GEMDOS(0x135) Dlock( int mo, int drive );
void GEMDOS(0x136) Psigpause( unsigned long mask );
long GEMDOS(0x137) Psigaction( int sig, SIGACTION *act, SIGACTION *oact );
int GEMDOS(0x138) Pgeteuid( void );
int GEMDOS(0x139) Pgetegid( void );
long GEMDOS(0x13b) Dgetcwd( char *path, int drv, int size );
long GEMDOS(0x13a) Pwaitpid( int pid, int flag, long *rusage );
long GEMDOS(0x13c) Salert(char *msg);
/* Falcon */
#define VERTFLAG 0x0100
#define STMODES 0x0080
#define OVERSCAN 0x0040
#define PAL 0x0020
#define VGA_FALCON 0x0010
#define TV 0x0000
#define COL80 0x08
#define COL40 0x00
#define BPS16 4
#define BPS8 3
#define BPS4 2
#define BPS2 1
#define BPS1 0
#define NUMCOLS 7
typedef struct
{
int blocktype;
long blocksize;
void *blockaddr;
} DSPBLOCK;
void XBIOS( 5) VsetScreen( void *log, void *phys, int mode, int modecode);
int XBIOS( 88) Vsetmode( int modecode );
int XBIOS( 89) mon_type( void );
int XBIOS( 89) VgetMonitor( void );
void XBIOS( 90) VsetSync( int flag );
long XBIOS( 91) VgetSize( int mode );
void XBIOS( 92) VsetMask( int ormask, int andmask, int overlay );
void XBIOS( 93) VsetRGB( int index, int count, long *array );
void XBIOS( 94) VgetRGB( int index, int count, long *array );
int XBIOS( 95) VcheckMode( int modecode );
int XBIOS( 95) ValidMode( int modecode );
void XBIOS( 96) Dsp_DoBlock( char *data_in, long size_in, char *data_out,
long size_out );
void XBIOS( 97) Dsp_BlkHandShake( char *data_in, long size_in, char *data_out,
long size_out );
void XBIOS( 98) Dsp_BlkUnpacked( long *data_in, long size_in, long *data_out,
long size_out );
void XBIOS( 99) Dsp_InStream( char *data_in, long block_size, long num_blocks,
long *blocks_done );
void XBIOS(100) Dsp_OutStream( char *data_out, long block_size, long num_blocks,
long *blocks_done );
void XBIOS(101) Dsp_IOStream( char *data_in, char *data_out, long block_insize,
long block_outsize, long num_blocks,
long *blocks_done );
void XBIOS(102) Dsp_RemoveInterrupts( int mask );
int XBIOS(103) Dsp_GetWordSize( void );
int XBIOS(104) Dsp_Lock( void );
void XBIOS(105) Dsp_Unlock( void );
void XBIOS(106) Dsp_Available( long *xavailable, long *yavailable );
int XBIOS(107) Dsp_Reserve( long xreserve, long yreserve );
int XBIOS(108) Dsp_LoadProg( char *file, int ability, char *buffer );
void XBIOS(109) Dsp_ExecProg( char *codeptr, long codesize, int ability );
void XBIOS(110) Dsp_ExecBoot( char *codeptr, long codesize, int ability );
long XBIOS(111) Dsp_LodToBinary( char *file, char *codeptr );
void XBIOS(112) Dsp_TriggerHC( int vector );
int XBIOS(113) Dsp_RequestUniqueAbility( void );
int XBIOS(114) Dsp_GetProgAbility( void );
void XBIOS(115) Dsp_FlushSubroutines( void );
int XBIOS(116) Dsp_LoadSubroutine( char *codeptr, long codesize, int ability );
int XBIOS(117) Dsp_InqSubrAbility( int ability );
int XBIOS(118) Dsp_RunSubroutine( int handle );
int XBIOS(119) Dsp_Hf0( int flag );
int XBIOS(120) Dsp_Hf1( int flag );
int XBIOS(121) Dsp_Hf2( void );
int XBIOS(122) Dsp_Hf3( void );
void XBIOS(123) Dsp_BlkWords( void *data_in, long size_in, void *data_out,
long size_out );
void XBIOS(124) Dsp_BlkBytes( void *data_in, long size_in, void *data_out,
long size_out );
char XBIOS(125) Dsp_HStat( void );
void XBIOS(126) Dsp_SetVectors( void (*receiver)( ), long (*transmitter)( ));
void XBIOS(127) Dsp_MultBlocks( long numsend, long numreceive,
DSPBLOCK *sendblocks, DSPBLOCK *receiveblocks );
long XBIOS(128) locksnd( void );
long XBIOS(129) unlocksnd( void );
long XBIOS(130) soundcmd( int mode, int data );
long XBIOS(131) setbuffer( int reg, void *begaddr, void *endaddr );
long XBIOS(132) setmode( int mode );
long XBIOS(133) settracks( int playtracks, int rectracks );
long XBIOS(134) setmontracks( int montrack );
long XBIOS(135) setinterrupt( int src_inter, int cause );
long XBIOS(136) buffoper( int mode );
long XBIOS(137) dsptristate( int dspxmit, int dsprec );
long XBIOS(138) gpio( int mode, int data );
long XBIOS(139) devconnect( int src, int dst, int srcclk, int prescale,
int protocol );
long XBIOS(140) sndstatus( int reset );
long XBIOS(141) buffptr( long *ptr );
/* XBIOS(150) VsetVars ( ?????? ); */
int XBIOS(165) WavePlay( int flags, long rate, void *sptr, long slen );
#endif
/************************************************************************/

View File

@@ -0,0 +1,16 @@
#ifndef TOS_GEM_H
#define TOS_GEM_H
#ifndef __TOS
#include <tos.h>
#endif
#ifndef __AES__
#include <np_aes.h>
#endif
#ifndef __VDI__
#include <np_vdi.h>
#endif
#endif

View File

View File

@@ -0,0 +1,28 @@
/* Copyright (c) 2006 by H. Robbers.
*
* This file is part of AHCC.
*
* AHCC is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* AHCC is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AHCC; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _UNISTD_H
#define _UNISTD_H
char *getcwd( char *buffer, int bufflen );
void sleep( unsigned int seconds );
int chdir( char *filename );
int isatty( int handle );
#endif

View File

@@ -0,0 +1,122 @@
/* AV-Protokoll, erweiterte Definition vom 26.06.1995
Genaue Beschreibung der Messages in der Dokumentation
zu Thing (THING.HYP ab Version 0.54) */
#ifndef __vaproto__
#define __vaproto__
#define VAPRO 1
/* AES-Messages */
typedef enum
{
AV_PROTOKOLL = 0x4700,
VA_PROTOSTATUS = 0x4701,
AV_GETSTATUS = 0x4703,
AV_STATUS = 0x4704,
VA_SETSTATUS = 0x4705,
AV_SENDKEY = 0x4710,
VA_START = 0x4711,
AV_ASKFILEFONT = 0x4712,
VA_FILEFONT = 0x4713,
AV_ASKCONFONT = 0x4714,
VA_CONFONT = 0x4715,
AV_ASKOBJECT = 0x4716,
VA_OBJECT = 0x4717,
AV_OPENCONSOLE = 0x4718,
VA_CONSOLEOPEN = 0x4719,
AV_OPENWIND = 0x4720,
VA_WINDOPEN = 0x4721,
AV_STARTPROG = 0x4722,
VA_PROGSTART = 0x4723,
AV_ACCWINDOPEN = 0x4724,
VA_DRAGACCWIND = 0x4725,
AV_ACCWINDCLOSED = 0x4726,
AV_COPY_DRAGGED = 0x4728,
VA_COPY_COMPLETE = 0x4729,
AV_PATH_UPDATE = 0x4730,
AV_WHAT_IZIT = 0x4732,
VA_THAT_IZIT = 0x4733,
AV_DRAG_ON_WINDOW = 0x4734,
VA_DRAG_COMPLETE = 0x4735,
AV_EXIT = 0x4736,
AV_STARTED = 0x4738,
VA_FONTCHANGED = 0x4739,
AV_XWIND = 0x4740,
VA_XOPEN = 0x4741,
/* Neue Messages seit dem 26.06.1995 */
AV_VIEW = 0x4751,
VA_VIEWED = 0x4752,
AV_FILEINFO = 0x4753,
VA_FILECHANGED = 0x4754,
AV_COPYFILE = 0x4755,
VA_FILECOPIED = 0x4756,
AV_DELFILE = 0x4757,
VA_FILEDELETED = 0x4758,
AV_SETWINDPOS = 0x4759,
VA_PATH_UPDATE = 0x4760,
VA_HIGH /* HR please always do this! */
} AV_VA;
/* Objekttypen f<>r VA_THAT_IZIT */
enum
{
VA_OB_UNKNOWN,
VA_OB_TRASHCAN,
VA_OB_SHREDDER,
VA_OB_CLIPBOARD,
VA_OB_FILE,
VA_OB_FOLDER,
VA_OB_DRIVE,
VA_OB_WINDOW,
VA_OB_NOTEPAD,
VA_OB_NOTE
};
typedef enum
{
VV_SETSTATUS = 0x0001,
VV_START = 0x0002,
VV_STARTED = 0x0004,
VV_FONTCHANGED = 0x0008,
VV_ACC_QUOTING = 0x0010,
VV_PATH_UPDATE = 0x0020
} av_va_give;
typedef enum
{ /* mp[3]: */
AA_SENDKEY = 0x0001, /* b0: MAGXDESK, THING */
AA_ASKFILEFONT = 0x0002, /* b1: THING */
AA_ASKCONFONT = 0x0004, /* b2: THING */
AA_ASKOBJECT = 0x0008,
AA_OPENWIND = 0x0010, /* b4: MAGXDESK, THING */
AA_STARTPROG = 0x0020, /* b5: MAGXDESK, THING */
AA_ACCWIND = 0x0040, /* b6: THING */
AA_STATUS = 0x0080, /* b7: THING */
AA_COPY_DRAGGED= 0x0100, /* b8: THING */
AA_DRAG_ON_WINDOW=0x0200, /* b9: MAGXDESK, THING */
AA_EXIT = 0x0400, /* b10: MAGXDESK, THING */
AA_XWIND = 0x0800, /* b11: MAGXDESK, THING */
AA_FONTCHANGED = 0x1000, /* b2: THING */
AA_STARTED = 0x2000, /* b13: MAGXDESK, THING */
AA_SRV_QUOTING = 0x4000, /* b14: THING */
AA_FILE = 0x8000, /* b15: THING */
/* mp[4]: THING */
AA_COPY = 0x0001,
AA_DELETE = 0x0002,
AA_VIEW = 0x0004,
AA_SETWINDPOS = 0x0008,
AA_COPYFILELINH= 0x0010,
AA_SENDCLICK = 0x0020
} av_va_have;
/* Makros zum Testen auf Quoting */
#define VA_ACC_QUOTING(a) ((a) & VV_ACC_QUOTING)
#define VA_SERVER_QUOTING(a) ((a) & AA_SRV_QUOTING)
#endif

View File

@@ -0,0 +1,380 @@
/* VDI.H
GEM VDI Definitions
Copyright (c) Borland International 1990
All Rights Reserved.
*/
#if !defined( __VDI__ )
#define __VDI__
typedef struct
{
int contrl[15];
int intin[132];
int intout[140];
int ptsin[145];
int ptsout[145];
} VDIPARBLK;
typedef struct
{
int *contrl;
int *intin;
int *ptsin;
int *intout;
int *ptsout;
} VDIPB;
extern VDIPARBLK _VDIParBlk;
void vdi( VDIPB *vdipb );
/****** Control definitions *********************************************/
void v_opnwk( int *work_in, int *handle, int *work_out);
void v_clswk( int handle );
void v_opnvwk( int *work_in, int *handle, int *work_out);
void v_clsvwk( int handle );
void v_clrwk( int handle );
void v_updwk( int handle );
int vst_load_fonts( int handle, int select );
void vst_unload_fonts( int handle, int select );
void vs_clip( int handle, int clip_flag, int *pxyarray );
/****** Output definitions **********************************************/
void v_pline( int handle, int count, int *pxyarray );
void v_pmarker( int handle, int count, int *pxyarray );
void v_gtext( int handle, int x, int y, char *string );
void v_fillarea( int handle, int count, int *pxyarray );
void v_cellarray( int handle, int *pxyarray, int row_length,
int el_used, int num_rows, int wrt_mode,
int *colarray );
void v_contourfill( int handle, int x, int y, int index );
void vr_recfl( int handle, int *pxyarray );
void v_bar( int handle, int *pxyarray );
void v_arc( int handle, int x, int y, int radius,
int begang, int endang );
void v_pieslice( int handle, int x, int y, int radius,
int begang, int endang );
void v_circle( int handle, int x, int y, int radius );
void v_ellarc( int handle, int x, int y, int xradius,
int yradius, int begang, int endang );
void v_ellpie( int handle, int x, int y, int xradius,
int yradius, int begang, int endang );
void v_ellipse( int handle, int x, int y, int xradius,
int yradius );
void v_rbox ( int handle, int *pxyarray );
void v_rfbox ( int handle, int *pxyarray );
void v_justified( int handle,int x, int y, char *string,
int length, int word_space,
int char_space );
/****** Attribute definitions *****************************************/
#define IP_HOLLOW 0
#define IP_1PATT 1
#define IP_2PATT 2
#define IP_3PATT 3
#define IP_4PATT 4
#define IP_5PATT 5
#define IP_6PATT 6
#define IP_SOLID 7
/* gsx modes */
#define MD_REPLACE 1
#define MD_TRANS 2
#define MD_XOR 3
#define MD_ERASE 4
/* gsx styles */
#define FIS_HOLLOW 0
#define FIS_SOLID 1
#define FIS_PATTERN 2
#define FIS_HATCH 3
#define FIS_USER 4
/* bit blt rules */
#define ALL_WHITE 0
#define S_AND_D 1
#define S_AND_NOTD 2
#define S_ONLY 3
#define NOTS_AND_D 4
#define D_ONLY 5
#define S_XOR_D 6
#define S_OR_D 7
#define NOT_SORD 8
#define NOT_SXORD 9
#define D_INVERT 10
#define NOT_D 11
#define S_OR_NOTD 12
#define NOT_S 12 /* BigLife */
#define NOTS_OR_D 13
#define NOT_SANDD 14
#define ALL_BLACK 15
/* linetypes */
#define SOLID 1
#define LONGDASH 2
#define DOT 3
#define DASHDOT 4
#define DASH 5
#define DASH2DOT 6
#define USERLINE 7
#define SQUARE 0
#define ARROWED 1
#define ROUND 2
int vswr_mode( int handle, int mode );
void vs_color( int handle, int index, int *rgb_in );
int vsl_type( int handle, int style );
void vsl_udsty( int handle, int pattern );
int vsl_width( int handle, int width );
int vsl_color( int handle, int color_index );
void vsl_ends( int handle, int beg_style, int end_style );
int vsm_type( int handle, int symbol );
int vsm_height( int handle, int height );
int vsm_color( int handle, int color_index );
void vst_height( int handle, int height, int *char_width,
int *char_height, int *cell_width,
int *cell_height );
int vst_point( int handle, int point, int *char_width,
int *char_height, int *cell_width,
int *cell_height );
int vst_rotation( int handle, int angle );
int vst_font( int handle, int font );
int vst_color( int handle, int color_index );
int vst_effects( int handle, int effect );
void vst_alignment( int handle, int hor_in, int vert_in,
int *hor_out, int *vert_out );
int vsf_interior( int handle, int style );
int vsf_style( int handle, int style_index );
int vsf_color( int handle, int color_index );
int vsf_perimeter( int handle, int per_vis );
void vsf_udpat( int handle, int *pfill_pat, int planes );
/****** Raster definitions *********************************************/
typedef struct
{
void *fd_addr;
int fd_w;
int fd_h;
int fd_wdwidth;
int fd_stand;
int fd_nplanes;
int fd_r1;
int fd_r2;
int fd_r3;
} MFDB;
void vro_cpyfm( int handle, int vr_mode, int *pxyarray,
MFDB *psrcMFDB, MFDB *pdesMFDB );
void vrt_cpyfm( int handle, int vr_mode, int *pxyarray,
MFDB *psrcMFDB, MFDB *pdesMFDB,
int *color_index );
void vr_trnfm( int handle, MFDB *psrcMFDB, MFDB *pdesMFDB );
void v_get_pixel( int handle, int x, int y, int *pel,
int *index );
/****** Input definitions **********************************************/
void vsin_mode( int handle, int dev_type, int mode );
void vrq_locator( int handle, int x, int y, int *xout,
int *yout, int *term );
int vsm_locator( int handle, int x, int y, int *xout,
int *yout, int *term );
void vrq_valuator( int handle, int valuator_in,
int *valuator_out, int *terminator );
void vsm_valuator( int handle, int val_in, int *val_out,
int *term, int *status );
void vrq_choice( int handle, int ch_in, int *ch_out );
int vsm_choice( int handle, int *choice );
void vrq_string( int handle, int max_length, int echo_mode,
int *echo_xy, char *string );
int vsm_string( int handle, int max_length, int echo_mode,
int *echo_xy, char *string );
void vsc_form( int handle, int *pcur_form );
void vex_timv( int handle, int (*tim_addr)(), int (**otim_addr)(),
int *tim_conv );
void v_show_c( int handle, int reset );
void v_hide_c( int handle );
void vq_mouse( int handle, int *pstatus, int *x, int *y );
void vex_butv( int handle, int (*pusrcode)(), int (**psavcode)() );
void vex_motv( int handle, int (*pusrcode)(), int (**psavcode)() );
void vex_curv( int handle, int (*pusrcode)(), int (**psavcode)() );
void vq_key_s( int handle, int *pstatus );
/****** Inquire definitions *******************************************/
void vq_extnd( int handle, int owflag, int *work_out );
int vq_color( int handle, int color_index,
int set_flag, int *rgb );
void vql_attributes( int handle, int *attrib );
void vqm_attributes( int handle, int *attrib );
void vqf_attributes( int handle, int *attrib );
void vqt_attributes( int handle, int *attrib );
void vqt_extent( int handle, char *string, int *extent );
int vqt_width( int handle, int character,
int *cell_width, int *left_delta,
int *right_delta );
int vqt_name( int handle, int element_num, char *name );
void vq_cellarray( int handle, int *pxyarray,
int row_length, int num_rows,
int *el_used, int *rows_used,
int *status, int *colarray );
void vqin_mode( int handle, int dew_type, int *input_mode );
void vqt_fontinfo( int handle, int *minADE, int *maxADE,
int *distances, int *maxwidth,
int *effects );
/****** Escape definitions *********************************************/
void vq_chcells( int handle, int *rows, int *columns );
void v_exit_cur( int handle );
void v_enter_cur( int handle );
void v_curup( int handle );
void v_curdown( int handle );
void v_curright( int handle );
void v_curleft( int handle );
void v_curhome( int handle );
void v_eeos( int handle );
void v_eeol( int handle );
void vs_curaddress( int handle, int row, int column );
void v_curaddress( int handle, int row, int column );
void v_curtext( int handle, char *string );
void v_rvon( int handle );
void v_rvoff( int handle );
void vq_curaddress( int handle, int *row, int *column );
int vq_tabstatus( int handle );
void v_hardcopy( int handle );
void v_dspcur( int handle, int x, int y );
void v_rmcur( int handle );
void v_form_adv( int handle );
void v_output_window( int handle, int *xyarray );
void v_clear_disp_list( int handle );
void v_bit_image( int handle, const char *filename,
int aspect, int x_scale, int y_scale,
int h_align, int v_align, int *xyarray );
void vq_scan( int handle, int *g_slice, int *g_page,
int *a_slice, int *a_page, int *div_fac);
void v_alpha_text( int handle, char *string );
void vs_palette( int handle, int palette );
void v_sound( int handle, int frequency, int duration );
int vs_mute( int handle, int action );
void vqp_films( int handle, char *film_names );
void vqp_state( int handle, int *port, char *film_name,
int *lightness, int *interlace,
int *planes, int *indexes );
void vsp_state( int handle, int port, int film_num,
int lightness, int interlace, int planes,
int *indexes );
void vsp_save( int handle );
void vsp_message( int handle );
int vqp_error( int handle );
void v_meta_extents( int handle, int min_x, int min_y,
int max_x, int max_y );
void v_write_meta( int handle,
int num_intin, int *intin,
int num_ptsin, int *ptsin );
void vm_coords( int handle, int llx, int lly, int urx, int ury );
void vm_filename( int handle, const char *filename );
void vm_pagesize( int handle, int pgwidth, int pdheight );
void v_offset( int handle, int offset );
void v_fontinit( int handle, int fh_high, int fh_low );
void v_escape2000( int handle, int times );
void vt_resolution( int handle, int xres, int yres,
int *xset, int *yset );
void vt_axis( int handle, int xres, int yres,
int *xset, int *yset );
void vt_origin( int handle, int xorigin, int yorigin );
void vq_tdimensions( int handle, int *xdimension, int *ydimension );
void vt_alignment( int handle, int dx, int dy );
void vsp_film( int handle, int index, int lightness );
void vsc_expose( int handle, int state );
#define GDOS_NONE -2L /* no GDOS installed */
#define GDOS_FSM 0x5F46534DL /* '_FSM' - FSMGDOS installed */
#define GDOS_FNT 0x5F464E54L /* '_FNT' - FONTGDOS installed */
int vq_gdos( void );
long vq_vgdos( void );
int v_bez_on( int handle );
void v_bez_off( int handle );
void v_set_app_buff( int handle, void *address, int nparagraphs );
void v_bez( int handle, int count, int *xyarr,
char *bezarr, int *extent, int *totpts, int *totmoves );
void v_bez_fill( int handle, int count, int *xyarr,
char *bezarr, int *extent, int *totpts,
int *totmoves );
int v_bez_qual( int handle, int prcnt, int *actual );
/****** SpeedoGDOS definitions ********************************************/
typedef long fix31;
void vqt_f_extent( int handle, char *string, int *extent );
void v_ftext( int handle, int x, int y, char *string );
void v_ftext_offset( int handle, int x, int y, char *string, int *offset );
void v_killoutline( int handle, void *component );
void v_getoutline( int handle, int ch, int *xyarray,
char *bezarray, int maxverts, int *numverts );
void vst_scratch( int handle, int mode );
void vst_error( int handle, int mode, int *errorvar );
void vqt_advance( int handle, int ch, int *advx, int *advy,
int *remx, int *remy );
void vqt_advance32( int handle, int ch, fix31 *advx, fix31 *advy );
int vst_arbpt( int handle, int point, int *chwd, int *chht,
int *cellwd, int *cellht );
fix31 vst_arbpt32( int handle, fix31 point, int *chwd, int *chht,
int *cellwd, int *cellht );
void vst_charmap( int handle, int mode );
void v_getbitmap_info( int handle, int ch, fix31 *advx, fix31 *advy,
fix31 *xoff, fix31 *yoff, fix31 *width,
fix31 *height );
void vqt_pairkern( int handle, int ch1, int ch2, fix31 *x, fix31 *y );
void vqt_trackkern( int handle, fix31 *x, fix31 *y );
void vqt_fontheader( int handle, char *buffer, char *pathname );
void vst_kern( int handle, int tmode, int pmode, int *tracks,
int *pairs );
fix31 vst_setsize32( int handle, fix31 point, int *chwd, int *chht,
int *cellwd, int *cellht );
void vqt_devinfo( int handle, int devnum, int *devexits,
char *devstr );
int v_flushcache( int handle );
void vqt_cachesize( int handle, int which_cache, long *size );
void vqt_get_table( int handle, int **map );
int v_loadcache( int handle, char *filename, int mode );
int v_savecache( int handle, char *filename );
int vst_setsize( int handle, int point, int *chwd, int *chht,
int *cellwd, int *cellht );
int vst_skew( int handle, int skew );
#endif
/***********************************************************************/

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More