spacing to more files

This commit is contained in:
TomAwezome 2020-05-23 01:33:35 -04:00
parent 3e8690799c
commit 0293e0d373
9 changed files with 1124 additions and 980 deletions

Binary file not shown.

View file

@ -1,4 +1,5 @@
$FG,7$Files reformatted starting from ::/ 'root' directory.$FG,0$
HomeKeyPlugins.CC
HomeLocalize.CC
HomeSys.CC
@ -6,7 +7,6 @@ HomeWrappers.CC
Once.CC
StartOS.CC
/Zenith/
DevInfo.CC
InFile.CC
@ -17,6 +17,14 @@ StartOS.CC
WallPaper.CC
Win.CC
WinMgr.CC
ZDebug.CC
ZDefine.CC
ZExterns.CC ... ?
ZHash.CC
ZMath.CC
ZMathODE.CC
ZMouse.CC
ZBlkDev/
Mount.CC

View file

@ -1,156 +1,200 @@
#help_index "Debugging/Dump"
Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass,Bool u8_chars,Bool force,I64 depth,I64 max_depth,Bool dynamic,I64 types=HTT_CLASS,I64 offset=0)
Bool ClassRep2(CDoc *doc, U8 *_d, U8 *class_name=lastclass, Bool u8_chars, Bool force, I64 depth, I64 max_depth, Bool dynamic, I64 types=HTT_CLASS, I64 offset=0)
{//See $LK,"::/Demo/LastClass.CC"$.
I64 i,j,stars,*ptr;
I64 i, j, stars, *ptr;
CMemberList *ml;
CDocEntry *doc_e;
Bool unlock;
CHashClass *tmpc,*tmpc2;
if (depth>=max_depth) return TRUE;
if (!(tmpc=HashFind(class_name,Fs->hash_table,types))) {
DocPrint(doc,"Class Not Found.\n");
CHashClass *tmpc, *tmpc2;
if (depth >= max_depth)
return TRUE;
if (!(tmpc = HashFind(class_name, Fs->hash_table, types)))
{
DocPrint(doc, "Class Not Found.\n");
return FALSE;
}
if (!force && (!CheckPtr(_d) || !CheckPtr(_d(U8 *)+tmpc->size))) {
DocPrint(doc,"Bad Ptr:%016X\n",_d);
if (!force && (!CheckPtr(_d) || !CheckPtr(_d(U8 *) + tmpc->size)))
{
DocPrint(doc, "Bad Ptr:%016X\n", _d);
return FALSE;
}
if (tmpc->base_class && !ClassRep2(doc,_d,tmpc->base_class->str,
depth,max_depth,dynamic,types,offset))
if (tmpc->base_class && !ClassRep2(doc, _d, tmpc->base_class->str, depth, max_depth, dynamic, types, offset))
return FALSE;
unlock=DocLock(doc);
DocPrint(doc,"Class:\"%s\"\n",class_name);
ml=tmpc->member_list_and_root;
while (ml) {
tmpc2=ml->member_class;
ptr=_d(U8 *)+ml->offset;
DocPrint(doc,"%08X ",ptr(U8 *)+offset);
stars=tmpc2->ptr_stars_count;
tmpc2=OptClassFwd(tmpc2);
tmpc2-=tmpc2->ptr_stars_count;
if (tmpc2->type & HTT_INTERNAL_TYPE) {
DocPrint(doc,"$$GREEN$$%-20ts:$$FG$$",ml->str);
if (stars==1 && (tmpc2->raw_type==RT_I8 || tmpc2->raw_type==RT_U8)) {
ptr=*ptr;
if (CheckPtr(ptr)) {
if (dynamic) {
doc_e=DocPrint(doc,"$$DA-TRM-P+RD,LEN=64,A=\"%%40ts\"$$\n");
doc_e->data=ptr;
DocDataFormat(doc,doc_e);
} else
DocPrint(doc,"%40ts\n",ptr);
unlock = DocLock(doc);
DocPrint(doc, "Class:\"%s\"\n", class_name);
ml = tmpc->member_list_and_root;
while (ml)
{
tmpc2 = ml->member_class;
ptr = _d(U8 *) + ml->offset;
DocPrint(doc, "%08X ", ptr(U8 *) + offset);
stars = tmpc2->ptr_stars_count;
tmpc2 = OptClassFwd(tmpc2);
tmpc2 -= tmpc2->ptr_stars_count;
if (tmpc2->type & HTT_INTERNAL_TYPE)
{
DocPrint(doc, "$$GREEN$$%-20ts:$$FG$$", ml->str);
if (stars == 1 && (tmpc2->raw_type == RT_I8 || tmpc2->raw_type == RT_U8))
{
ptr = *ptr;
if (CheckPtr(ptr))
{
if (dynamic)
{
doc_e = DocPrint(doc, "$$DA-TRM-P+RD,LEN=64,A=\"%%40ts\"$$\n");
doc_e->data = ptr;
DocDataFormat(doc, doc_e);
}
else
DocPrint(doc, "%40ts\n", ptr);
}
} else if (!stars) {
j=MinI64(ml->dim.total_count,32);
if ((tmpc2->raw_type==RT_I8 || tmpc2->raw_type==RT_U8) && u8_chars) {
if (j==1) {
if (dynamic) {
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U8,A=\"%%c\"$$\n");
doc_e->data=ptr;
} else
DocPrint(doc,"%c\n",*ptr(U8 *));
} else {
if (dynamic) {
doc_e=DocPrint(doc,"$$DA-TRM-P+RD,LEN=64,A=\"%%40ts\"$$\n");
doc_e->data=ptr;
DocDataFormat(doc,doc_e);
} else
DocPrint(doc,"%40ts\n",ptr);
}
else if (!stars)
{
j = MinI64(ml->dim.total_count, 32);
if ((tmpc2->raw_type == RT_I8 || tmpc2->raw_type == RT_U8) && u8_chars)
{
if (j == 1)
{
if (dynamic)
{
doc_e = DocPrint(doc, "$$DA-TRM+RD+UD,RT=U8,A=\"%%c\"$$\n");
doc_e->data = ptr;
}
else
DocPrint(doc, "%c\n", *ptr(U8 *));
}
else
{
if (dynamic)
{
doc_e = DocPrint(doc, "$$DA-TRM-P+RD,LEN=64,A=\"%%40ts\"$$\n");
doc_e->data = ptr;
DocDataFormat(doc, doc_e);
}
else
DocPrint(doc, "%40ts\n", ptr);
}
}
for (i=0;i<j;i++) {
switch (tmpc2->raw_type) {
for (i = 0; i < j; i++)
{
switch (tmpc2->raw_type)
{
case RT_I0:
case RT_U0:
break;
case RT_I8:
if (dynamic) {
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=I8,A=\"%%02X\"$$ ");
doc_e->data=ptr(I8 *)++;
} else
DocPrint(doc,"%02X ",*ptr(I8 *)++);
if (dynamic)
{
doc_e = DocPrint(doc, "$$DA-TRM+RD+UD,RT=I8,A=\"%%02X\"$$ ");
doc_e->data = ptr(I8 *)++;
}
else
DocPrint(doc, "%02X ", *ptr(I8 *)++);
break;
case RT_U8:
if (dynamic) {
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U8,A=\"%%02X\"$$ ");
doc_e->data=ptr(U8 *)++;
} else
DocPrint(doc,"%02X ",*ptr(U8 *)++);
if (dynamic)
{
doc_e = DocPrint(doc, "$$DA-TRM+RD+UD,RT=U8,A=\"%%02X\"$$ ");
doc_e->data = ptr(U8 *)++;
}
else
DocPrint(doc, "%02X ", *ptr(U8 *)++);
break;
case RT_I16:
if (dynamic) {
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=I16,A=\"%%04X\"$$ ");
doc_e->data=ptr(I16 *)++;
} else
DocPrint(doc,"%04X ",*ptr(I16 *)++);
if (dynamic)
{
doc_e = DocPrint(doc, "$$DA-TRM+RD+UD,RT=I16,A=\"%%04X\"$$ ");
doc_e->data = ptr(I16 *)++;
}
else
DocPrint(doc, "%04X ", *ptr(I16 *)++);
break;
case RT_U16:
if (dynamic) {
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U16,A=\"%%04X\"$$ ");
doc_e->data=ptr(U16 *)++;
} else
DocPrint(doc,"%04X ",*ptr(U16 *)++);
if (dynamic)
{
doc_e = DocPrint(doc, "$$DA-TRM+RD+UD,RT=U16,A=\"%%04X\"$$ ");
doc_e->data = ptr(U16 *)++;
}
else
DocPrint(doc, "%04X ", *ptr(U16 *)++);
break;
case RT_I32:
if (dynamic) {
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=I32,A=\"%%08X\"$$ ");
doc_e->data=ptr(I32 *)++;
} else
DocPrint(doc,"%08X ",*ptr(I32 *)++);
if (dynamic)
{
doc_e = DocPrint(doc, "$$DA-TRM+RD+UD,RT=I32,A=\"%%08X\"$$ ");
doc_e->data = ptr(I32 *)++;
}
else
DocPrint(doc, "%08X ", *ptr(I32 *)++);
break;
case RT_U32:
if (dynamic) {
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U32,A=\"%%08X\"$$ ");
doc_e->data=ptr(U32 *)++;
} else
DocPrint(doc,"%08X ",*ptr(U32 *)++);
if (dynamic)
{
doc_e = DocPrint(doc, "$$DA-TRM+RD+UD,RT=U32,A=\"%%08X\"$$ ");
doc_e->data = ptr(U32 *)++;
}
else
DocPrint(doc, "%08X ", *ptr(U32 *)++);
break;
case RT_U64:
if (dynamic) {
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U64,A=\"%%08X\"$$ ");
doc_e->data=ptr(U64 *)++;
} else
DocPrint(doc,"%08X ",*ptr(U64 *)++);
if (dynamic)
{
doc_e = DocPrint(doc, "$$DA-TRM+RD+UD,RT=U64,A=\"%%08X\"$$ ");
doc_e->data = ptr(U64 *)++;
}
else
DocPrint(doc, "%08X ", *ptr(U64 *)++);
break;
case RT_F64:
if (dynamic) {
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=F64,A=\"%%16g\"$$ ");
doc_e->data=ptr(F64 *)++;
} else
DocPrint(doc,"%16g ",*ptr(I64 *)++);
if (dynamic)
{
doc_e = DocPrint(doc, "$$DA-TRM+RD+UD,RT=F64,A=\"%%16g\"$$ ");
doc_e->data = ptr(F64 *)++;
}
else
DocPrint(doc, "%16g ", *ptr(I64 *)++);
break;
default:
if (dynamic) {
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,A=\"%%016X\"$$ ");
doc_e->data=ptr(I64 *)++;
} else
DocPrint(doc,"%016X ",*ptr(I64 *)++);
if (dynamic)
{
doc_e = DocPrint(doc, "$$DA-TRM+RD+UD,A=\"%%016X\"$$ ");
doc_e->data = ptr(I64 *)++;
}
else
DocPrint(doc, "%016X ", *ptr(I64 *)++);
}
if (dynamic)
DocDataFormat(doc,doc_e);
DocDataFormat(doc, doc_e);
}
if (j<ml->dim.total_count)
DocPrint(doc,"...");
} else
DocPrint(doc,"%016X",*ptr);
if (j < ml->dim.total_count)
DocPrint(doc, "...");
}
else
DocPrint(doc, "%016X", *ptr);
DocPrint(doc,"\n");
} else {
if (depth<2) {
if (stars==1 && !CheckPtr(*ptr))
DocPrint(doc,"%-20ts:%016X\n",ml->str,*ptr);
else {
DocPrint(doc,"$$TR,\"%s\"$$\n",ml->str);
DocPrint(doc,"$$ID,2$$");
if (!stars)
ClassRep2(doc,ptr,tmpc2->str,u8_chars,force,depth+1,max_depth,dynamic);
else if (stars==1)
ClassRep2(doc,*ptr,tmpc2->str,u8_chars,force,depth+1,max_depth,dynamic);
DocPrint(doc,"$$ID,-2$$");
}
} else
DocPrint(doc,"%-20ts\n",ml->str);
}
ml=ml->next;
else
{
if (depth < 2)
{
if (stars == 1 && !CheckPtr(*ptr))
DocPrint(doc, "%-20ts:%016X\n", ml->str, *ptr);
else
{
DocPrint(doc, "$$TR,\"%s\"$$\n", ml->str);
DocPrint(doc, "$$ID,2$$");
if (!stars)
ClassRep2(doc, ptr, tmpc2->str, u8_chars, force, depth + 1, max_depth, dynamic);
else if (stars == 1)
ClassRep2(doc, *ptr, tmpc2->str, u8_chars, force, depth + 1, max_depth, dynamic);
DocPrint(doc, "$$ID,-2$$");
}
}
else
DocPrint(doc, "%-20ts\n", ml->str);
}
ml = ml->next;
}
if (unlock)
DocUnlock(doc);
@ -163,95 +207,104 @@ public U0 ClassRep(U8 *_d, U8 *class_name=lastclass, I64 max_depth=2, Bool u8_ch
I64 type;
if (IsRaw)
doc=DocNew;
doc = DocNew;
else
{
DocMax;
doc=DocPut;
doc = DocPut;
}
if(fun)
type=HTT_FUN;
type = HTT_FUN;
else
type=HTT_CLASS;
type = HTT_CLASS;
ClassRep2(doc,_d,class_name,u8_chars,force,0,max_depth,FALSE,type,offset);
ClassRep2(doc, _d, class_name, u8_chars, force, 0, max_depth, FALSE, type, offset);
DocPrint(doc,"\n");
DocPrint(doc, "\n");
DocRecalc(doc);
if (IsRaw)
{
DocDump(doc,100000);
DocDump(doc, 100000);
DocDel(doc);
}
}
public U0 ClassRepD(U8 *_d,U8 *class_name=lastclass,
I64 max_depth=2,Bool u8_chars=FALSE,Bool force=FALSE,Bool fun=FALSE,I64 offset=0)
public U0 ClassRepD(U8 *_d, U8 *class_name=lastclass, I64 max_depth=2, Bool u8_chars=FALSE, Bool force=FALSE, Bool fun=FALSE, I64 offset=0)
{//Dynamic ClassRep. Uses hex_ed widget for live changes.
CDoc *doc;
if (IsRaw)
doc=DocNew;
else {
doc = DocNew;
else
{
DocMax;
doc=DocPut;
doc = DocPut;
}
if (fun)
ClassRep2(doc,_d,class_name,u8_chars,force,0,max_depth,TRUE,HTT_FUN,offset);
ClassRep2(doc, _d, class_name, u8_chars, force, 0, max_depth, TRUE, HTT_FUN, offset);
else
ClassRep2(doc,_d,class_name,u8_chars,force,0,max_depth,TRUE,HTT_CLASS,offset);
DocPrint(doc,"\n");
ClassRep2(doc, _d, class_name, u8_chars, force, 0, max_depth, TRUE, HTT_CLASS, offset);
DocPrint(doc, "\n");
DocRecalc(doc);
if (IsRaw) {
DocDump(doc,100000);
if (IsRaw)
{
DocDump(doc, 100000);
DocDel(doc);
}
}
U0 UpdateRegVarImg(CHashFun *tmpf,U8 *_b,CTask *task)
U0 UpdateRegVarImg(CHashFun *tmpf, U8 *_b,CTask *task)
{
CMemberList *ml;
CHashClass *tmpc;
ml=tmpf->member_list_and_root;
while (ml) {
if (ml->reg!=REG_NONE) {
tmpc=OptClassFwd(ml->member_class);
MemCopy(_b+ml->offset,TaskRegAddr(task,ml->reg),tmpc->size);
ml = tmpf->member_list_and_root;
while (ml)
{
if (ml->reg != REG_NONE)
{
tmpc = OptClassFwd(ml->member_class);
MemCopy(_b + ml->offset, TaskRegAddr(task, ml->reg), tmpc->size);
}
ml=ml->next;
ml = ml->next;
}
}
public U0 FunRep(U8 *st,U8 *rbp=NULL,I64 max_depth=2,CTask *task=NULL)
public U0 FunRep(U8 *st, U8 *rbp=NULL, I64 max_depth=2, CTask *task=NULL)
{//Shows names and vals of a fun's local vars using compiler's info.
I64 size;
U8 *img;
CHashFun *tmpf=HashFind(st,Fs->hash_table,HTT_FUN);
CHashFun *tmpf = HashFind(st, Fs->hash_table, HTT_FUN);
CMemberList *tmpm;
if (tmpf) {
if (rbp) {
if (task) {
//tmpf->size is negative. It's the bottom
//of the fun local var space relative to RBP .
size=tmpf->arg_count*8-tmpf->size+16;
if (tmpf)
{
if (rbp)
{
if (task)
{ //tmpf->size is negative. It's the bottom
//of the fun local var space relative to RBP.
size = tmpf->arg_count * 8 - tmpf->size + 16;
img=MAlloc(size);
MemCopy(img,rbp+tmpf->size,size);
UpdateRegVarImg(tmpf,img-tmpf->size,task);
ClassRep(img-tmpf->size,st,max_depth,FALSE,FALSE,TRUE,rbp-img+tmpf->size);
img = MAlloc(size);
MemCopy(img, rbp + tmpf->size, size);
UpdateRegVarImg(tmpf, img - tmpf->size, task);
ClassRep(img - tmpf->size, st, max_depth, FALSE, FALSE, TRUE, rbp - img + tmpf->size);
Free(img);
} else
ClassRep(rbp,st,max_depth,FALSE,FALSE,TRUE);
} else {
tmpm=tmpf->member_list_and_root;
while (tmpm) {
if (0<=tmpm->reg<REG_REGS_NUM)
"%08Z %s\n",tmpm->reg,"ST_U64_REGS",tmpm->str;
else
"%08tX %s\n",tmpm->offset,tmpm->str;
tmpm=tmpm->next;
}
"%08tX Stack Size\n",tmpf->size;
else
ClassRep(rbp, st, max_depth, FALSE, FALSE, TRUE);
}
else
{
tmpm = tmpf->member_list_and_root;
while (tmpm)
{
if (0 <= tmpm->reg < REG_REGS_NUM)
"%08Z %s\n", tmpm->reg, "ST_U64_REGS", tmpm->str;
else
"%08tX %s\n", tmpm->offset, tmpm->str;
tmpm = tmpm->next;
}
"%08tX Stack Size\n", tmpf->size;
}
}
}
@ -262,15 +315,17 @@ public U0 Uf(U8 *st)
I64 i;
CHashSrcSym *tmpf;
CDebugInfo *debug_info;
if (tmpf=HashFind(st,Fs->hash_table,HTT_FUN|HTT_EXPORT_SYS_SYM)) {
if (tmpf->type&HTT_FUN)
if (tmpf = HashFind(st, Fs->hash_table, HTT_FUN | HTT_EXPORT_SYS_SYM))
{
if (tmpf->type & HTT_FUN)
FunRep(st);
if (debug_info=tmpf->debug_info) {
i=debug_info->body[debug_info->max_line+1-debug_info->min_line]
-debug_info->body[0];
Un(debug_info->body[0],i);
"Code Size:%04X\n",i;
} else
if (debug_info = tmpf->debug_info)
{
i = debug_info->body[debug_info->max_line + 1 - debug_info->min_line] - debug_info->body[0];
Un(debug_info->body[0], i);
"Code Size:%04X\n", i;
}
else
U(HashVal(tmpf));
}
}

View file

@ -2,37 +2,32 @@
U0 LoadDocDefines()
{
CBinFile *bfh=mem_boot_base-sizeof(CBinFile);
CBinFile *bfh = mem_boot_base - sizeof(CBinFile);
DefinePrint("DD_OS_NAME_VERSION","ZenithOS V%0.2f",sys_os_version);
DefinePrint("DD_TEMPLEOS_AGE","%0.1f",
(Now-Str2Date("8/1/2003"))/ToF64(1<<32)/CDATE_YEAR_DAYS);
DefinePrint("DD_OS_NAME_VERSION", "ZenithOS V%0.2f", sys_os_version);
DefinePrint("DD_TEMPLEOS_AGE", "%0.1f", (Now - Str2Date("8/1/2003")) / ToF64(1 << 32) / CDATE_YEAR_DAYS);
DefinePrint("DD_KERNEL","%08X",bfh);
bfh(I64)+=bfh->file_size-1;
DefinePrint("DD_KERNEL_END","%08X",bfh);
DefinePrint("DD_KERNEL", "%08X", bfh);
bfh(I64) += bfh->file_size - 1;
DefinePrint("DD_KERNEL_END", "%08X", bfh);
//$LK,"DD_BOOT_HIGH_LOC_DVD",A="FF:::/Zenith/Boot/BootDVD.CC,DD_BOOT_HIGH_LOC_DVD"$
$TR,"LineRep"$
$ID,2$DefinePrint("DD_TEMPLEOS_LOC","80,849");
$ID,2$DefinePrint("DD_TEMPLEOS_LOC", "80,849");
$ID,-2$
DefinePrint("DD_MP_VECT","%08X",MP_VECT_ADDR);
DefinePrint("DD_MP_VECT_END","%08X",
MP_VECT_ADDR+COREAP_16BIT_INIT_END-COREAP_16BIT_INIT-1);
DefinePrint("DD_MP_VECT", "%08X", MP_VECT_ADDR);
DefinePrint("DD_MP_VECT_END", "%08X", MP_VECT_ADDR + COREAP_16BIT_INIT_END - COREAP_16BIT_INIT - 1);
DefinePrint("DD_SYS_FIXED_AREA_BASE","%08X",SYS_FIXED_AREA);
DefinePrint("DD_SYS_FIXED_AREA_END","%08X",
SYS_FIXED_AREA+sizeof(CSysFixedArea)-1);
DefinePrint("DD_MEM_HEAP_BASE","%08X",mem_heap_base);
DefinePrint("DD_MEM_HEAP_LIMIT","%08X",mem_heap_limit);
DefinePrint("DD_MEM_MIN_MEG","%dMeg",MEM_MIN_MEG);
DefinePrint("DD_UNCACHED_ALIAS","%010X",dev.uncached_alias);
DefinePrint("DD_PHYSICAL_SPACE_END","%010X",
mem_physical_space-1);
DefinePrint("DD_MAPPED_SPACE_END","%010X",
mem_mapped_space-1);
DefinePrint("DD_JIFFY_HZ","%dHz",JIFFY_FREQ);
DefinePrint("DD_SYS_FIXED_AREA_BASE", "%08X", SYS_FIXED_AREA);
DefinePrint("DD_SYS_FIXED_AREA_END", "%08X", SYS_FIXED_AREA + sizeof(CSysFixedArea) - 1);
DefinePrint("DD_MEM_HEAP_BASE", "%08X", mem_heap_base);
DefinePrint("DD_MEM_HEAP_LIMIT", "%08X", mem_heap_limit);
DefinePrint("DD_MEM_MIN_MEG", "%dMeg", MEM_MIN_MEG);
DefinePrint("DD_UNCACHED_ALIAS", "%010X", dev.uncached_alias);
DefinePrint("DD_PHYSICAL_SPACE_END", "%010X", mem_physical_space - 1);
DefinePrint("DD_MAPPED_SPACE_END", "%010X", mem_mapped_space - 1);
DefinePrint("DD_JIFFY_HZ", "%dHz", JIFFY_FREQ);
}
LoadDocDefines;

View file

@ -1,94 +1,88 @@
extern U0 ACDDef(I64 n,CTask *parent=NULL);
extern U0 ACDDefsPut(CDoc *doc=NULL,U8 *st,I64 num=-1);
extern U0 ACDFillin(I64 n);
extern U0 ACFillIn(I64 n);
extern U0 ACMan(I64 n,CTask *parent_task=NULL);
extern I64 ZenithFile(U8 *filename,Bool warn_ext=TRUE);
extern Bool AutoComplete(Bool val=OFF);
extern U0 ClipDel();
extern CCtrl *CtrlFindUnique(CTask *haystack_task,I64 needle_type);
extern Bool CtrlInside(CCtrl *c,I64 x,I64 y);
extern U8 *DC2Sprite(CDC *tmpb);
extern U0 DocBinDel(CDoc *doc,CDocBin *b);
extern U0 DocBinsValidate(CDoc *doc);
extern U0 DocBottom(CDoc *doc=NULL);
extern U0 DocCenter(CDoc *doc=NULL,I64 recalc_flags=RECALCt_NORMAL);
extern U0 DocClear(CDoc *doc=NULL,Bool clear_holds=FALSE);
extern Bool DocCursor(Bool show=OFF,CDoc *doc=NULL);
extern U0 DocD(U8 *buf,I64 count=0x80);
extern U0 DocDataFormat(CDoc *doc,CDocEntry *doc_e,I64 d=DOCM_CANCEL);
extern U0 DocDel(CDoc *doc);
extern U0 ACDDef(I64 n, CTask *parent=NULL);
extern U0 ACDDefsPut(CDoc *doc=NULL, U8 *st, I64 num=-1);
extern U0 ACDFillin(I64 n);
extern U0 ACFillIn(I64 n);
extern U0 ACMan(I64 n, CTask *parent_task=NULL);
extern I64 ZenithFile(U8 *filename, Bool warn_ext=TRUE);
extern Bool AutoComplete(Bool val=OFF);
extern U0 ClipDel();
extern CCtrl *CtrlFindUnique(CTask *haystack_task, I64 needle_type);
extern Bool CtrlInside(CCtrl *c, I64 x, I64 y);
extern U8 *DC2Sprite(CDC *tmpb);
extern U0 DocBinDel(CDoc *doc, CDocBin *b);
extern U0 DocBinsValidate(CDoc *doc);
extern U0 DocBottom(CDoc *doc=NULL);
extern U0 DocCenter(CDoc *doc=NULL, I64 recalc_flags=RECALCt_NORMAL);
extern U0 DocClear(CDoc *doc=NULL, Bool clear_holds=FALSE);
extern Bool DocCursor(Bool show=OFF, CDoc *doc=NULL);
extern U0 DocD(U8 *buf, I64 count=0x80);
extern U0 DocDataFormat(CDoc *doc, CDocEntry *doc_e, I64 d=DOCM_CANCEL);
extern U0 DocDel(CDoc *doc);
extern CDoc *DocDisplay(CTask *task=NULL);
extern U0 DocDump(CDoc *doc,I64 uS_delay=0);
extern CDocEntry *DocEntryCopy(CDoc *doc,CDocEntry *doc_e);
extern U0 DocEntryDel(CDoc *doc,CDocEntry *doc_e);
extern Bool DocForm(U8 *_d,U8 *class_name=lastclass,
I64 dof_flags=0,U8 *header=NULL,U8 *footer=NULL);
extern U0 DocHelpIdx(CDoc *doc,U8 *idx);
extern Bool DocHighlightCursor(Bool show=OFF,CDoc *doc=NULL);
extern U0 DocInsDoc(CDoc *doc=NULL,CDoc *doc2);
extern U0 DocInsEntry(CDoc *doc,CDocEntry *doc_e);
extern Bool DocLock(CDoc *doc);
extern I64 DocMax(I64 i=I64_MAX);
extern CDoc *DocNew(U8 *filename=NULL,CTask *task=NULL);
extern CDocEntry *DocPrint(CDoc *doc=NULL,U8 *format,...);
extern U0 DocDump(CDoc *doc, I64 uS_delay=0);
extern CDocEntry *DocEntryCopy(CDoc *doc, CDocEntry *doc_e);
extern U0 DocEntryDel(CDoc *doc, CDocEntry *doc_e);
extern Bool DocForm(U8 *_d, U8 *class_name=lastclass, I64 dof_flags=0, U8 *header=NULL, U8 *footer=NULL);
extern U0 DocHelpIdx(CDoc *doc, U8 *idx);
extern Bool DocHighlightCursor(Bool show=OFF, CDoc *doc=NULL);
extern U0 DocInsDoc(CDoc *doc=NULL, CDoc *doc2);
extern U0 DocInsEntry(CDoc *doc, CDocEntry *doc_e);
extern Bool DocLock(CDoc *doc);
extern I64 DocMax(I64 i=I64_MAX);
extern CDoc *DocNew(U8 *filename=NULL, CTask *task=NULL);
extern CDocEntry *DocPrint(CDoc *doc=NULL, U8 *format, ...);
extern CDoc *DocPut(CTask *task=NULL);
extern CDoc *DocRead(U8 *name=NULL,I64 flags=0);
extern Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL);
extern U0 DocReset(CDoc *doc,Bool is_old);
extern CDocEntry *DocSprite(CDoc *doc=NULL,U8 *elems,U8 *format=NULL);
extern U0 DocTop(CDoc *doc=NULL);
extern Bool DocUnlock(CDoc *doc);
extern U0 DocUpdateTaskDocs(CTask *task);
extern U0 DrawCtrls(CTask *task);
extern Bool Ed(U8 *link_st,I64 edf_dof_flags=0);
extern U0 EdCodeTools(CDoc *doc);
extern U8 *EdSprite(I64 bin_num);
extern I64 ExeDoc(CDoc *doc,I64 ccf_flags=0);
extern I64 FindWiz();
extern I64 I64Get(U8 *message=NULL,I64 default=0,I64 lo=I64_MIN,I64 hi=I64_MAX);
extern Bool GrPlot0(CDC *dc,I64 x,I64 y);
extern CMenuEntry *MenuEntryFind(CMenu *haystack_menu,U8 *needle_full_name);
extern CDoc *DocRead(U8 *name=NULL, I64 flags=0);
extern Bool DocRecalc(CDoc *doc, I64 recalc_flags=RECALCt_NORMAL);
extern U0 DocReset(CDoc *doc, Bool is_old);
extern CDocEntry *DocSprite(CDoc *doc=NULL, U8 *elems, U8 *format=NULL);
extern U0 DocTop(CDoc *doc=NULL);
extern Bool DocUnlock(CDoc *doc);
extern U0 DocUpdateTaskDocs(CTask *task);
extern U0 DrawCtrls(CTask *task);
extern Bool Ed(U8 *link_st, I64 edf_dof_flags=0);
extern U0 EdCodeTools(CDoc *doc);
extern U8 *EdSprite(I64 bin_num);
extern I64 ExeDoc(CDoc *doc, I64 ccf_flags=0);
extern I64 FindWiz();
extern I64 I64Get(U8 *message=NULL, I64 default=0, I64 lo=I64_MIN, I64 hi=I64_MAX);
extern Bool GrPlot0(CDC *dc, I64 x, I64 y);
extern CMenuEntry *MenuEntryFind(CMenu *haystack_menu, U8 *needle_full_name);
extern CMenu *MenuFilePush(U8 *filename);
extern U0 MenuPop();
extern U0 MenuPop();
extern CMenu *MenuPush(U8 *st);
extern U8 Mount(Bool caller_is_prtdisk=FALSE);
extern CTask *Noise(I64 mS,F64 min_ona,F64 max_ona);
extern Bool PopUpCancelOk(U8 *header=NULL,U8 *footer=NULL);
extern I64 PopUpColor(U8 *header=NULL,
Bool allow_transparent=TRUE,Bool allow_default=TRUE);
extern I64 PopUpColorDither(U8 *header=NULL);
extern I64 PopUpColorLighting(U8 *header=NULL);
extern I64 PopUpFile(U8 *filename,
Bool warn_ext=TRUE,CTask *parent=NULL,CTask **_pu_task=NULL);
extern Bool PopUpForm(U8 *_d,U8 *class_name=lastclass,
I64 dof_flags=DOF_SIZE_MIN,U8 *header=NULL,U8 *footer=NULL);
extern I64 PopUpI64Get(U8 *message,I64 default,I64 lo=I64_MIN,I64 hi=I64_MAX);
extern U8 *PopUpGetStr(U8 *header=NULL);
extern I64 PopUpMenu(CDoc *doc,I64 dof_flags=0);
extern Bool PopUpNoYes(U8 *header=NULL,U8 *footer=NULL);
extern Bool PopUpOk(U8 *header=NULL,U8 *footer=NULL);
extern I64 PopUpRangeI64(
I64 lo,I64 hi,I64 step=1,U8 *header=NULL,U8 *footer=NULL);
extern Bool PopUpTransform(I64 *r);
extern I64 RedSeaISO(U8 *_iso_filename=NULL,U8 *_src_dir,
U8 *_stage2_filename=NULL);
extern U0 Refresh(I64 count=1,Bool force=FALSE);
extern U0 RegOneTimePopUp(I64 flag_num,U8 *message);
extern Bool RegWrite(U8 *path,U8 *format,...);
extern U0 SettingsPop(CTask *task=NULL,I64 flags=0);
extern CTaskSettings *SettingsPush(CTask *task=NULL,I64 flags=0);
extern U0 TemplateCtrlSlider(CDoc *doc);
extern Bool View();
extern U0 ViewAnglesDel(CTask *task=NULL);
extern U8 Mount(Bool caller_is_prtdisk=FALSE);
extern CTask *Noise(I64 mS, F64 min_ona, F64 max_ona);
extern Bool PopUpCancelOk(U8 *header=NULL, U8 *footer=NULL);
extern I64 PopUpColor(U8 *header=NULL, Bool allow_transparent=TRUE, Bool allow_default=TRUE);
extern I64 PopUpColorDither(U8 *header=NULL);
extern I64 PopUpColorLighting(U8 *header=NULL);
extern I64 PopUpFile(U8 *filename, Bool warn_ext=TRUE, CTask *parent=NULL, CTask **_pu_task=NULL);
extern Bool PopUpForm(U8 *_d, U8 *class_name=lastclass, I64 dof_flags=DOF_SIZE_MIN, U8 *header=NULL, U8 *footer=NULL);
extern I64 PopUpI64Get(U8 *message, I64 default, I64 lo=I64_MIN, I64 hi=I64_MAX);
extern U8 *PopUpGetStr(U8 *header=NULL);
extern I64 PopUpMenu(CDoc *doc, I64 dof_flags=0);
extern Bool PopUpNoYes(U8 *header=NULL, U8 *footer=NULL);
extern Bool PopUpOk(U8 *header=NULL, U8 *footer=NULL);
extern I64 PopUpRangeI64(I64 lo, I64 hi, I64 step=1, U8 *header=NULL, U8 *footer=NULL);
extern Bool PopUpTransform(I64 *r);
extern I64 RedSeaISO(U8 *_iso_filename=NULL, U8 *_src_dir, U8 *_stage2_filename=NULL);
extern U0 Refresh(I64 count=1, Bool force=FALSE);
extern U0 RegOneTimePopUp(I64 flag_num, U8 *message);
extern Bool RegWrite(U8 *path, U8 *format, ...);
extern U0 SettingsPop(CTask *task=NULL, I64 flags=0);
extern CTaskSettings *SettingsPush(CTask *task=NULL, I64 flags=0);
extern U0 TemplateCtrlSlider(CDoc *doc);
extern Bool View();
extern U0 ViewAnglesDel(CTask *task=NULL);
extern CCtrl *ViewAnglesNew(CTask *task=NULL);
extern Bool WinBorder(Bool val=OFF,CTask *task=NULL);
extern CDoc *WinCursorPosSet(CTask *task,I64 mouse_x,I64 mouse_y,Bool set_cursor=TRUE);
extern Bool WinHorz(I64 left,I64 right,CTask *task=NULL);
extern U0 WinMax(CTask *task=NULL);
extern U0 WinScrollNull(CTask *task,CD3I64 *s);
extern U0 WinScrollRestore(CTask *task,CD3I64 *s);
extern U0 WinScrollsInit(CTask *task);
extern I64 WinToTop(CTask *task=NULL,Bool update_z_buf=TRUE);
extern Bool WinVert(I64 top,I64 bottom,CTask *task=NULL);
extern Bool WinBorder(Bool val=OFF, CTask *task=NULL);
extern CDoc *WinCursorPosSet(CTask *task, I64 mouse_x, I64 mouse_y, Bool set_cursor=TRUE);
extern Bool WinHorz(I64 left, I64 right, CTask *task=NULL);
extern U0 WinMax(CTask *task=NULL);
extern U0 WinScrollNull(CTask *task, CD3I64 *s);
extern U0 WinScrollRestore(CTask *task, CD3I64 *s);
extern U0 WinScrollsInit(CTask *task);
extern I64 WinToTop(CTask *task=NULL, Bool update_z_buf=TRUE);
extern Bool WinVert(I64 top, I64 bottom, CTask *task=NULL);
extern CWinMgrGlobals winmgr;

View file

@ -5,37 +5,39 @@ class CWho
U8 *idx;
};
I64 HashEntriesCompare(CWho *h1,CWho *h2)
I64 HashEntriesCompare(CWho *h1, CWho *h2)
{
I64 i1,i2;
if (i1=StrCompare(h1->h->str,h2->h->str))
I64 i1, i2;
if (i1 = StrCompare(h1->h->str, h2->h->str))
return i1;
i1=HashTypeNum(h1->h);
i2=HashTypeNum(h2->h);
return i1-i2;
i1 = HashTypeNum(h1->h);
i2 = HashTypeNum(h2->h);
return i1 - i2;
}
I64 HashEntriesCompare2(CWho *h1,CWho *h2)
I64 HashEntriesCompare2(CWho *h1, CWho *h2)
{
CHashFun *tmpf1=h1->h,*tmpf2=h2->h;
I64 i1=HashVal(tmpf1),i2=HashVal(tmpf2);
if (i1==i2) {
i1=HashTypeNum(tmpf1);
i2=HashTypeNum(tmpf2);
if (i1==i2)
return StrCompare(tmpf1->str,tmpf2->str);
CHashFun *tmpf1 = h1->h, *tmpf2 = h2->h;
I64 i1 = HashVal(tmpf1), i2 = HashVal(tmpf2);
if (i1 == i2)
{
i1 = HashTypeNum(tmpf1);
i2 = HashTypeNum(tmpf2);
if (i1 == i2)
return StrCompare(tmpf1->str, tmpf2->str);
}
return i1-i2;
return i1 - i2;
}
I64 HelpIndexCount(U8 *ptr,U8 *idx)
I64 HelpIndexCount(U8 *ptr, U8 *idx)
{
I64 count=0,ch,idx_len=StrLen(idx);
while (*ptr) {
if (!StrNCompare(ptr,idx,idx_len))
I64 count = 0, ch, idx_len = StrLen(idx);
while (*ptr)
{
if (!StrNCompare(ptr, idx, idx_len))
count++;
while (ch=*ptr++)
if (ch==';')
while (ch = *ptr++)
if (ch == ';')
break;
if (!ch)
ptr--;
@ -43,265 +45,294 @@ I64 HelpIndexCount(U8 *ptr,U8 *idx)
return count;
}
U8 *HelpIndexStr(U8 **_ptr,U8 *idx)
U8 *HelpIndexStr(U8 **_ptr, U8 *idx)
{
U8 *ptr=*_ptr,*ptr2,*res;
I64 ch,idx_len=StrLen(idx);
while (*ptr) {
ptr2=ptr;
while (ch=*ptr++)
if (ch==';')
U8 *ptr = *_ptr, *ptr2, *res;
I64 ch, idx_len = StrLen(idx);
while (*ptr)
{
ptr2 = ptr;
while (ch = *ptr++)
if (ch == ';')
break;
if (!ch)
ptr--;
*_ptr=ptr;
if (!StrNCompare(ptr2,idx,idx_len)) {
if (ch==';')
*_ptr = ptr;
if (!StrNCompare(ptr2, idx, idx_len))
{
if (ch == ';')
ptr--;
*ptr=0;
res=StrNew(ptr2);
*ptr=ch;
*ptr = 0;
res = StrNew(ptr2);
*ptr = ch;
return res;
}
}
return NULL;
}
U8 *HelpComment(CTask *task,CHash *tmph,U8 *_src_link)
U8 *HelpComment(CTask *task, CHash *tmph, U8 *_src_link)
{
CDoc *doc;
CDocEntry *doc_e;
U8 *res=NULL,*ptr,*ptr2,*src_link=StrNew(_src_link);
U8 *res = NULL, *ptr, *ptr2, *src_link = StrNew(_src_link);
if (*src_link=='F' && src_link[2]==':')
*src_link='P';
XTalkWait(task,"Ed(0x%X,DOF_DONT_WINMGR_SYNC|DOF_DONT_SHOW);\n",src_link);
if (*src_link == 'F' && src_link[2] == ':')
*src_link = 'P';
XTalkWait(task, "Ed(0x%X, DOF_DONT_WINMGR_SYNC | DOF_DONT_SHOW);\n", src_link);
Free(src_link);
doc=DocPut(task);
doc_e=doc->cur_entry;
if (tmph->type&HTT_FUN) {
if (Bt(&tmph(CHashFun *)->flags,Ff__EXTERN) ||
Bt(&tmph(CHashFun *)->flags,Ff_INTERNAL))
while (doc_e!=doc &&
(!(doc_e->de_flags&DOCEF_TAG)||!StrOcc(doc_e->tag,';')))
doc_e=doc_e->next;
doc = DocPut(task);
doc_e = doc->cur_entry;
if (tmph->type & HTT_FUN)
{
if (Bt(&tmph(CHashFun *)->flags, Ff__EXTERN) || Bt(&tmph(CHashFun *)->flags, Ff_INTERNAL))
while (doc_e != doc && (!(doc_e->de_flags & DOCEF_TAG) || !StrOcc(doc_e->tag, ';')))
doc_e = doc_e->next;
else
while (doc_e!=doc &&
(!(doc_e->de_flags&DOCEF_TAG)||!StrOcc(doc_e->tag,'{')))
doc_e=doc_e->next;
while (doc_e != doc && (!(doc_e->de_flags & DOCEF_TAG) || !StrOcc(doc_e->tag, '{')))
doc_e = doc_e->next;
}
if (doc_e!=doc) {
if (doc_e->de_flags&DOCEF_TAG) {
ptr=doc_e->tag;
if (ptr2=StrMatch("//",ptr))
ptr=ptr2+2;
else if (ptr2=StrMatch("/*",ptr))
ptr=ptr2+2;
else if (!StrNCompare(ptr,"public",6))
ptr+=6;
while (*ptr==CH_SPACE)
if (doc_e != doc)
{
if (doc_e->de_flags & DOCEF_TAG)
{
ptr = doc_e->tag;
if (ptr2 = StrMatch("//", ptr))
ptr = ptr2 + 2;
else if (ptr2 = StrMatch("/*", ptr))
ptr = ptr2 + 2;
else if (!StrNCompare(ptr, "public", 6))
ptr += 6;
while (*ptr == CH_SPACE)
ptr++;
res=StrNew(ptr);
doc_e=doc_e->next;
res = StrNew(ptr);
doc_e = doc_e->next;
}
while (doc_e!=doc && doc_e->type_u8!=DOCT_NEW_LINE) {
if (doc_e->type_u8==DOCT_TAB) {
ptr=MStrPrint("%s ",res);
while (doc_e != doc && doc_e->type_u8 != DOCT_NEW_LINE)
{
if (doc_e->type_u8 == DOCT_TAB)
{
ptr = MStrPrint("%s ", res);
Free(res);
res=ptr;
} else if (doc_e->de_flags&DOCEF_TAG) {
ptr=MStrPrint("%s%s",res,doc_e->tag);
Free(res);
res=ptr;
res = ptr;
}
doc_e=doc_e->next;
else if (doc_e->de_flags & DOCEF_TAG)
{
ptr = MStrPrint("%s%s", res, doc_e->tag);
Free(res);
res = ptr;
}
doc_e = doc_e->next;
}
}
XTalkWait(task,"%c",CH_SHIFT_ESC);
if (res) {
ptr=MStrUtil(res,SUF_REM_TRAILING|SUF_REM_LEADING|SUF_SINGLE_SPACE);
XTalkWait(task, "%c", CH_SHIFT_ESC);
if (res)
{
ptr = MStrUtil(res, SUF_REM_TRAILING | SUF_REM_LEADING | SUF_SINGLE_SPACE);
Free(res);
res=ptr;
res = ptr;
}
return res;
}
I64 HashEntriesCompare3(CWho *h1,CWho *h2)
I64 HashEntriesCompare3(CWho *h1, CWho *h2)
{
I64 i,i1=0,i2=0;
i=StrCompare(h1->idx,h2->idx);
I64 i, i1 = 0, i2 = 0;
i = StrCompare(h1->idx, h2->idx);
if (i)
return i;
else {
if (h1->h->type&HTT_HELP_FILE)
i1=1;
if (h2->h->type&HTT_HELP_FILE)
i2=1;
i=i2-i1;
else
{
if (h1->h->type & HTT_HELP_FILE)
i1 = 1;
if (h2->h->type & HTT_HELP_FILE)
i2 = 1;
i = i2 - i1;
if (i)
return i;
else
return StrCompare(h1->h->str,h2->h->str);
return StrCompare(h1->h->str, h2->h->str);
}
}
public U0 Who(U8 *fu_flags=NULL,CHashTable *h=NULL,
U8 *idx=NULL,CDoc *doc=NULL)
{//Dump hash symbol table.
// "+p" for only public symbols
public U0 Who(U8 *fu_flags=NULL, CHashTable *h=NULL, U8 *idx=NULL, CDoc *doc=NULL)
{ //Dump hash symbol table.
// "+p" for only public symbols
// "+m" to order by number (normally alphabetical)
// "-r" just local hash table
CHashTable *table;
CHashSrcSym *tmph;
CHashGeneric *ptr;
CWho *list;
I64 count,i,j,k,f=0;
U8 buf[512],*last_idx=StrNew(""),*cur_idx,*comment;
Bool recurse,publics,map;
I64 count, i, j, k, f = 0;
U8 buf[512], *last_idx = StrNew(""), *cur_idx, *comment;
Bool recurse, publics, map;
CTask *task;
FlagsScan(&f,Define("ST_FILE_UTIL_FLAGS"),"+r");
FlagsScan(&f,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
if (f&~(FUF_RECURSE|FUF_PUBLIC|FUF_MAP))
FlagsScan(&f, Define("ST_FILE_UTIL_FLAGS"), "+r");
FlagsScan(&f, Define("ST_FILE_UTIL_FLAGS"), fu_flags);
if (f & ~(FUF_RECURSE | FUF_PUBLIC | FUF_MAP))
throw('FUF');
recurse=Bt(&f,FUf_RECURSE);
publics=Bt(&f,FUf_PUBLIC);
map =Bt(&f,FUf_MAP);
recurse = Bt(&f, FUf_RECURSE);
publics = Bt(&f, FUf_PUBLIC);
map = Bt(&f, FUf_MAP);
if (!h) h=Fs->hash_table;
if (!h)
h = Fs->hash_table;
if (idx) {
task=User;
if (idx)
{
task = User;
TaskWait(task);
LBtr(&task->display_flags,DISPLAYf_SHOW);
} else
task=NULL;
LBtr(&task->display_flags, DISPLAYf_SHOW);
}
else
task = NULL;
count=0;
table=h;
while (table) {
for (i=0;i<=table->mask;i++) {
tmph=table->body[i];
while (tmph) {
if (!(tmph->type & (HTF_IMPORT | HTF_PRIVATE)) &&
(tmph->type & HTF_PUBLIC || !publics)) {
count = 0;
table = h;
while (table)
{
for (i = 0; i <= table->mask; i++)
{
tmph = table->body[i];
while (tmph)
{
if (!(tmph->type & (HTF_IMPORT | HTF_PRIVATE)) && (tmph->type & HTF_PUBLIC || !publics))
{
if (!idx)
count++;
else if (tmph->type&HTG_SRC_SYM && (cur_idx=tmph->idx))
count+=HelpIndexCount(cur_idx,idx);
else if (tmph->type & HTG_SRC_SYM && (cur_idx = tmph->idx))
count += HelpIndexCount(cur_idx, idx);
}
tmph=tmph->next;
tmph = tmph->next;
}
}
if (recurse)
table=table->next;
table = table->next;
else
break;
}
if (!count) goto wh_done;
list=CAlloc(count*sizeof(CWho));
j=0;
table=h;
while (table) {
for (i=0;i<=table->mask;i++) {
tmph=table->body[i];
while (tmph) {
if (!(tmph->type & (HTF_IMPORT | HTF_PRIVATE)) &&
(tmph->type & HTF_PUBLIC || !publics))
list = CAlloc(count * sizeof(CWho));
j = 0;
table = h;
while (table)
{
for (i = 0; i <= table->mask; i++)
{
tmph = table->body[i];
while (tmph)
{
if (!(tmph->type & (HTF_IMPORT | HTF_PRIVATE)) && (tmph->type & HTF_PUBLIC || !publics))
if (!idx)
list[j++].h=tmph;
else if (tmph->type&HTG_SRC_SYM && (cur_idx=tmph->idx) &&
(k=HelpIndexCount(cur_idx,idx)))
while (k--) {
list[j].idx=HelpIndexStr(&cur_idx,idx);
list[j++].h=tmph;
list[j++].h = tmph;
else if (tmph->type & HTG_SRC_SYM && (cur_idx=tmph->idx) && (k = HelpIndexCount(cur_idx, idx)))
while (k--)
{
list[j].idx = HelpIndexStr(&cur_idx, idx);
list[j++].h = tmph;
}
tmph=tmph->next;
tmph = tmph->next;
}
}
if (recurse)
table=table->next;
table = table->next;
else
break;
}
if (map)
QuickSort(list,count,sizeof(CWho),&HashEntriesCompare2);
QuickSort(list, count, sizeof(CWho), &HashEntriesCompare2);
else if (idx)
QuickSort(list,count,sizeof(CWho),&HashEntriesCompare3);
QuickSort(list, count, sizeof(CWho), &HashEntriesCompare3);
else
QuickSort(list,count,sizeof(CWho),&HashEntriesCompare);
QuickSort(list, count, sizeof(CWho), &HashEntriesCompare);
if (idx) {
progress1_max=count;
progress1=0;
if (idx)
{
progress1_max = count;
progress1 = 0;
}
for (i=0;i<count;i++) {
comment=NULL;
ptr=list[i].h;
for (i = 0; i < count; i++)
{
comment = NULL;
ptr = list[i].h;
if (idx)
if (cur_idx=list[i].idx) {
if (StrCompare(cur_idx,last_idx)) {
if (cur_idx = list[i].idx)
{
if (StrCompare(cur_idx, last_idx))
{
Free(last_idx);
last_idx=StrNew(cur_idx);
last_idx = StrNew(cur_idx);
if (i)
DocPrint(doc,"\n\n");
DocPrint(doc,"$$WW,0$$$$PURPLE$$$$TX+CX,\"%$$Q\"$$$$FG$$\n",cur_idx);
DocPrint(doc, "\n\n");
DocPrint(doc, "$$WW,0$$$$PURPLE$$$$TX+CX,\"%$$Q\"$$$$FG$$\n", cur_idx);
}
}
if (idx && ptr->type & HTT_HELP_FILE) {
DocPrint(doc,"$$WW,1$$");
DocType(doc,ptr->str);
DocPrint(doc,"$$WW,0$$");
} else {
if (ptr->type&HTG_SRC_SYM && ptr(CHashSrcSym *)->src_link) {
DocPrint(doc,"$$LK,\"%-20s\",A=\"%s\"$$",
ptr->str,ptr(CHashSrcSym *)->src_link);
if (idx && ptr->type & HTT_HELP_FILE)
{
DocPrint(doc, "$$WW,1$$");
DocType(doc, ptr->str);
DocPrint(doc, "$$WW,0$$");
}
else
{
if (ptr->type & HTG_SRC_SYM && ptr(CHashSrcSym *)->src_link)
{
DocPrint(doc, "$$LK,\"%-20s\",A=\"%s\"$$", ptr->str, ptr(CHashSrcSym *)->src_link);
if (idx)
comment=HelpComment(task,ptr,ptr(CHashSrcSym *)->src_link);
} else
DocPrint(doc,"%-20s",ptr->str);
if (!idx) {
if (ptr->type & HTT_DEFINE_STR) {
j=ptr(CHashDefineStr *)->count;
if (j==-1)
StrPrint(buf,"%-10t$$Q ",ptr(CHashDefineStr *)->data);
else
StrPrint(buf,"%-10t$$Q %02X",ptr(CHashDefineStr *)->data,j);
} else if (ptr->type & HTT_GLOBAL_VAR)
StrPrint(buf,"%010X ",ptr(CHashGlobalVar *)->data_addr);
else
StrPrint(buf,"%010X ",HashVal(ptr));
j=HashEntrySize(ptr);
if (j==-1)
CatPrint(buf," %04X ",ptr->use_count);
else
CatPrint(buf," %04X %010X ",ptr->use_count,j);
} else
*buf=0;
k=ptr->type;
if (publics)
k&=~HTF_PUBLIC;
if (!(k&HTG_TYPE_MASK))
CatPrint(buf,"NULL ");
while (k) {
j=Bsf(k);
if (j<0)
break;
Btr(&k,j);
CatPrint(buf,"%Z ",j,"ST_HTT_TYPES");
comment = HelpComment(task, ptr, ptr(CHashSrcSym *)->src_link);
}
DocPrint(doc,"%s",buf);
if (comment) {
DocPrint(doc,"$$GREEN$$%s$$FG$$",comment);
else
DocPrint(doc, "%-20s", ptr->str);
if (!idx)
{
if (ptr->type & HTT_DEFINE_STR)
{
j = ptr(CHashDefineStr *)->count;
if (j == -1)
StrPrint(buf, "%-10t$$Q ", ptr(CHashDefineStr *)->data);
else
StrPrint(buf, "%-10t$$Q %02X", ptr(CHashDefineStr *)->data, j);
}
else if (ptr->type & HTT_GLOBAL_VAR)
StrPrint(buf, "%010X ", ptr(CHashGlobalVar *)->data_addr);
else
StrPrint(buf, "%010X ", HashVal(ptr));
j = HashEntrySize(ptr);
if (j == -1)
CatPrint(buf, " %04X ", ptr->use_count);
else
CatPrint(buf, " %04X %010X ", ptr->use_count, j);
}
else
*buf = 0;
k = ptr->type;
if (publics)
k &= ~HTF_PUBLIC;
if (!(k & HTG_TYPE_MASK))
CatPrint(buf, "NULL ");
while (k)
{
j = Bsf(k);
if (j < 0)
break;
Btr(&k, j);
CatPrint(buf, "%Z ", j, "ST_HTT_TYPES");
}
DocPrint(doc, "%s", buf);
if (comment)
{
DocPrint(doc, "$$GREEN$$%s$$FG$$", comment);
Free(comment);
}
DocPrint(doc,"\n");
DocPrint(doc, "\n");
}
Free(list[i].idx);
if (idx)
@ -309,12 +340,13 @@ U8 *idx=NULL,CDoc *doc=NULL)
}
Free(list);
if (idx)
progress1=progress1_max=0;
progress1 = progress1_max = 0;
wh_done:
if (doc) {
if (doc->head.next==doc)
DocPrint(doc,"No Match");
if (doc)
{
if (doc->head.next == doc)
DocPrint(doc, "No Match");
else
DocRecalc(doc);
}
@ -326,104 +358,112 @@ wh_done:
#define HDR_NUM 16
public I64 HashDepthRep(CHashTable *table=NULL)
{//Hash table linked-list chain depth report.
//Histogram of collision count.
I64 i,j,longest=0,count=0,a[HDR_NUM];
{ //Hash table linked-list chain depth report.
//Histogram of collision count.
I64 i, j, longest = 0, count = 0, a[HDR_NUM];
CHash *tmph;
if (!table) table=Fs->hash_table;
MemSet(a,0,sizeof(a));
for (i=0;i<=table->mask;i++) {
tmph=table->body[i];
if (tmph) {
j=LinkedListCount(tmph);
if (j<HDR_NUM)
if (!table)
table = Fs->hash_table;
MemSet(a, 0, sizeof(a));
for (i = 0; i <= table->mask; i++)
{
tmph = table->body[i];
if (tmph)
{
j = LinkedListCount(tmph);
if (j < HDR_NUM)
a[j]++;
count+=j;
if (j>longest)
longest=j;
count += j;
if (j > longest)
longest = j;
}
}
"Histogram\n";
for (i=0;i<HDR_NUM;i++)
for (i = 0; i < HDR_NUM; i++)
if (a[i])
"%02d:%d\n",i,a[i];
"Size:%d Count:%d Longest:%d\n",
table->mask+1,count,longest;
"%02d:%d\n", i, a[i];
"Size:%d Count:%d Longest:%d\n", table->mask + 1, count, longest;
return longest;
}
#help_index "Help System"
#help_file "::/Doc/HelpSystem"
public U0 DocHelpIdx(CDoc *doc,U8 *idx)
public U0 DocHelpIdx(CDoc *doc, U8 *idx)
{//Put to doc report for given help idx.
Who("+p",,idx,doc);
Who("+p",, idx, doc);
}
public U0 PopUpHelpIndex(U8 *idx,CTask *parent=NULL)
public U0 PopUpHelpIndex(U8 *idx, CTask *parent=NULL)
{//PopUp win report for given help idx.
U8 *buf;
buf=MStrPrint("DocHelpIdx(DocPut,\"%s\");View;",idx);
PopUp(buf,parent);
buf = MStrPrint("DocHelpIdx(DocPut, \"%s\"); View;", idx);
PopUp(buf, parent);
Free(buf);
}
#help_index "Hash/System"
public U0 MapFileLoad(U8 *filename)
{//Load map file so we have src line info.
U8 *st,*ptr,*name=ExtDefault(filename,"MAP"),
*absname=FileNameAbs(name);
CDoc *doc=DocRead(name);
U8 *st, *ptr, *name = ExtDefault(filename, "MAP"), *absname = FileNameAbs(name);
CDoc *doc = DocRead(name);
CDocEntry *doc_e;
CHashSrcSym *tmph;
I64 i,j,base=0;
I64 i, j, base=0;
CDebugInfo *debug_info;
FileExtRemove(absname);
if (absname[1]==':' && StrLen(absname)>2 &&
(tmph=HashSingleTableFind(absname+2,Fs->hash_table,HTT_MODULE)))
base=tmph(CHashGeneric *)->user_data0+sizeof(CBinFile);
if (absname[1] == ':' && StrLen(absname) > 2 && (tmph = HashSingleTableFind(absname + 2, Fs->hash_table, HTT_MODULE)))
base = tmph(CHashGeneric *)->user_data0 + sizeof(CBinFile);
if (!doc) return;
doc_e=doc->head.next;
while (doc_e!=doc) {
if (doc_e->type_u8==DOCT_LINK) {
doc_e = doc->head.next;
while (doc_e != doc)
{
if (doc_e->type_u8 == DOCT_LINK)
{
if (*doc_e->tag)
st=MStrUtil(doc_e->tag,SUF_REM_TRAILING);
st = MStrUtil(doc_e->tag, SUF_REM_TRAILING);
else
st=MStrUtil(doc_e->aux_str,SUF_REM_TRAILING);
if (tmph=HashSingleTableFind(st,Fs->hash_table,HTG_SRC_SYM)) {
if (*doc_e->tag) {
st = MStrUtil(doc_e->aux_str, SUF_REM_TRAILING);
if (tmph = HashSingleTableFind(st, Fs->hash_table, HTG_SRC_SYM))
{
if (*doc_e->tag)
{
Free(tmph->src_link);
tmph->src_link=doc_e->aux_str;
ptr=tmph->src_link;
if (ptr[0] && ptr[1] && ptr[2]==':') {
if (ptr[3]==':')
ptr[3]=blkdev.boot_drive_let;
else if (ptr[3]=='~')
ptr[3]=*blkdev.home_dir;
tmph->src_link = doc_e->aux_str;
ptr = tmph->src_link;
if (ptr[0] && ptr[1] && ptr[2] == ':')
{
if (ptr[3] == ':')
ptr[3] = blkdev.boot_drive_let;
else if (ptr[3] == '~')
ptr[3] = *blkdev.home_dir;
}
doc_e->aux_str=NULL;
doc_e->aux_str = NULL;
}
if (tmph->type&(HTT_FUN|HTT_EXPORT_SYS_SYM) &&
!(debug_info=tmph->debug_info) && doc_e->bin_data &&
(debug_info=doc_e->bin_data->data)) {
if (doc_e->bin_data->size>MSize(debug_info))
if (tmph->type & (HTT_FUN | HTT_EXPORT_SYS_SYM) &&
!(debug_info = tmph->debug_info) && doc_e->bin_data &&
(debug_info = doc_e->bin_data->data))
{
if (doc_e->bin_data->size > MSize(debug_info))
"Corrupt Map Entry\n";
else {
doc_e->bin_data->data=NULL;
tmph->debug_info=debug_info;
for (i=debug_info->min_line;i<=debug_info->max_line+1;i++) {
j=i-debug_info->min_line;
else
{
doc_e->bin_data->data = NULL;
tmph->debug_info = debug_info;
for (i = debug_info->min_line; i <= debug_info->max_line + 1; i++)
{
j = i - debug_info->min_line;
if (debug_info->body[j])
debug_info->body[j]=debug_info->body[j]+base;
debug_info->body[j] = debug_info->body[j] + base;
}
}
}
}
Free(st);
}
doc_e=doc_e->next;
doc_e = doc_e->next;
}
DocDel(doc);
Free(name);

View file

@ -1,135 +1,138 @@
#help_index "Math"
public U0 R2P(F64 *_mag=NULL,F64 *_arg=NULL,F64 x,F64 y)
public U0 R2P(F64 *_mag=NULL, F64 *_arg=NULL, F64 x, F64 y)
{//Rect to polar
//Returns angle in range (-ã,ã]
if (_arg)
*_arg=Arg(x,y);
*_arg = Arg(x, y);
if (_mag)
*_mag=Sqrt(x*x+y*y);
*_mag = Sqrt(x * x + y * y);
}
public U0 P2R(F64 *_x=NULL,F64 *_y=NULL,F64 mag,F64 arg)
public U0 P2R(F64 *_x=NULL, F64 *_y=NULL, F64 mag, F64 arg)
{//Polar to Rect
if (_x)
*_x=mag*Cos(arg);
*_x = mag * Cos(arg);
if (_y)
*_y=mag*Sin(arg);
*_y = mag * Sin(arg);
}
public F64 Wrap(F64 é,F64 base=-ã)
public F64 Wrap(F64 é, F64 base=-ã)
{//Returns angle in range [base,base+2*ã)
F64 res=é%(2*ã);
if (res>=base+2*ã)
res-=2*ã;
else if (res<base)
res+=2*ã;
F64 res = é % (2 * ã);
if (res >= base + 2 * ã)
res -= 2 * ã;
else if (res < base)
res += 2 * ã;
return res;
}
public I64 DistSqrI64(I64 x1,I64 y1,I64 x2,I64 y2)
public I64 DistSqrI64(I64 x1, I64 y1, I64 x2, I64 y2)
{//Distance-squared between 2 points.
I64 dx=x1-x2,dy=y1-y2;
return dx*dx+dy*dy;
I64 dx = x1 - x2, dy = y1 - y2;
return dx * dx + dy * dy;
}
public F64 ASin(F64 s)
{//Arc Sin (Inverse Sin).
F64 c;
c=s*s;
if (c>=1.0)
return ã/2.0;
c=Sqrt(1.0-c);
return ATan(s/c);
c = s * s;
if (c >= 1.0)
return ã / 2.0;
c = Sqrt(1.0 - c);
return ATan(s / c);
}
public F64 ACos(F64 c)
{//Arc Cos (Inverse Cos).
F64 s;
if (!c)
return ã/2.0;
s=c*c;
if (s>=1.0)
return ã / 2.0;
s = c * c;
if (s >= 1.0)
return 0.0;
s=Sqrt(1.0-s);
return ATan(s/c);
s = Sqrt(1.0 - s);
return ATan(s / c);
}
public F64 Sinh(F64 x)
{//Hyperbolic Sine.
return 0.5*(Exp(x)-Exp(-x));
return 0.5 * (Exp(x) - Exp(-x));
}
public F64 Cosh(F64 x)
{//Hyperbolic Cosine.
return 0.5*(Exp(x)+Exp(-x));
return 0.5 * (Exp(x) + Exp(-x));
}
#help_index "Math/Complex;Data Types/Complex"
public Complex *CAdd(Complex *sum,Complex *n1,Complex *n2)
public Complex *CAdd(Complex *sum, Complex *n1, Complex *n2)
{//sum=n1+n2
sum->x=n1->x+n2->x;
sum->y=n1->y+n2->y;
sum->x = n1->x + n2->x;
sum->y = n1->y + n2->y;
return sum;
}
public Complex *CSub(Complex *diff,Complex *n1,Complex *n2)
public Complex *CSub(Complex *diff, Complex *n1, Complex *n2)
{//diff=n1-n2
diff->x=n1->x-n2->x;
diff->y=n1->y-n2->y;
diff->x = n1->x - n2->x;
diff->y = n1->y - n2->y;
return diff;
}
public Complex *CMul(Complex *prod,Complex *n1,Complex *n2)
public Complex *CMul(Complex *prod, Complex *n1, Complex *n2)
{//prod=n1*n2
prod->x=n1->x*n2->x-n1->y*n2->y;
prod->y=n1->x*n2->y+n1->y*n2->x;
prod->x = n1->x * n2->x - n1->y * n2->y;
prod->y = n1->x * n2->y + n1->y * n2->x;
return prod;
}
public Complex *CDiv(Complex *quot,Complex *n1,Complex *n2)
public Complex *CDiv(Complex *quot, Complex *n1, Complex *n2)
{//quot=n1/n2
F64 m1,arg1,m2,arg2;
R2P(&m1,&arg1,n1->x,n1->y);
R2P(&m2,&arg2,n2->x,n2->y);
m1/=m2;
arg1-=arg2;
quot->x=m1*Cos(arg1);
quot->y=m1*Sin(arg1);
F64 m1, arg1, m2, arg2;
R2P(&m1, &arg1, n1->x, n1->y);
R2P(&m2, &arg2, n2->x, n2->y);
m1 /= m2;
arg1 -= arg2;
quot->x = m1 * Cos(arg1);
quot->y = m1 * Sin(arg1);
return quot;
}
public Complex *CScale(Complex *dst,F64 s)
public Complex *CScale(Complex *dst, F64 s)
{//dst*=s
dst->x*=s;
dst->y*=s;
dst->x *= s;
dst->y *= s;
return dst;
}
public Complex *CCopy(Complex *dst,Complex *src)
public Complex *CCopy(Complex *dst, Complex *src)
{//dst=src
dst->x=src->x;
dst->y=src->y;
dst->x = src->x;
dst->y = src->y;
return dst;
}
public Complex *CEqu(Complex *dst,F64 x,F64 y)
public Complex *CEqu(Complex *dst, F64 x, F64 y)
{//dst=(x,y)
dst->x=x;
dst->y=y;
dst->x = x;
dst->y = y;
return dst;
}
public Complex *CPoly(Complex *dst,I64 n,Complex *zeros,Complex *x)
public Complex *CPoly(Complex *dst, I64 n, Complex *zeros, Complex *x)
{//Eval complex polynomial
I64 i;
Complex n1,n2;
if (n>0) {
CSub(dst,x,&zeros[0]);
for (i=1;i<n;i++) {
CCopy(&n1,dst);
CMul(dst,&n1,CSub(&n2,x,&zeros[i]));
Complex n1, n2;
if (n > 0)
{
CSub(dst, x, &zeros[0]);
for (i = 1; i < n; i++)
{
CCopy(&n1, dst);
CMul(dst, &n1, CSub(&n2, x, &zeros[i]));
}
} else
CEqu(dst,1.0,0.0);
}
else
CEqu(dst, 1.0, 0.0);
return dst;
}

File diff suppressed because it is too large Load diff

Binary file not shown.