/* ============================================= = MODULE: SUTIL.H = = VERSION: 2.2.10 = = = =FUNCTION: SUTIL - Internal Definitions = = = = SYSTEM: SUTIL = = SYSVERS: 2.2.10 = = CREATED: 31AUG88 = = UPDATED: 102AUG93 = = = = (c) 1988,89,90,91,92,93 = = BY: The Symmetry Group = ============================================= FUNCTION: Include File for the SUTIL Support System. HISTORY: VERS DATE BY NOTES 2.00.X 31 Aug 88 CVP Built from previous works. 2.0.0D 25 Mar 89 CVP -Add parameter to su_vtget, su_ktget. -Add su_dnget(). 2.0.0E 29 Mar 89 CVP -Add su_lrnd(). 2.0.0 11 Jul 89 CVP -Include stdtyp.h 2.0.3 13 Oct 89 CVP -Allow Dynamic Memory >64K 2.1.0 09 Jan 90 CVP -Add su_vpget(), su_vpput(), su_vcset(), su_vcwr(), su_vswr(). 12 Jan 90 CVP -Add su_vcolr public to su_vtget(). 07 Mar 90 CVP -Add su_mcall() and su_mcdef(). 2.1.0B 05 Apr 90 CVP -Add SMEM system 2.1.3 14 Aug 90 CVP -Add new SSTR system. -Add su_stoc() and su_ctos(). 2.1.3B 18 Oct 90 CVP -Change to longs in SCTBL. 2.1.5 10 Dec 90 CVP -Add Buffered File Functions. -Add hugh math functions. -Add replacement File functions. 2.2.0A 28 Dec 90 CVP -Add Code to Value Functions. -Add su_fdget(); -Add su_ssclr(); -Add su_fpsrc(); -Add su_feof; 2.2.0B 08 May 91 CVP -Add BASIC routines. 2.2.0C 31 May 91 CVP -Add FBUF Decompression routines. 2.2.0C 07 Jun 91 CVP -Modify SU_SERR globals. 2.2.0E 28 Aug 91 CVP -Use new Prototype Macros. 2.2.3 05 Dec 91 CVP -Add su-mlset(). 2.2.5 05 Mar 92 CVP -Add NewWare Queue functions. -Remove extra prototypes. 2.2.6A 31 Mar 92 CVP -Modify su_vmset to return status. -Rewrite SMEM system to use tables to calculate row and field positions. Remove the special calculations for last used. 2.2.6C 29 Jul 92 CVP -Prototype Function Pointers. -Add su_vptgt(). -Add compiler support for longjmp/setjmp. 2.2.7 30 Oct 92 CVP -Fix error in su_ljmp() prototype. -Add vectored setjmp/longjmp. -Remove extra su_sbrk globals. 07 Dec 92 CVP -Add SH_BEGIN & SH_END. -Add parameters to all global and typedef function pointers. 2.2.8 05 Feb 93 CVP -Add su_stocx. 2.2.9 13 Apr 93 CVP -32 bit support. 2.2.10 02 Aug 93 CVP -Pad DTA for word allignment. -Remove duplicate definitions of Critical Error globals. EJECT SECTION "Include Files"*/ #include "stdtyp.h" /*Standard Types*/ #include "stdarg.h" /*Standard Arguments*/ SH_HBEGIN /*EJECT SECTION "Limits" [EXTERN] TYPE NAME; COMMENT */ #define NSMEM 5 /*Number of SMTBL Entries*/ /*EJECT SECTION "Data Storage Structures & TYPEDEFS" [EXTERN] TYPE NAME; COMMENT */ #ifndef SCFLG #define SCFLG 1 typedef struct /*String/Code Lookup Table*/ {long start; /*Starting Number or return code*/ long end; /*Ending Number 0 for end of table*/ char *string; /*String NULL to use number*/ }SCTBL; #endif typedef struct /*String/Code Lookup Table*/ {long start; /*Starting Number or return code*/ long end; /*Ending Number <.start for end of table*/ long value; /*Value*/ }SVTBL; typedef struct /*SETJMP Environment*/ {char reg[36]; /*Register Buffer*/ char over[10]; /*Overlay Environment Buffer*/ char fixup[10]; /*Extra Fixups (usually ES:DI and CS:IP)*/ } JMP_BUF[1]; typedef struct /*Disk Transfer Area*/ {char x[21]; /*Reserved for DOS*/ char attrib; /*File Attributes 01H Read Only 02H Hidden File 04H System File 08H Volume Label 10H Subdirectory 20H Archive*/ ushort time; /*Time 0-4 Seconds/2 (0-29) 5-10 Minutes (0-59) 11-15 Hours (0-23)*/ ushort date; /*Date 0-4 Day of Month (1-31) 5-8 Month (1-12) 9-15 Year (after 1980)*/ long size; /*File Size*/ char name[13]; /*File Name & Extension*/ char x1; /*Padding for allignment*/ long stime; /*Symmetry Time*/ ushort sdate; /*Symmetru Date*/ } DTA; typedef struct /*Temp File Table Structure*/ {char name[9]; /*File Name*/ short hdl; /*File Handle*/ }FTTBL; typedef struct /*Message Table*/ {ushort first; /*First Code*/ ushort last; /*Last Code*/ char *mes; /*Message String*/ }MESTBL; typedef struct /*SSTR Update Handles Table*/ {ushort *hdl; /*Pointer to Handle to Update*/ }SSUPD; typedef struct /*SSTR Handle Table*/ {ushort hdl; /*Handle*/ char *str; /*String Pointer*/ ushort len; /*String Length (bytes)*/ }SSHDL; typedef struct /*SSTR Control Table*/ {ushort type; /*String Storage Type 0 - Not Used 1 - Old style (Hdl=Offset with Update Table) 2 - New style (Hdl list in data) 3 - New style (no Hdl list)*/ char *buf; /*Storage Buffer*/ ushort bmax; /*Buffer Length (bytes)*/ ushort blen; /*Buffer Usage (bytes)*/ SSHDL *htbl; /*Handle Table*/ ushort hmax; /*Handle Table Length (handles)*/ ushort hlen; /*Handle Table Usage (handles) 0 - Not open*/ SSUPD *upd; /*Update Table*/ }SSTR; typedef struct /*Compound Data Pointer*/ {ushort off; /*Offset*/ ushort seg; /*Segment/Selector*/ }CDPTR; typedef struct /*Compound Function Pointer*/ {ushort off; /*Offset*/ ushort seg; /*Segment/Selector*/ }CFPTR; /******************************/ /* Warning: The Compiler must */ /* be set to allow byte */ /* alignment for this */ /* structure to be used. */ /******************************/ typedef struct /*SMEM Header*/ /*** Basic Data ***/ {LDPTR buffer; /*Buffer Address*/ LDPTR row_tbl; /*Row Address Table*/ LDPTR fld_tbl; /*Field Offset Table*/ utiny btype; /*Data Buffer Type (su_smtbl index)*/ utiny ttype; /*Table Buffer Type (su_smtbl index)*/ utiny pg_stat; /*Page Status & Buffer 10H - Page Buf (index=0) 40H - Data Buffer Page Dirty 80H - Data Buffer Page Fault*/ utiny dtype; /*Data Type (info only)*/ ushort row_num; /*Number of rows*/ ushort row_len; /*Row Length (bytes)*/ ushort fld_num; /*Number of fields*/ /*** Page Buffer Data ***/ ushort pg_len; /*Page Buffer Length (rows)*/ ushort pg_first; /*Page Buffer, first row*/ ushort pg_hdl; /*File or EMS Handle*/ /*** Field/Subfield Data ***/ utiny sf_len; /*Sub Field Length (bits)*/ utiny sf_num; /*Number of Subfields (per field)*/ utiny sf_mask; /*SubField Mask*/ /*** Filler (to make 32 bytes) ***/ utiny x1; /*Reserved*/ }SMHDR; typedef struct /*Memory Allocation Table*/ {ushort mtype; /*Memory Type 0 - Unused 1 - Malloc 2 - DOS Memory 3 - EMS 4 - Disk 5 - XMS*/ ushort amin; /*Minimum allocation (para)*/ ushort amax; /*Maximum allocation (para) 0 - no maximum*/ ushort block; /*Max allocation block size (para) 0 - no maximum*/ ushort prow; /*Paging Buffer Rows Required 0 - no paging*/ ushort preq; /*Paging Requirements Data 01H - Memory Buffer Paging 02H - Paging Buffer*/ SH_PUBF(LDPTR, *cre)(SH_ARG1(long)); /*Create Function Pointer*/ SH_PUBF(void, *del)(SH_ARG1(LDPTR)); /*Delete Function Pointer*/ SH_PUBF(void, *page)(SH_ARG1(ushort) SH_ARG(ushort)); /*New Page Function Pointer*/ }SMTBL; typedef struct /*BASIC String Structure*/ {ushort len; /*String Length*/ char *string; /*String Ponter*/ }BSTR; /******************* string may want to be set NEAR ***/ /*EJECT SECTION "SUBROUTINES" [EXTERN] TYPE NAME; COMMENT */ SH_EXTF(void, su_mmov)(SH_ARG1(char*) SH_ARG(char*) SH_ARG(ushort)); SH_EXTF(void, su_mset)(SH_ARG1(char*) SH_ARG(ushort) SH_ARG(char)); SH_EXTF(char*, su_scpy)(SH_ARG1(char*) SH_ARG(char*) SH_ARG(ushort) SH_ARG(char)); SH_EXTF(short, su_scmp)(SH_ARG1(char*) SH_ARG(char*)); SH_EXTF(long, su_lrnd)(SH_ARG1(long) SH_ARG(long)); SH_EXTF(short, su_stoc)(SH_ARG1(char*) SH_ARG(SCTBL*)); SH_EXTF(short, su_stocx)(SH_ARG1(char*) SH_ARG(SCTBL*)); SH_EXTF(char*, su_ctos)(SH_ARG1(short) SH_ARG(SCTBL*)); SH_EXTF(long, su_ctov)(SH_ARG1(short) SH_ARG(SVTBL*)); SH_EXTF(long, su_lctov)(SH_ARG1(long) SH_ARG(SVTBL*)); SH_EXTF(void, su_ssopn)(SH_ARG1(ushort)); SH_EXTF(void, su_ssclr)(SH_ARG1(ushort)); SH_EXTF(ushort, su_ssput)(SH_ARG1(ushort) SH_ARG(ushort) SH_ARG(char*)); SH_EXTF(char*, su_ssget)(SH_ARG1(ushort)); SH_EXTF(void, su_ssdmp)(SH_ARG1(ushort)); SH_EXTF(short, su_fcpy)(SH_ARG1(short) SH_ARG(long) SH_ARG(short) SH_ARG(long) SH_ARG(long) SH_ARG(char*) SH_ARG(char*)); SH_EXTF(short, su_ftopn)(SH_ARG1(char*)); SH_EXTF(short, su_ftcls)(SH_ARG1(short)); SH_EXTF(short, su_ftnam)(SH_ARG1(short) SH_ARG(char*)); SH_EXTF(short, su_sexec)(SH_ARG1(ushort) SH_ARG(char*) SH_ARG(char*)); SH_EXTF(void, su_psplt)(SH_ARG1(char*) SH_ARG(char*) SH_ARG(char*) SH_ARG(char*) SH_ARG(char*)); SH_EXTF(void, su_pmake)(SH_ARG1(char*) SH_ARG(char*) SH_ARG(char*) SH_ARG(char*) SH_ARG(char*)); SH_EXTF(char*, su_mprn)(SH_ARG1(char*) SH_ARG(ushort) SH_VARG); SH_EXTF(char*, su_mnum)(SH_ARG1(MESTBL*) SH_ARG(ushort) SH_ARG(ushort) SH_VARG); SH_EXTF(void, su_mlset)(SH_ARG1(ushort) SH_ARG(ushort) SH_ARG(ushort)); SH_EXTF(char, su_mkget)(SH_ARG1(void)); SH_EXTF(void, su_mfmt)(SH_ARGF1(void) SH_ARG(char*) SH_ARG(va_list)); SH_EXTF(short, su_ffrst)(SH_ARG1(DTA*) SH_ARG(char*) SH_ARG(ushort)); SH_EXTF(short, su_fnext)(SH_ARG1(DTA*)); SH_EXTF(short, su_faget)(SH_ARG1(char*)); SH_EXTF(short, su_faset)(SH_ARG1(char*) SH_ARG(ushort)); SH_EXTF(void, su_ftget)(SH_ARG1(short) SH_ARG(long*) SH_ARG(ushort*)); SH_EXTF(void, su_ftset)(SH_ARG1(short) SH_ARG(long) SH_ARG(ushort)); SH_EXTF(short, su_fcomm)(SH_ARG1(short)); SH_EXTF(short, su_ddel)(SH_ARG1(char*)); SH_EXTF(short, su_dmake)(SH_ARG1(char*)); SH_EXTF(short, su_dset)(SH_ARG1(char*)); SH_EXTF(void, su_pget)(SH_ARG1(char*) SH_ARG(char*)); SH_EXTF(ushort, su_dvset)(SH_ARG1(char)); SH_EXTF(long, su_dfget)(SH_ARG1(char)); SH_EXTF(long, su_dsget)(SH_ARG1(char)); SH_EXTF(short, su_dtget)(SH_ARG1(char)); SH_EXTF(ushort, su_dsrd)(SH_ARG1(char) SH_ARG(ushort) SH_ARG(void*)); SH_EXTF(ushort, su_dnget)(SH_ARG1(void)); SH_EXTF(ushort, su_pspl)(SH_ARG1(char*)); SH_EXTF(short, su_nwstn)(SH_ARG1(void)); SH_EXTF(short, su_nwpkt)(SH_ARG1(ushort) SH_ARG(void*) SH_ARG(void*)); SH_EXTF(short, su_nxpkt)(SH_ARG1(ushort) SH_ARG(ushort) SH_ARG(void*)); SH_EXTF(long, su_nwbid)(SH_ARG1(ushort) SH_ARG(char*)); SH_EXTF(ushort, su_nwpqd)(SH_ARG1(char*) SH_ARG(ushort)); SH_EXTF(short, su_nwpqo)(SH_ARG1(char*) SH_ARG(char*)); SH_EXTF(short, su_nwpqc)(SH_ARG1(char*) SH_ARG(ushort)); SH_EXTF(ushort, su_2rev)(SH_ARG1(ushort)); SH_EXTF(long, su_4rev)(SH_ARG1(long)); SH_EXTF(bool, su_indos)(SH_ARG1(void)); SH_EXTF(bool, su_inbio)(SH_ARG1(ushort)); SH_EXTF(LFPTR, su_lfptr)(SH_ARGF1(void)); SH_EXTF(LDPTR, su_ldptr)(SH_ARG1(void*)); SH_EXTF(void*, su_ptrld)(SH_ARG1(LDPTR)); SH_EXTF(LDPTR, su_ldseg)(SH_ARG1(ushort)); SH_EXTF(ushort, su_pspgt)(SH_ARG1(void)); SH_EXTF(ushort, su_envgt)(SH_ARG1(void)); SH_EXTF(short, su_sjmp)(SH_ARG1(JMP_BUF)); SH_EXTF(void, su_ljmp)(SH_ARG1(JMP_BUF) SH_ARG(short)); SH_EXTF(short, su__sjmp)(SH_ARG1(JMP_BUF)); SH_EXTF(void, su__ljmp)(SH_ARG1(JMP_BUF) SH_ARG(short)); SH_EXTF(void, su_sjdef)(SH_ARGF1(short) SH_ARGF(void)); SH_EXTF(void, su_sjbor)(SH_ARG1(void)); SH_EXTF(void, su_sjrtl)(SH_ARG1(void)); SH_EXTF(short, su_sbset)(SH_ARG1(ushort)); SH_EXTF(void, su_sbclr)(SH_ARG1(void)); SH_EXTF(void, su__sbts)(SH_ARG1(void)); SH_EXTF(void, su_sbtst)(SH_ARG1(void)); SH_EXTF(void, su_sbdef)(SH_ARGF1(void)); SH_EXTF(void, su_rdsp)(SH_ARG1(void)); SH_EXTF(void, su_stget)(SH_ARG1(long*) SH_ARG(ushort*)); SH_EXTF(void, su_stset)(SH_ARG1(long) SH_ARG(ushort)); SH_EXTF(short, su__exec)(SH_ARG1(ushort) SH_ARG(char*) SH_ARG(char*)); SH_EXTF(void, su_seset)(SH_ARG1(void)); SH_EXTF(void, su_seclr)(SH_ARG1(void)); SH_EXTF(bool, su_sccpm)(SH_ARG1(void)); SH_EXTF(void, su_seget)(SH_ARG1(char*) SH_ARG(char*) SH_ARG(ushort)); SH_EXTF(void, su_saget)(SH_ARG1(ushort) SH_ARG(char*) SH_ARG(ushort)); SH_EXTF(ushort, su_dmopn)(SH_ARG1(long)); SH_EXTF(short, su_dmcls)(SH_ARG1(ushort)); SH_EXTF(void, su_dmput)(SH_ARG1(void*) SH_ARG(ushort) SH_ARG(long) SH_ARG(ushort)); SH_EXTF(void, su_dmfil)(SH_ARG1(char) SH_ARG(ushort) SH_ARG(long) SH_ARG(ushort)); SH_EXTF(void, su_dmget)(SH_ARG1(ushort) SH_ARG(long) SH_ARG(void*) SH_ARG(ushort)); SH_EXTF(short, su_dmrd)(SH_ARG1(short) SH_ARG(ushort) SH_ARG(long) SH_ARG(ushort)); SH_EXTF(short, su_dmwr)(SH_ARG1(short) SH_ARG(ushort) SH_ARG(long) SH_ARG(ushort)); SH_EXTF(long, su_tdtos)(SH_ARG1(ushort)); SH_EXTF(ushort, su_tstod)(SH_ARG1(long)); SH_EXTF(ushort, su_ddtos)(SH_ARG1(ushort)); SH_EXTF(ushort, su_dstod)(SH_ARG1(ushort)); SH_EXTF(void, su_ktget)(SH_ARG1(ushort)); SH_EXTF(bool, su_kcget)(SH_ARG1(void)); SH_EXTF(bool, su_kctst)(SH_ARG1(void)); SH_EXTF(void, su_vtget)(SH_ARG1(ushort)); SH_EXTF(short, su_vmset)(SH_ARG1(ushort)); SH_EXTF(void, su_vpset)(SH_ARG1(ushort)); SH_EXTF(ushort, su_vpget)(SH_ARG1(ushort) SH_ARG(ushort) SH_ARG(ushort)); SH_EXTF(void, su_vpput)(SH_ARG1(ushort) SH_ARG(ushort) SH_ARG(ushort) SH_ARG(ushort)); SH_EXTF(void, su_vcset)(SH_ARG1(ushort) SH_ARG(ushort) SH_ARG(ushort)); SH_EXTF(void, su_vcwr)(SH_ARG1(char) SH_ARG(ushort)); SH_EXTF(void, su_vswr)(SH_ARG1(char*) SH_ARG(ushort)); SH_EXTF(long, su_vptgt)(SH_ARG1(ushort)); SH_EXTF(void, su_vhset)(SH_ARG1(ushort)); SH_EXTF(void, su_vhchr)(SH_ARG1(char) SH_ARG(ushort) SH_ARG(ushort)); SH_EXTF(void, su_vhcur)(SH_ARG1(ushort) SH_ARG(ushort)); SH_EXTF(ushort, su_vhget)(SH_ARG1(ushort) SH_ARG(ushort) SH_ARG(ushort)); SH_EXTF(void, su_vhput)(SH_ARG1(ushort) SH_ARG(ushort) SH_ARG(ushort) SH_ARG(ushort)); SH_EXTF(ushort, su_smcre)(SH_ARG1(ushort) SH_ARG(ushort) SH_ARG(ushort) SH_ARG(ushort) SH_ARG(ushort)); SH_EXTF(short, su_smexp)(SH_ARG1(ushort) SH_ARG(ushort)); SH_EXTF(void, su_smclr)(SH_ARG1(ushort)); SH_EXTF(void, su_smdft)(SH_ARG1(void)); SH_EXTF(void, su_smmal)(SH_ARG1(ushort) SH_ARG(ushort)); SH_EXTF(void, su_smdos)(SH_ARG1(ushort) SH_ARG(ushort)); SH_EXTF(ushort, su_doopn)(SH_ARG1(ushort)); SH_EXTF(void, su_doclr)(SH_ARG1(ushort)); SH_EXTF(void, su_smdsk)(SH_ARG1(char*) SH_ARG(ushort) SH_ARG(ushort)); SH_EXTF(short, su_smems)(SH_ARG1(ushort) SH_ARG(ushort)); SH_EXTF(short, su_emtst)(SH_ARG1(void)); SH_EXTF(short, su_emopn)(SH_ARG1(ushort)); SH_EXTF(void, su_emcls)(SH_ARG1(ushort)); SH_EXTF(void, su_emmap)(SH_ARG1(ushort) SH_ARG(ushort) SH_ARG(ushort)); SH_EXTF(ushort, su_emseg)(SH_ARG1(void)); SH_EXTF(ushort, su_smwr)(SH_ARG1(ushort) SH_ARG(ushort) SH_ARG(ushort) SH_ARG(ushort) SH_ARG(ushort)); SH_EXTF(ushort, su_smrd)(SH_ARG1(ushort) SH_ARG(ushort) SH_ARG(ushort) SH_ARG(ushort) SH_ARG(ushort)); SH_EXTF(ushort, su_smfil)(SH_ARG1(char) SH_ARG(ushort) SH_ARG(ushort) SH_ARG(ushort) SH_ARG(ushort)); SH_EXTF(void, su_smget)(SH_ARG1(ushort) SH_ARG(ushort) SH_ARG(ushort) SH_ARG(char*)); SH_EXTF(void, su_srget)(SH_ARG1(ushort) SH_ARG(ushort) SH_ARG(ushort) SH_ARG(char*)); SH_EXTF(void, su_smput)(SH_ARG1(ushort) SH_ARG(ushort) SH_ARG(ushort) SH_ARG(char*)); SH_EXTF(ushort, su_smcpy)(SH_ARG1(ushort) SH_ARG(ushort) SH_ARG(ushort) SH_ARG(ushort)); SH_EXTF(ushort, su_smsgt)(SH_ARG1(ushort) SH_ARG(ushort) SH_ARG(ushort) SH_ARG(ushort) SH_ARG(char*)); SH_EXTF(ushort, su_smspt)(SH_ARG1(char*) SH_ARG(ushort) SH_ARG(ushort) SH_ARG(ushort) SH_ARG(ushort)); SH_EXTF(void, su_smhgt)(SH_ARG1(ushort)); SH_EXTF(void, su_smhpt)(SH_ARG1(ushort)); SH_EXTF(void, su_smagt)(SH_ARG1(LDPTR) SH_ARG(char*) SH_ARG(ushort)); SH_EXTF(void, su_smapt)(SH_ARG1(char*) SH_ARG(LDPTR) SH_ARG(ushort)); SH_EXTF(LDPTR, su_smbad)(SH_ARG1(ushort)); SH_EXTF(void, su_smdmp)(SH_ARG1(ushort)); SH_EXTF(void, su_fopn)(SH_ARG1(short)); SH_EXTF(long, su_fpset)(SH_ARG1(long) SH_ARG(ushort)); SH_EXTF(void, su_fmset)(SH_ARG1(ushort)); SH_EXTF(utiny, su_f1get)(SH_ARG1(void)); SH_EXTF(short, su_f2get)(SH_ARG1(void)); SH_EXTF(long, su_f4get)(SH_ARG1(void)); SH_EXTF(ushort, su_fdget)(SH_ARG1(void)); SH_EXTF(char*, su_fsget)(SH_ARG1(char*) SH_ARG(ushort) SH_ARG(char)); SH_EXTF(long, su_frl6p)(SH_ARG1(long) SH_ARG(ushort)); SH_EXTF(utiny, su_frrl6)(SH_ARG1(void)); SH_EXTF(long, su_frl7p)(SH_ARG1(long) SH_ARG(ushort)); SH_EXTF(utiny, su_frrl7)(SH_ARG1(void)); SH_EXTF(long, su_flz1p)(SH_ARG1(long) SH_ARG(ushort)); SH_EXTF(utiny, su_flz12)(SH_ARG1(void)); SH_EXTF(long, su_fccip)(SH_ARG1(long) SH_ARG(ushort)); SH_EXTF(void, su_fccil)(SH_ARG1(ushort)); SH_EXTF(utiny, su_fccit)(SH_ARG1(void)); SH_EXTF(void, su_slset)(SH_ARG1(long) SH_ARG(long) SH_ARG(ushort)); SH_EXTF(ushort, su_scale)(SH_ARG1(ushort)); SH_EXTF(void, su_hzero)(SH_ARG1(utiny*) SH_ARG(ushort)); SH_EXTF(void, su_htox)(SH_ARG1(utiny*) SH_ARG(ushort) SH_ARG(char*)); SH_EXTF(void, su_xtoh)(SH_ARG1(char*) SH_ARG(utiny*) SH_ARG(ushort)); SH_EXTF(void, su_hadd)(SH_ARG1(utiny*) SH_ARG(ushort) SH_ARG(utiny*) SH_ARG(ushort) SH_ARG(utiny*)); SH_EXTF(void, su_hsub)(SH_ARG1(utiny*) SH_ARG(ushort) SH_ARG(utiny*) SH_ARG(ushort) SH_ARG(utiny*)); SH_EXTF(void, su_hmult)(SH_ARG1(utiny*) SH_ARG(ushort) SH_ARG(utiny*) SH_ARG(ushort) SH_ARG(utiny*)); SH_EXTF(short, su_hdiv)(SH_ARG1(utiny*) SH_ARG(ushort) SH_ARG(utiny*) SH_ARG(ushort) SH_ARG(utiny*)); SH_EXTF(short, su_open)(SH_ARG1(char*) SH_ARG(ushort) SH_ARG(ushort)); SH_EXTF(short, su_close)(SH_ARG1(short)); SH_EXTF(short, su_unlnk)(SH_ARG1(char*)); SH_EXTF(short, su_read)(SH_ARG1(short) SH_ARG(char*) SH_ARG(ushort)); SH_EXTF(short, su_write)(SH_ARG1(short) SH_ARG(char*) SH_ARG(ushort)); SH_EXTF(long, su_lseek)(SH_ARG1(short) SH_ARG(long) SH_ARG(ushort)); SH_EXTF(ushort, su_fpsrc)(SH_ARG1(char*) SH_ARG(char*) SH_ARG(char*)); SH_EXTF(BSTR*, su_bscnv)(SH_ARG1(char*)); SH_EXTF(void, su_bsget)(SH_ARG1(BSTR*) SH_ARG(char*) SH_ARG(ushort)); SH_EXTF(ushort, su_bit)(SH_ARG1(ushort)); SH_EXTF(char, su_l1get)(SH_ARG1(LDPTR)); SH_EXTF(void, su_l1put)(SH_ARG1(char) SH_ARG(LDPTR)); SH_EXTF(short, su_l2get)(SH_ARG1(LDPTR)); SH_EXTF(void, su_l2put)(SH_ARG1(short) SH_ARG(LDPTR)); SH_EXTF(long, su_l4get)(SH_ARG1(LDPTR)); SH_EXTF(void, su_l4put)(SH_ARG1(long) SH_ARG(LDPTR)); SH_EXTF(char, su_f1gt)(SH_ARG1(ushort) SH_ARG(ushort)); SH_EXTF(void, su_f1pt)(SH_ARG1(char) SH_ARG(ushort) SH_ARG(ushort)); SH_EXTF(short, su_f2gt)(SH_ARG1(ushort) SH_ARG(ushort)); /*** Protected Mode ***/ SH_EXTF(short, su_prot)(SH_ARG1(void)); /*EJECT SECTION "SUBROUTINES - Implemented as Macros" [EXTERN] TYPE NAME; COMMENT */ #define su_max(a,b) ((a)>(b)?(a):(b)) #define su_min(a,b) ((a)<=(b)?(a):(b)) #define su_meset() (su__mjmp=TRUE, su_sjmp(su__menv)) #define su_meclr() su__mjmp=FALSE #define su_mejmp(p) su_ljmp(su__menv, p) #define su_mddef(p) (su_msput = (p)) #define su_mrdef(p) (su_msget = (p)) #define su_mkdef(p) (su_mkey = (p)) #define su_mcdef(p) (su_mcall = (p)) #define su_mtdef(p) (su_mtget = (p)) /*** Obsolete Functions ***/ #define su_ra286() (su_prot()) #define su_ra386() (su_prot()) #define su_ph286() (su_prot()) /*EJECT SECTION "MISC MACROS" [STATIC] TYPE NAME; COMMENT */ /*EJECT SECTION "LIMITS & SIZES" [STATIC] TYPE NAME; COMMENT */ /*EJECT SECTION "GLOBALS" [EXTERN] TYPE NAME; COMMENT */ /*** DOS Extender Globals ***/ extern FDPTR su_b000; /*Selector:Offset for B000H*/ extern FDPTR su_b800; /*Selector:Offset for B800H*/ extern FDPTR su_bios; /*Selector:Offset for BIOS Data*/ extern ushort su_envr; /*Selector for Environment*/ extern ushort su_psp; /*Selector for PSP*/ extern ushort su_dext; /*DOS Extender Type 0 Real/V8086 Mode 1 16 bit Protected Mode (286) 2 32 bit Protected Mode (386) 100 DPMI supported 200 Int 21H, 25H/35H supported. 400 PharLap Int 21H, 25xxH supported. 800 DPMI 0002H supported. 1000 DPMI 0303H supported & should be used.*/ /* Unless otherwise noted, the following are defined */ /* in the routines that use them. */ extern bool su_case; /*Case Sensitive Compare?*/ extern char *su_buf; /*Buffer Pointer (not defined)*/ extern ushort su_blen; /*Buffer Length (not defined)*/ extern char su_ftpth[64]; /*Temp File Path*/ extern FTTBL su_fttbl[5]; /*Temp File Table*/ /*** Critical Error System Globals ***/ /*See Int24 for codes*/ extern bool su_ceflg; /*Critical Error?*/ extern ushort su_cerr; /*Critical Error Code*/ extern ushort su_cetyp; /*Critical Error Type*/ extern ushort su_cedrv; /*Critical Error Drive*/ extern bool su_ceset; /*Intercept Critical Error?*/ /*** Message System Globals ***/ extern ushort su_mwrn; /*Warning Count*/ extern ushort su_merr; /*Error Count*/ extern ushort su_mferr; /*Fatal Error Count*/ SH_EXTF( char*, *su_mtget)(SH_ARG1(ushort) SH_ARG(ushort)); /*Get Message Text Routine pointer*/ SH_EXTF( void, *su_msput)(SH_ARG1(char*) SH_ARG(char*) SH_ARG(ushort)); /*Display Message Routine pointer*/ SH_EXTF( char*, *su_msget)(SH_ARG1(void)); /*Get String Routine pointer*/ SH_EXTF( char, *su_mkey)(SH_ARG1(void)); /*Get Keyboard Routine pointer*/ SH_EXTF( void, *su_mcall)(SH_ARG1(void)); /*Fatal Error Call*/ extern JMP_BUF su__menv; /*Message Sys Jump Environment*/ extern bool su__mjmp; /*Message LongJump Installed?*/ /*** SSTR System Globals ***/ extern SSTR su_sstr[]; /*SSTR Control Table*/ extern ushort su_ssnum; /*Number of SSTR Subsystems*/ /*** Video Data ***/ extern ushort su_vptyp; /* Primary (active) Video Adapter 01 - MDA, Monochrome Display Adapter 02 - CGA, Color Graphics Adapter 04 - EGA, Extended Graphics Adapter 08 - MCGA, MultiColor Graphics Array 10 - VGA, Video Graphics Array 20 - HGC, Hercules Graphics Card 40 - HGC+, Hercules Graphics Card Plus 80 - HICC, Hercules InColor Card */ extern ushort su_vstyp; /*Secondary (inactive) Video Adapter*/ extern ushort su_vpdsp; /*Video Primary (active) Display Type 01 - MDA compatible Monochrome 02 - CGA compatible Monochrome 04 - EGA compatible Monochrome 08 - PS/2 compatible Monochrome or Enhanced EGA compatible Monochrome 10 - - 20 - CGA compatible Color 40 - EGA compatible Color 80 - PS/2 compatible Color Enhanced EGA compatible Color*/ extern ushort su_vsdsp; /*Secondary (inactive) Video Display Type*/ extern uchar su_vmode; /*Video Mode 00 - 40x25 16 color alpha (no color burst) 01 - 40x25 16 color alpha 02 - 80x25 16 color alpha (no color burst) 03 - 80x25 16 color alpha, 04 - 320x200 4 color graphics 05 - 320x200 4 color graphics (no color burst) 06 - 640x200 2 color graphics 07 - 80x25 monochrome alpha 08 - 160x200 16 color graphics (PCJr) 09 - 320x200 16 color graphics (PCJr) 0A - 640x200 4 color graphics (PCJr) 0B - Reserved (VGA BIOS) 0C - Reserved (VGA BIOS) 0D - 320x200 16 color graphics 0E - 640x200 16 color graphics 0F - 640x350 monochrome graphics 10 - 640x350 16 color graphics (4 color) 11 - 640x480 2 color graphics 12 - 640x480 16 color graphics 13 - 320x200 256 color graphics*/ extern ushort su_vcolr; /*Number of colors*/ extern uchar su_vsync; /*syncronized Write Required*/ extern ushort su_vncol; /*number of Columns*/ extern ushort su_vnrow; /*number of Rows*/ extern ushort su_vclin; /*number of Scan Lines/Character*/ extern uchar su_vpage; /*current Page*/ extern ushort su_vbase; /*Video RAM Offset from SU_VSEG*/ extern FDPTR su_vadr; /*Video RAM Address*/ extern ushort su_vlen; /*Video RAM Length (Current Page)*/ /*** Keyboard Globals ***/ extern ushort su_ktype; /*Keyboard Type 01H Unknown Keyboard Type 02H IBM PC/XT Keyboard 04H IBM AT Keyboard 08H 5151 Keyboard 10H 101/102 Keyboard*/ extern bool su_keflg; /*Extended Keyboard BIOS*/ extern uchar su_kchr; /*Keyboard Character*/ extern ushort su_kscan; /*Keyboard Scan Code*/ extern ushort su_kstat; /*Keyboard Shift Status 0001H Right SHIFT Key Down 0002H Left SHIFT Key Down 0004H CTRL Key Down 0008H ALT Key Down 0010H Scroll Lock Mode Active 0020H Num Lock Mode Active 0040H Caps Lock Mode Active 0080H Insert Mode Active 0100H Left CTRL Key Down (extended) 0200H Left ALT Key Down (extended) 0400H Right CTRL Key Down (extended) 0800H Right ALT Key Down (extended) 1000H Scroll Lock Key Down (extended) 2000H Num Lock Key Down (extended) 4000H Caps Lock Key Down (extended) 8000H Sys Req Key Down (extended)*/ /*** su_fbuf Globals ***/ extern bool su_feof; /*End of File?*/ /*** SMEM Globals ***/ extern SMTBL su_smtbl[]; /*SMEM Allocation Table*/ extern ushort su_smtln; /*SMTBL current Length*/ extern SMHDR su_smhdr; /*Working SMHDR*/ extern LDPTR su_smbuf; /*SMHDR Table Address*/ extern LDPTR su_smrt; /*SMHDR Row Table*/ extern ushort su_smhln; /*SMHDR Length*/ /*** String to/from Code Globals ***/ extern SCTBL *su_sctbl[]; /*List of String/Code Lookup Tables*/ SH_HEND