#var SYMSTR_CONST(s) D(((SYM_STR)(("\0"s)+sizeof(s))))
#var VATSTR D(SYMSTR)

#var __Folder_Del D(_rom_call(short,(const char*,short),66))


#var H_NULL D(0)
#var HS_NULL D(((HSym){0,0}))
#var NULL D(((void*)0))
#var FALSE D(0)
#var TRUE D(1)

#var ESQ typedef unsigned char ESQ;
#var CESI typedef const ESQ*CESI;
#var CF_NONE D(0)
#var CF_CONVERT D(1)
#var CF_ENHANCED D(2)
#var CF_NEW D(3)

#var ESI typedef ESQ*ESI;
#var SEQ_INITC D(7)
#var DE_INITC D(8)
#var DE_FLDPIC D(9)
#var SOLVER_SYS_VARS D(10)
#var UNIT_VAR D(11)
#var C_COL D(12)
#var R_REGEQ D(13)
#var R_SYSVAR D(14)

#var FO_SINGLE_FOLDER D(1)
#var FO_RECURSE D(2)
#var FO_SKIP_TEMPS D(4)
#var FO_NOTEMPS D(4)
#var FO_RETURN_TWINS D(8)
#var FO_CKTWINS D(8)
#var FO_RETURN_FOLDER D(16)
#var FO_SKIP_COLLAPSE D(32)

#var FOP_UNLOCK D(0)
#var FOP_LOCK D(1)
#var FOP_ALL_FOLDERS D(128)

#var MAIN_FOLDER D(2)
#var FOLDER_TABLE D(3)
#var NOT_FOUND D(4)
#var BAD_FOLDER D(5)

#var HANDLE typedef unsigned short HANDLE;
#var HSym typedef struct{HANDLE folder;unsigned short offset;}HSym;
#var HSYM D(HSym)
#var MULTI_EXPR typedef struct{unsigned short Size;ESQ Expr[];}MULTI_EXPR;
#var SYM_ENTRY typedef struct{char name[8];unsigned short compat;union{unsigned short flags_n;struct{unsigned short busy:1,local:1,flag1_5:1,flag1_4:1,collapsed:1,twin:1,archived:1,in_view:1;unsigned short folder:1,overwritten:1,checked:1,hidden:1,locked:1,statvar:1,graph_ref_1:1,graph_ref_0:1;}bits;}flags;HANDLE handle;}SYM_ENTRY;
#var SYM_STR typedef CESI SYM_STR;
#var SF_GREF1 D(1)
#var SF_GREF2 D(2)
#var SF_STATVAR D(4)
#var SF_LOCKED D(8)
#var SF_HIDDEN D(16)
#var SF_OPEN D(16)
#var SF_CHECKED D(32)
#var SF_OVERWRITTEN D(64)
#var SF_FOLDER D(128)
#var SF_INVIEW D(256)
#var SF_ARCHIVED D(512)
#var SF_TWIN D(1024)
#var SF_COLLAPSED D(2048)
#var SF_LOCAL D(16384)
#var SF_BUSY D(-32768)

#var VR_NO_SYS_VARS D(1)
#var VR_FUNC_NAME D(2)
#var VR_LINK D(4)

#var STOF_ESI D(16384)
#var STOF_ELEMENT D(16385)
#var STOF_NONE D(16386)
#var STOF_HESI D(16387)

#var $(s) D(SYMSTR_CONST(#s))
#var AddSymToFolder D(_rom_call(HSym,(SYM_STR,SYM_STR),70))
#var checkCurrent D(_rom_call(HSym,(SYM_STR,ESQ),121))
#var CheckLinkLockFlag D(_rom_call(void,(const SYM_ENTRY*),7F))
#var CheckReservedName D(_rom_call(short,(SYM_STR),8B))
#var CheckSysFunc D(_rom_call(short,(const char*,__pushort),89))
#var ClearUserDef D(_rom_call(void,(HANDLE),7E))
#var DerefSym D(_rom_call(SYM_ENTRY*,(HSym),79))
#var EM_moveSymFromExtMem D(_rom_call(short,(SYM_STR,HSym),161))
#var EM_moveSymToExtMem D(_rom_call(short,(SYM_STR,HSym),162))
#var EM_twinSymFromExtMem D(_rom_call(HSym,(SYM_STR,HSym),166))
#var EX_stoBCD D(_rom_call(void,(unsigned char*,float*),C0))
#var FindSymInFolder D(_rom_call(HSym,(SYM_STR,const char*),71))
#var FolderAdd D(_rom_call(HANDLE,(SYM_STR),64))
#var FolderAddTemp D(_rom_call(const char*,(void),73))
#var FolderClear(c) D(__Folder_Del((c),1))
#var FolderCount D(_rom_call(unsigned short,(const SYM_ENTRY*),6B))
#var FolderCur D(_rom_call(short,(SYM_STR,short),65))
#var FolderCurTemp D(_rom_call(short,(SYM_STR),72))
#var FolderDel(c) D(__Folder_Del((c),0))
#var FolderDelAllTemp D(_rom_call(void,(short),75))
#var FolderDelTemp D(_rom_call(void,(void),74))
#var FolderFind D(_rom_call(short,(SYM_STR),67))
#var FolderGetCur D(_rom_call(void,(char*),68))
#var FolderOp D(_rom_call(short,(SYM_STR,short),69))
#var FolderRename D(_rom_call(short,(const char*,const char*),6A))
#var HSymDel D(_rom_call(short,(HSym),5F))
#var HSYMtoName D(_rom_call(short,(HSym,char*),7A))
#var IsMainFolderStr D(_rom_call(short,(const char*),77))
#var MakeHSym D(_rom_call(HSym,(HANDLE,const SYM_ENTRY*),282))
#var partial_len D(_rom_call(unsigned long,(const char*,unsigned char*),11C))
#var QSysProtected D(_rom_call(short,(ESQ),88))
#var ResetSymFlags D(_rom_call(void,(short),8E))
#var StrToTokN D(_rom_call(ESI,(const char*,unsigned char*),7B))
#var SymAdd D(_rom_call(HSym,(SYM_STR),5C))
#var SymAddMain D(_rom_call(HSym,(SYM_STR),5D))
#var SymAddTwin D(_rom_call(HSym,(SYM_STR),27F))
#var SymCmp D(_rom_call(short,(const char*,const char*),81))
#var SymCpy0 D(_rom_call(void,(char*,const char*),83))
#var SymCpy D(_rom_call(void,(char*,const char*),82))
#var SymDel D(_rom_call(short,(SYM_STR),5E))
#var SymDelTwin D(_rom_call(short,(SYM_ENTRY*),280))
#var SymFind D(_rom_call(HSym,(SYM_STR),60))
#var SymFindFirst D(_rom_call(SYM_ENTRY*,(SYM_STR,short),6C))
#var SymFindFolderName D(_rom_call(char*,(void),6F))
#var SymFindHome D(_rom_call(HSym,(SYM_STR),62))
#var SymFindMain D(_rom_call(HSym,(SYM_STR),61))
#var SymFindNext D(_rom_call(SYM_ENTRY*,(void),6D))
#var SymFindPrev D(_rom_call(SYM_ENTRY*,(void),6E))
#var SymFindPtr D(_rom_call(SYM_ENTRY*,(SYM_STR,short),283))
#var SymMove D(_rom_call(short,(const char*,const char*),63))
#var SYMSTR(s) D(({register unsigned short __slen=_rom_call(unsigned long,(const char*),27E)(s);ESI __tempstr=alloca(__slen+2);__tempstr[0]=0;_rom_call(void*,(void*,const void*,long),26A)(__tempstr+1,(s),__slen+1);__tempstr+__slen+1;}))
#var SymSysVar D(_rom_call(short,(const char*),8C))
#var TempFolderName D(_rom_call(SYM_STR,(short),76))
#var TokToStrN D(_rom_call(short,(unsigned char*,SYM_STR),7C))
#var ValidateSymName D(_rom_call(short,(const char*),84))
#var VarRecall D(_rom_call(HSym,(SYM_STR,short),85))
#var VarStore D(_rom_call(HSym,(SYM_STR,short,short,...),86))

#var SymFindFoldername D(SymFindFolderName)

#var OpenFile void *OpenFile(const char *)__ATTR_LIB_C__;
#var CloseFile void CloseFile(const char *)__ATTR_LIB_C__;
