This appendix covers the definitions of what is exported from the CSUBDECL.CODE file.
CSUBDECL is a library file containing the export text for COMSTUFF, HEAP, CSFA, KBDCRT and CSUBENTRY, as well as export text for the module by the same name, CSUBDECL (which is only export text).
These are the constructs found in the declaration section of CSUBDECL:
MODULE csubdecl;
EXPORT
CONST
stringlimit = 32767; {maximum length of a string}
maxdim = 6; {maximum dimensions in an array}
maxarraysize = 16777215; {maximum bytes in an array}
TYPE
byte = 0..255;
shortint = -32768..32767; {two byte integer}
bintvaltype = shortint; {BASIC integer}
bcmplxvaltype = record {BASIC complex}
re : real;
im : real;
end;
bstringvaltype = record {BASIC string type}
len : shortint;
c : packed array[1..stringlimit] of char;
end;
valuetype = (breal, binteger, bstring, bsubstring,
batname, bcomplex, spare2, spare3);
dimtype = 0..maxdim;
boundentry = record {describes array bound}
low : shortint; {lower limit}
length : shortint; {number of elements}
end;
boundtype = array[1..maxdim] of boundentry; {array bounds}
dimentry = packed record {dimension record structure}
case dimtype of
0: (maxlen : shortint); {string scalar}
1,2,3,4,5,6: {array}
(dims : byte; {number of dimensions}
totalsize : 0..maxarraysize; {total size of an array}
case valuetype of
breal, binteger, bcomplex : {numeric array}
(bound : boundtype); {dimension boundaries}
bstring: {string array}
(stringarray : packed record
maxlen : shortint; {max string length}
bound : boundtype; {dimension boundaries}
end))
end;
dimentryptr = ^dimentry; {pointer to dimension record}
binteger_parm = ^bintvaltype; {pointer to BASIC integer}
breal_parm = ^real; {pointer to real number}
bcomplex_parm = ^bcmplxvartype; {pointer to BASIC complex number}
bstring_parm = ^bstringvaltype; {pointer to BASIC string}
END.
This is the export text of CSFA:
DEFINE SOURCE of 'CSFA':
MODULE CSFA;
EXPORT
TYPE
file_name_type = string[160];
fcb_type = array [1..37] of integer;
fcb_ptr_type = ^ fcb_type;
procedure fal_loadsub_all(pfile_name:file_name_type);
procedure fal_loadsub_name(pfile_name:file_name_type;
sub_name:file_name_type);
procedure fal_create(pfile_name:file_name_type;nbytes:integer);
procedure fal_create_bdat(pfile_name:file_name_type;
bytesperlogrec:integer; nlogrecs:integer);
procedure fal_create_ascii(pfile_name:file_name_type; nsectors:integer);
procedure fal_purge(pfile_name:file_name_type);
procedure fal_eof(idptr:fcb_ptr_type);
procedure fal_position(idptr:fcb_ptr_type; logrecno:integer);
procedure fal_open(file_name:file_name_type; idptr:fcb_ptr_type);
procedure fal_close(idptr: fcb_ptr_type);
procedure fal_read(idptr:fcb_ptr_type; nbytes:integer; bufptr:anyptr);
procedure fal_write(idptr:fcb_ptr_type; nbytes:integer; bufptr:anyptr);
procedure fal_write_bdat_int(idptr:fcb_ptr_type; intbufptr: anyptr);
procedure fal_read_bdat_int(idptr:fcb_ptr_type; intbufptr: anyptr);
procedure fal_write_string(idptr:fcb_ptr_type; nbytes:integer;
bufptr:anyptr);
procedure fal_read_string (idptr:fcb_ptr_type; nbytes:integer;
bufptr:anyptr);
This is the export text of KBDCRT:
DEFINE SOURCE of 'KBDCRT':
MODULE KBDCRT;
EXPORT
TYPE
cbyte = 0..255;
cword = -32768..32767;
string_18 = string[18];
string_160 = string[160];
kbd_string = packed record
len : cword;
c : packed array[1..256] of char;
end;
enh_type = packed record
color : cbyte;
hlt : cbyte;
end;
cursor_type = (normal_cursor,insert_cursor,off_cursor);
function read_kbd : kbd_string;
function systemd (request : string_18): string_160;
procedure scrollup;
procedure scrolldn;
procedure crtscroll(first,last:cbyte;down:boolean);
procedure cursor (x,y
:cbyte;cstate:cursor_type);
procedure disp_at_xy (x,y:cbyte;var str : kbd_string;
parseflag : boolean; var enhc : enh_type);
procedure clear_screen;
procedure controlcrt (reg:cbyte;value:cword);
procedure controlkbd (reg:cbyte;value:cword);
function statuscrt (reg:cbyte):cword;
function statuskbd (reg:cbyte):cword;
function crtreadchar (x,y:cbyte):char;
The following declarations are found in module COMSTUFF:
MODULE comstuff;
EXPORT
TYPE
comlabeltype = string[18];
FUNCTION find_com {finds the address of a given COM block}
(seeked_label : comlabeltype) {COM label name}
: anyptr;
The following declarations are found in module HEAP:
MODULE heap;
EXPORT
TYPE
heapnametype = string[18];
PROCEDURE heap_init {initialize a heap}
(heapname : heapnametype); {COM block used for heap}
This is the STACKSPACE function declaration in module CSUBENTRY.
MODULE csubentry;
EXPORT
FUNCTION stackspace : integer; {return available stack space}
END;