Browse Source

TempleOSCD_150216.ISO

v6
Terry A. Davis 7 years ago committed by minexew
parent
commit
401601816c
  1. BIN
      0000Boot/0000Kernel.BIN.C
  2. 10
      Accts/Adam3.CPP
  3. 26
      Accts/Adam3dWrappers.CPP
  4. 41
      Accts/Adam3eSys.CPP
  5. 16
      Accts/DoOnce.CPP
  6. BIN
      Accts/PersonalMenu.TXT
  7. 105
      Adam.CPP
  8. 16
      Adam/ADbg.CPP
  9. 51
      Adam/ADefine.CPP
  10. 29
      Adam/AExts.HPP
  11. 62
      Adam/AHash.CPP
  12. 0
      Adam/AMath.CPP
  13. 203
      Adam/AMathODE.CPP
  14. 211
      Adam/AUtils.CPP
  15. 72
      Adam/Acct.CPP
  16. 80
      Adam/Adam2.CPP
  17. 0
      Adam/AutoComplete/ACDefs.DAT
  18. 158
      Adam/AutoComplete/ACDict.CPP
  19. 78
      Adam/AutoComplete/ACDictGen.CPP
  20. 342
      Adam/AutoComplete/ACMain.CPP
  21. 0
      Adam/AutoComplete/ACWords.DAT
  22. 67
      Adam/AutoComplete/AutoComplete.CPP
  23. 2
      Adam/AutoFile.CPP
  24. 64
      Adam/Boot/Boot.CPP
  25. 18
      Adam/Boot/BootCD.CPP
  26. 23
      Adam/Boot/BootHD.CPP
  27. 233
      Adam/Boot/BootIns.CPP
  28. 21
      Adam/Boot/BootMHD.CPP
  29. 15
      Adam/Boot/BootMHD2.CPP
  30. 346
      Adam/Boot/InsBoot.CPP
  31. 2
      Adam/Ctrls/Ctrls.CPP
  32. 2
      Adam/Ctrls/CtrlsA.CPP
  33. 2
      Adam/Ctrls/CtrlsButton.CPP
  34. 40
      Adam/Ctrls/CtrlsSlider.CPP
  35. 70
      Adam/DocDefines.CPP
  36. 11
      Adam/DolDoc/Doc.CPP
  37. 65
      Adam/DolDoc/DocCodeTools.CPP
  38. 42
      Adam/DolDoc/DocCtrlL.CPP
  39. 23
      Adam/DolDoc/DocEdA.CPP
  40. 195
      Adam/DolDoc/DocEdB.CPP
  41. 19
      Adam/DolDoc/DocFile.CPP
  42. 4
      Adam/DolDoc/DocInit.CPP
  43. 4
      Adam/DolDoc/DocMacro.CPP
  44. 17
      Adam/DolDoc/DocMain.CPP
  45. 10
      Adam/DolDoc/DocNew.CPP
  46. 43
      Adam/DolDoc/DocPopUp.CPP
  47. 12
      Adam/DolDoc/DocRecalcA.CPP
  48. 10
      Adam/DolDoc/DocRecalcB.CPP
  49. 4
      Adam/Dsk/ADsk.CPP
  50. 85
      Adam/Dsk/ADskA.CPP
  51. 106
      Adam/Dsk/ADskB.CPP
  52. 98
      Adam/Dsk/ChkDsk.CPP
  53. 48
      Adam/Dsk/FileMgr.CPP
  54. 11
      Adam/God/GodBible.CPP
  55. 26
      Adam/God/GodDoodle.CPP
  56. 37
      Adam/God/HSNotes.TXT
  57. 213
      Adam/Gr/Gr.CPP
  58. 414
      Adam/Gr/GrBitMap.CPP
  59. 76
      Adam/Gr/GrDC.CPP
  60. 4
      Adam/Gr/GrEnd.CPP
  61. 10
      Adam/Gr/GrGlbls.CPP
  62. 12
      Adam/Gr/GrInit.CPP
  63. 0
      Adam/Gr/GrMath.CPP
  64. 38
      Adam/Gr/GrPalette.CPP
  65. 2
      Adam/Gr/GrPrimatives.CPP
  66. 28
      Adam/Gr/GrScreen.CPP
  67. 196
      Adam/Gr/GrSpritePlot.CPP
  68. 23
      Adam/Gr/GrTextBase.CPP
  69. 73
      Adam/Gr/SpriteBitMap.CPP
  70. 192
      Adam/Gr/SpriteCode.CPP
  71. 340
      Adam/Gr/SpriteEd.CPP
  72. 403
      Adam/Gr/SpriteMain.CPP
  73. 4
      Adam/Gr/SpriteMesh.CPP
  74. 111
      Adam/Gr/SpriteNew.CPP
  75. 16
      Adam/Menu.CPP
  76. 4
      Adam/Snd/Snd.CPP
  77. 16
      Adam/Snd/SndFile.CPP
  78. 0
      Adam/Snd/SndMath.CPP
  79. 0
      Adam/Snd/SndMusic.CPP
  80. 12
      Adam/Start.CPP
  81. 15
      Adam/TaskSettings.CPP
  82. 2
      Adam/Training.CPP
  83. 169
      Adam/Utils/FileBMP.CPP
  84. 10
      Adam/Utils/Find.CPP
  85. 6
      Adam/Utils/LineRep.CPP
  86. 66
      Adam/Utils/MemRep.CPP
  87. 18
      Adam/Utils/ToHtml.CPP
  88. 2
      Adam/Utils/ToTXT.CPP
  89. 416
      Adam/Utils2a.CPP
  90. BIN
      Adam/WallPaper.CPP
  91. 51
      Adam/WinA.CPP
  92. 130
      Adam/WinB.CPP
  93. 688
      Adam/WordStat/WSMain.CPP
  94. 101
      Adam/WordStat/WordStat.CPP
  95. 68
      AdamKeyPlugIns.CPP
  96. 6
      AdamLocalize.CPP
  97. 10
      AdamPkgs.CPP
  98. 16
      AdamSys.CPP
  99. 26
      AdamWrappers.CPP
  100. BIN
      Apps/AfterEgypt/AESplash.TXT
  101. Some files were not shown because too many files have changed in this diff Show More

BIN
0000Boot/0000Kernel.BIN.C

Binary file not shown.

10
Accts/Adam3.CPP

@ -1,10 +0,0 @@
//Change anything you want in this
//acct file or others.
#include "HOME/Adam3aLocalize"
#include "HOME/Adam3bPkgs"
#include "HOME/Adam3cKeyPlugIns"
#include "HOME/Adam3dWrappers"
#include "HOME/Adam3eSys"
#help_index ""

26
Accts/Adam3dWrappers.CPP

@ -1,26 +0,0 @@
//Change anything you want in this
//acct file or others.
#help_index "Cmd Line (Typically)"
//These are customized quick commands.
//Feel free to add more or change.
public I64 F(U8 *needle_str,U8 *fu_flags=NULL)
{//Find (Grep) all text files.
return Grep(needle_str,"/*",fu_flags);
}
public I64 R(U8 *needle_str,U8 *replace_text=NULL,U8 *fu_flags="+l-i")
{//Find (Grep) and replace string with string in all files.
return Grep(needle_str,"/*",fu_flags,replace_text);
}
public I64 FD(U8 *needle_str,U8 *fu_flags=NULL)
{//Find (Grep) text files in cur dir.
return Grep(needle_str,"*",fu_flags);
}
public I64 RD(U8 *needle_str,U8 *replace_text=NULL,U8 *fu_flags="+l-i")
{//Find (Grep) and replace string with string in cur dir.
return Grep(needle_str,"*",fu_flags,replace_text);
}

41
Accts/Adam3eSys.CPP

@ -1,41 +0,0 @@
//Change anything you want in this
//acct file or others.
U0 UserStartUp()
{//Run each time a user a spawned
DocTermNew;
Type("::/Doc/Start.TXT");
LBts(&Fs->display_flags,DISPLAYf_SHOW);
WinToTop;
WinZBufUpdate;
Preempt(ON);
Dir;
}
U0 SrvStartUp()
{//Run each time a srv task is spawned.
DocTermNew;
LBts(&Fs->display_flags,DISPLAYf_SHOW);
WinToTop;
WinZBufUpdate;
Preempt(ON);
}
U0 StartUpTasks()
{
CTask *user1,*user2;
user1=SpawnUser;
user2=SpawnUser;
WinToTop(user1);
WinTileVert;
PopUp("#include \"::/Adam/Start\";");
"Boot Time:%7.3fs\n",tS;
XTalk(user1,"Cd(\"HOME\");#include \"DoOnce\";\n");
Silent(ON); //no output to screen
WSInit("/*;~*Bible.TXT*");
Silent(OFF); //no output to screen
}
StartUpTasks;
"\nOS Compile Time:%D %T\n",sys_compile_time,sys_compile_time;

16
Accts/DoOnce.CPP

@ -1,16 +0,0 @@
//This file is executed by the
//first terminal window upon start-up.
//See $LK,"DoOnce",A="FF:HOME/Adam3eSys.CPP,DoOnce"$ and $LK,"Acct Files",A="FF:::/Doc/GuideLines.TXT,ACCT FILES"$.
//It goes in your HOME directory and
//you can customize it.
//Delete this to get rid of
//default start-up msg.
Type("::/Doc/Customize.TXT");
"\nTake Tour";
if (YorN) {
Cd("::/Misc/Tour");
AutoFile("Tour");
}

BIN
Accts/PersonalMenu.TXT

Binary file not shown.

105
Adam.CPP

@ -0,0 +1,105 @@
//This is executed by the Adam task at boot.
//See $LK,"Adam Start-up",A="FF:::/Kernel/KEnd.CPP,\"Adam:2"$.
//You do not place this file in /Home. (It would be ignored.)
//but look at the bottom of this file to see
//files you do customize.
extern I8i OptEqu(I64i num,I8i val);
OptEqu(0,0); //(0,0)=EchoOff (0,1)=EchoOn
#include "/Kernel/KernelA.HPP"
#include "/Compiler/CompilerA.HPP"
#include "/Kernel/KernelB.HPP"
#include "/Kernel/KernelC.HPP"
#include "/Compiler/CompilerB.HPP"
Cd("/Adam");;
#exe {OptOn(OPTf_WARN_PAREN);};
#exe {OptOn(OPTf_WARN_DUP_TYPES);};
HashTablePurge(adam_task->hash_table);
#help_index "Misc"
//Use Dbg("Type 'G;'"); to debug before window mgr is running.
public F64 os_version=3.03;//Operating system version.
#include "AExts.HPP"
#include "AMath"
#include "Training"
#include "AUtils"
#include "AMathODE"
Cd("::/Adam/Gr");;
#include "Gr"
Cd("::/Adam/Snd");;
#include "Snd"
Cd("::/Adam/Dsk");;
#include "ADsk"
Cd("::/Adam");;
#include "Menu"
#include "WinA"
#include "WinB"
#include "ADbg"
#include "::/Adam/God/GodExt"
Cd("::/Adam/DolDoc");;
#include "Doc"
LBts(&sys_run_level,RLf_DOC);
Cd("::/Adam/Ctrls");;
#include "Ctrls"
Cd("::/Adam");;
#include "AutoFile"
#include "Acct"
Cd("::/Adam/AutoComplete");;
#include "AutoComplete"
Cd("::/Adam/God");;
#include "God"
Cd("::/Adam");;
#include "AHash"
#include "TaskSettings"
#include "DevInfo"
#include "ADefine"
//Dbg("Type 'G;'");
DocTermNew;
WinVert(2,10);
sys_winmgr_task=Spawn(&WinMgrTask,NULL,"Window Mgr");
Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_BORDER-WIF_SELF_GRAB_SCROLL-WIF_SELF_CTRLS;
LBts(&Fs->display_flags,DISPLAYf_CHILDREN_NOT_ON_TOP);
LBts(&Fs->display_flags,DISPLAYf_SHOW);
RegistryInit;
LBts(&sys_run_level,RLf_REGISTRY);
Cd("::/Adam");;
#include "WallPaper"
if (IsDrvWritable)
MkDir("/Temp"); //Good to have a Temp
#exe {OptOff(OPTf_WARN_PAREN);};
#exe {OptOff(OPTf_WARN_DUP_TYPES);};
LBts(&sys_run_level,RLf_HOME);
#help_index ""
Cd("::/Home");;
//If these are not present in /Home, it uses the version in the root dir.
//You should make your own version of these files in you /Home directory.
#include "::/Home/AdamLocalize"
#include "::/Home/AdamPkgs"
#include "::/Home/AdamKeyPlugIns"
#include "::/Home/AdamWrappers"
#include "::/Home/AdamSys"
//After this file, the Adam task enters $LK,"server mode",A="HI:Task/Srv"$.

16
Adam/Dbg2a.CPP → Adam/ADbg.CPP

@ -1,7 +1,7 @@
#help_index "Debugging/Dump"
Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass,I64 depth,I64 max_depth,Bool dynamic,I64 types=HTT_CLASS,I64 offset=0)
{//See $LK,"::/Demo/LastClass.CPP"$.
I64 i,j,*ptr;
I64 i,j,stars,*ptr;
CMemberLst *ml;
CDocEntry *doc_e;
Bool unlock;
@ -24,12 +24,12 @@ Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass,I64 depth,I64 max_depth
tempc2=ml->member_class;
ptr=_d(U8 *)+ml->offset;
DocPrint(doc,"%08X ",ptr(U8 *)+offset);
j=tempc2->ptr_cnt;
stars=tempc2->ptr_stars_cnt;
tempc2=OptClassFwd(tempc2);
tempc2-=tempc2->ptr_cnt;
tempc2-=tempc2->ptr_stars_cnt;
if (tempc2->type & HTT_INTERNAL_TYPE) {
DocPrint(doc,"$$GREEN$$%-20ts:$$FG$$",ml->str);
if (j==1 && (tempc2->raw_type==RT_I8 || tempc2->raw_type==RT_U8)) {
if (stars==1 && (tempc2->raw_type==RT_I8 || tempc2->raw_type==RT_U8)) {
ptr=*ptr;
if (ChkPtr(ptr)) {
if (dynamic) {
@ -39,7 +39,7 @@ Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass,I64 depth,I64 max_depth
} else
DocPrint(doc,"%40ts\n",ptr);
}
} else if (!j) {
} else if (!stars) {
j=MinI64(ml->dim.total_cnt,32);
if (tempc2->raw_type==RT_I8 || tempc2->raw_type==RT_U8) {
if (j==1) {
@ -128,14 +128,14 @@ Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass,I64 depth,I64 max_depth
DocPrint(doc,"\n");
} else {
if (depth<2) {
if (j==1 && !ChkPtr(*ptr))
if (stars==1 && !ChkPtr(*ptr))
DocPrint(doc,"%-20ts:%016X\n",ml->str,*ptr);
else {
DocPrint(doc,"$$TR,\"%s\"$$\n",ml->str);
DocPrint(doc,"$$ID,2$$");
if (!j)
if (!stars)
ClassRep2(doc,ptr,tempc2->str,depth+1,max_depth,dynamic);
else if (j==1)
else if (stars==1)
ClassRep2(doc,*ptr,tempc2->str,depth+1,max_depth,dynamic);
DocPrint(doc,"$$ID,-2$$");
}

51
Adam/ADefine.CPP

@ -0,0 +1,51 @@
#help_index "Define;Char/Define"
U0 LoadDocDefines()
{
CBinFile *bfh=sys_boot_base-sizeof(CBinFile);
DefinePrint(
"DD_OS_NAME_VERSION","TempleOS V%0.2f",os_version);
DefinePrint(
"DD_TEMPLEOS_AGE","%0.1f",(Now-Str2Date("8/1/2003"))/ToF64(1<<32)/CDATE_YEAR_DAYS);
//This is cut and replaced when I generate a distro.
//See $LK,"DD_TEMPLEOS_LOC",A="FF:::/Demo/AcctExample/TOSDistro.CPP,DD_TEMPLEOS_LOC"$.
$TR-C,"LineRep"$
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","120,789");
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","79,959");
$ID,-4$
DefinePrint(
"DD_KERNEL","%08X",bfh);
bfh(I64)+=bfh->file_size-1;
DefinePrint(
"DD_KERNEL_END","%08X",bfh);
DefinePrint(
"DD_PROTECTED_LOW","%08X",MEM_PROTECTED_LOW_LIMIT);
//$LK,"DD_BOOT_HIGH_LOC_CD",A="FF:::/Adam/Boot/BootCD.CPP,DD_BOOT_HIGH_LOC_CD"$
DefinePrint(
"DD_MP_VECT","%08X",MP_VECT_ADDR);
DefinePrint(
"DD_MP_VECT_END","%08X",MP_VECT_ADDR+AP_16BIT_INIT_END-AP_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_SYS_HEAP_BASE","%08X",sys_heap_base);
DefinePrint(
"DD_SYS_HEAP_LIMIT","%08X",sys_heap_limit);
DefinePrint(
"DD_MEM_MIN_MEG","%d Meg",MEM_MIN_MEG);
DefinePrint(
"DD_MEM_MAPPED_SPACE_GIG","%d Gig",MEM_MAPPED_SPACE/0x40000000);
DefinePrint(
"DD_MEM_MAPPED_SPACE_END","%010X",MEM_MAPPED_SPACE-1);
DefinePrint(
"DD_JIFFY_HZ","%d Hz",JIFFY_FREQ);
}
LoadDocDefines;

29
Adam/AdamExts.HPP → Adam/AExts.HPP

@ -1,13 +1,20 @@
extern U0 ACDDef(I64 n,CTask *parent=NULL);
extern U0 ACDDefsPut(CDoc *doc,U8 *st,I64 num=-1);
extern U0 ACDFillin(I64 n);
extern U0 ACFillIn(I64 n);
extern U0 ACFindMisspelled(CDoc *doc);
extern U0 ACMan(I64 n,CTask *parent=NULL);
extern U0 AcctOneTimePopUp(I64 flag_num,U8 *msg);
extern I64 AdamFile(U8 *filename,Bool warn_ext=TRUE);
extern I64 BMPFileWrite(U8 *filename,CDC *dc,I64 bits=4);
extern Bool AutoComplete(Bool val=OFF);
extern I64 BMPWrite(U8 *filename,CDC *dc,I64 bits=4);
extern I64 CDFileCreate(U8 *_filename=NULL,U8 *src_files_find_mask,U8 *fu_flags=NULL,
U8 *_stage2_filename=NULL);
extern U0 ClipboardDel();
extern CCtrl *CtrlFindUnique(CTask *haystack_task,I64 needle_type);
extern Bool CtrlInside(CCtrl *c,I64 x,I64 y);
extern U8 *DC2Sprite(CDC *tempb);
extern U0 DocBMPFile(CDoc *doc=NULL,U8 *filename,Bool use_ms_paint_palette=FALSE);
extern U0 DocBMP(CDoc *doc=NULL,U8 *filename,Bool dither_probability=FALSE,Bool use_ms_paint_palette=FALSE);
extern U0 DocBinDel(CDoc *doc,CDocBin *b);
extern U0 DocBinsValidate(CDoc *doc);
extern U0 DocBottom(CDoc *doc=NULL);
@ -52,8 +59,7 @@ extern CMenu *MenuFilePush(U8 *filename);
extern U0 MenuPop();
extern CMenu *MenuPush(U8 *st);
extern CTask *Noise(I64 mS,I64 min_freq,I64 max_freq);
extern Bool Plain(U8 *filename);
extern I64 PopUp(U8 *msg,CTask *parent=NULL,CTask **_pu_task=NULL);
extern Bool Plain(U8 *filename,I64 edf_dof_flags=0);
extern Bool PopUpCancelOk(U8 *header=NULL,U8 *footer=NULL);
extern I64 PopUpColor(U8 *header=NULL,Bool allow_transpant=TRUE,Bool allow_dft=TRUE);
extern I64 PopUpColorDither(U8 *header=NULL);
@ -67,27 +73,20 @@ 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 CDoc *SetCursorPos(CTask *task,I64 ip_text_x,I64 ip_text_y,Bool set_cursor=TRUE);
extern Bool SetWinHorz(I64 left,I64 right,CTask *task=NULL);
extern Bool SetWinVert(I64 top,I64 bottom,CTask *task=NULL);
extern U0 SettingsPop(CTask *task=NULL,I64 flags=0);
extern CTaskSettings *SettingsPush(CTask *task=NULL,I64 flags=0);
extern U0 TemplateSliderCtrl(CDoc *doc);
extern U0 TemplateCtrlSlider(CDoc *doc);
extern Bool View();
extern U0 ViewAnglesDel(CTask *task=NULL);
extern CCtrl *ViewAnglesNew(CTask *task=NULL);
extern U0 WSDDef(I64 n,CTask *parent=NULL);
extern U0 WSDDefsPut(CDoc *doc,U8 *st,I64 num=-1);
extern U0 WSDFillin(I64 n);
extern U0 WSFillIn(I64 n);
extern U0 WSFindMisspelled(CDoc *doc);
extern U0 WSMan(I64 n,CTask *parent=NULL);
extern Bool WinBorder(Bool val,CTask *task=NULL);
extern CDoc *WinCursorPosSet(CTask *task,I64 ip_text_x,I64 ip_text_y,Bool set_cursor=TRUE);
extern Bool WinHorz(I64 left,I64 right,CTask *task=NULL);
extern U0 WinMax(CTask *task=NULL);
extern U0 WinMgrSync(I64 cnt=1,Bool force=FALSE);
extern U0 WinScrollNull(CTask *task,CD3I64 *s);
extern U0 WinScrollRestore(CTask *task,CD3I64 *s);
extern U0 WinScrollsInit(CTask *task);
extern Bool WinToTop(CTask *task=NULL,Bool update_z_buf=TRUE);
extern Bool WordStat(Bool val=OFF);
extern Bool WinVert(I64 top,I64 bottom,CTask *task=NULL);
extern CWinMgrGlbls winmgr;

62
Adam/Hash2a.CPP → Adam/AHash.CPP

@ -144,8 +144,8 @@ public U0 Who(U8 *fu_flags=NULL,CHashTable *h=NULL,
U8 *outname=NULL,U8 mapfile_drv=0,U8 *index=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
// "+m" to order by number (normally alphabetical)
// "-r" just local hash table
CHashTable *table;
CHashSrcSym *temph;
CHashGeneric *ptr;
@ -177,7 +177,7 @@ public U0 Who(U8 *fu_flags=NULL,CHashTable *h=NULL,
doc=NULL;
if (index) {
task=SpawnUser;
task=User;
TaskWait(task);
LBtr(&task->display_flags,DISPLAYf_SHOW);
} else
@ -186,16 +186,18 @@ public U0 Who(U8 *fu_flags=NULL,CHashTable *h=NULL,
cnt=0;
table=h;
while (table) {
temph=table->next_added;
while (temph!=table) {
if (!(temph->type & (HTF_IMPORT | HTF_PRIVATE)) &&
(temph->type & HTF_PUBLIC || !publics)) {
if (!index)
cnt++;
else if (temph->type&HTG_SRC_SYM && (cur_index=temph->index))
cnt+=HelpIndexCnt(cur_index,index);
for (i=0;i<=table->mask;i++) {
temph=table->body[i];
while (temph) {
if (!(temph->type & (HTF_IMPORT | HTF_PRIVATE)) &&
(temph->type & HTF_PUBLIC || !publics)) {
if (!index)
cnt++;
else if (temph->type&HTG_SRC_SYM && (cur_index=temph->index))
cnt+=HelpIndexCnt(cur_index,index);
}
temph=temph->next;
}
temph=temph->next_added;
}
if (recurse)
table=table->next;
@ -208,19 +210,21 @@ public U0 Who(U8 *fu_flags=NULL,CHashTable *h=NULL,
j=0;
table=h;
while (table) {
temph=table->next_added;
while (temph!=table) {
if (!(temph->type & (HTF_IMPORT | HTF_PRIVATE)) &&
(temph->type & HTF_PUBLIC || !publics))
if (!index)
lst[j++].h=temph;
else if (temph->type&HTG_SRC_SYM && (cur_index=temph->index) &&
(k=HelpIndexCnt(cur_index,index)))
while (k--) {
lst[j].index=HelpIndexStr(&cur_index,index);
for (i=0;i<=table->mask;i++) {
temph=table->body[i];
while (temph) {
if (!(temph->type & (HTF_IMPORT | HTF_PRIVATE)) &&
(temph->type & HTF_PUBLIC || !publics))
if (!index)
lst[j++].h=temph;
}
temph=temph->next_added;
else if (temph->type&HTG_SRC_SYM && (cur_index=temph->index) &&
(k=HelpIndexCnt(cur_index,index)))
while (k--) {
lst[j].index=HelpIndexStr(&cur_index,index);
lst[j++].h=temph;
}
temph=temph->next;
}
}
if (recurse)
table=table->next;
@ -347,7 +351,7 @@ public U0 Who(U8 *fu_flags=NULL,CHashTable *h=NULL,
if (index)
progress1=progress1_max=0;
wh_done:
wh_done:
Preempt(old_preempt);
if (doc) {
DocBinsValidate(doc);
@ -376,11 +380,7 @@ public I64 HashDepthRep(CHashTable *table=NULL)
for (i=0;i<=table->mask;i++) {
temph=table->body[i];
if (temph) {
j=1;
while (temph->next) {
temph=temph->next;
j++;
}
j=LinkedLstCnt(temph);
if (j<HDR_MAX)
a[j]++;
cnt+=j;
@ -444,7 +444,7 @@ public U0 MapFileLoad(U8 *filename)
ptr=temph->src_link;
if (ptr[0] && ptr[1] && ptr[2]==':' && ptr[3]==':')
ptr[3]=*sys_acct;
ptr[3]=dsk.boot_drv_let;
doc_e->aux_str=NULL;
}

0
Adam/Math2a.CPP → Adam/AMath.CPP

203
Adam/MathODE.CPP → Adam/AMathODE.CPP

@ -1,7 +1,7 @@
#help_index "Math/ODE"
#help_file "::/Doc/ODE"
//See $LK,"::/Doc/Acknowledgements.TXT"$.
//See $LK,"::/Doc/Credits.TXT"$.
F64 LowPass1(F64 a,F64 y0,F64 y,F64 dt=1.0)
{//First order low pass filter
@ -56,14 +56,12 @@ public CMathODE *ODENew(I64 n,F64 max_tolerance=1e-6,I64 flags=0)
ode->state=CAlloc(s);
ode->array_base=MAlloc(12*s);
ODERstPtrs(ode);
ode->ode_signature=ODE_SIGNATURE_VAL;
return ode;
}
public U0 ODEDel(CMathODE *ode)
{//Free ODE node, but not masses or springs.
if (!ode) return;
ode->ode_signature=0;
Free(ode->state);
Free(ode->array_base);
Free(ode);
@ -158,13 +156,13 @@ public U0 ODERenum(CMathODE *ode)
public CMass *MassFind(CMathODE *ode,F64 x,F64 y,F64 z=0)
{//Search for mass nearest to x,y,z.
CMass *tempm,*best_mass=NULL;
F64 d,best_d=MAX_F64;
F64 dd,best_dd=MAX_F64;
tempm=ode->next_mass;
while (tempm!=&ode->next_mass) {
d=Sqr(tempm->x-x)+Sqr(tempm->y-y)+Sqr(tempm->z-z);
if (d<best_d) {
best_d=d;
dd=Sqr(tempm->x-x)+Sqr(tempm->y-y)+Sqr(tempm->z-z);
if (dd<best_dd) {
best_dd=dd;
best_mass=tempm;
}
tempm=tempm->next;
@ -175,15 +173,15 @@ public CMass *MassFind(CMathODE *ode,F64 x,F64 y,F64 z=0)
public CSpring *SpringFind(CMathODE *ode,F64 x,F64 y,F64 z=0)
{//Find spring midpoint nearest x,y,z.
CSpring *temps,*best_spring=NULL;
F64 d,best_d=MAX_F64;
F64 dd,best_dd=MAX_F64;
temps=ode->next_spring;
while (temps!=&ode->next_spring) {
d=Sqr((temps->end1->x+temps->end2->x)/2-x)+
dd=Sqr((temps->end1->x+temps->end2->x)/2-x)+
Sqr((temps->end1->y+temps->end2->y)/2-y)+
Sqr((temps->end1->z+temps->end2->z)/2-z);
if (d<best_d) {
best_d=d;
if (dd<best_dd) {
best_dd=dd;
best_spring=temps;
}
temps=temps->next;
@ -196,13 +194,13 @@ public U0 MassOrSpringFind(CMathODE *ode,CMass **result_mass,CSpring **result_sp
{//Find spring or mass nearest x,y,z.
CMass *tempm,*best_mass=NULL;
CSpring *temps,*best_spring=NULL;
F64 d,best_d=MAX_F64;
F64 dd,best_dd=MAX_F64;
tempm=ode->next_mass;
while (tempm!=&ode->next_mass) {
d=Sqr(tempm->x-x)+Sqr(tempm->y-y)+Sqr(tempm->z-z);
if (d<best_d) {
best_d=d;
dd=Sqr(tempm->x-x)+Sqr(tempm->y-y)+Sqr(tempm->z-z);
if (dd<best_dd) {
best_dd=dd;
best_mass=tempm;
}
tempm=tempm->next;
@ -210,11 +208,11 @@ public U0 MassOrSpringFind(CMathODE *ode,CMass **result_mass,CSpring **result_sp
temps=ode->next_spring;
while (temps!=&ode->next_spring) {
d=Sqr((temps->end1->x+temps->end2->x)/2-x)+
dd=Sqr((temps->end1->x+temps->end2->x)/2-x)+
Sqr((temps->end1->y+temps->end2->y)/2-y)+
Sqr((temps->end1->z+temps->end2->z)/2-z);
if (d<best_d) {
best_d=d;
if (dd<best_dd) {
best_dd=dd;
best_spring=temps;
best_mass=NULL;
}
@ -491,7 +489,7 @@ U0 ODERK5OneStep(CMathODE *ode)
MemCpy(ode->state_internal,tempstate,sizeof(F64)*ode->n_internal);
}
F64 ode_allocated_factor=0.75;
F64 ode_alloced_factor=0.75;
U0 ODEsUpdate(CTask *task)
{/* This routine is called by the $LK,"window mgr",A="FF:::/Adam/Gr/GrScreen.CPP,ODEsUpdate"$ on a continuous
@ -510,105 +508,100 @@ it has a timeout.
if (task->next_ode==&task->next_ode)
task->last_ode_time=0;
else {
else if (!Bt(&task->win_inhibit,WIf_SELF_ODE)) {
//See $LK,"GrUpdateWins",A="MN:GrUpdateWins"$()
if (!Bt(&task->win_inhibit,WIf_SELF_ODE)) {
//TODO: Being preempted here woulds be bad
if (task!=Fs)
old_suspend=Suspend(task);
//We will not pick a time limit based on
//how busy the CPU is, what percent of the
//last refresh cycle was spent on ODE's
//and what the refresh cycle rate was.
start_time=tS;
d=1.0/winmgr.fps;
timeout_time=start_time+
(task->last_ode_time/d+0.1)/(winmgr.last_ode_time/d+0.1)*
ode_allocated_factor*d;
ode=task->next_ode;
while (ode!=&task->next_ode) {
if (ode->ode_signature==ODE_SIGNATURE_VAL) {
t_initial=ode->t;
d=tS;
if (!(ode->flags&ODEF_STARTED)) {
ode->base_t=d;
ode->flags|=ODEF_STARTED;
}
d-=ode->base_t+t_initial;
t_desired=ode->t_scale*d+t_initial;
if (ode->flags&ODEF_PAUSED)
//TODO: Being preempted here woulds be bad
if (task!=Fs)
old_suspend=Suspend(task);
//We will not pick a time limit based on
//how busy the CPU is, what percent of the
//last refresh cycle was spent on ODE's
//and what the refresh cycle rate was.
start_time=tS;
d=1.0/winmgr.fps;
timeout_time=start_time+
(task->last_ode_time/d+0.1)/(winmgr.last_ode_time/d+0.1)*
ode_alloced_factor*d;
ode=task->next_ode;
while (ode!=&task->next_ode) {
t_initial=ode->t;
d=tS;
if (!(ode->flags&ODEF_STARTED)) {
ode->base_t=d;
ode->flags|=ODEF_STARTED;
}
d-=ode->base_t+t_initial;
t_desired=ode->t_scale*d+t_initial;
if (ode->flags&ODEF_PAUSED)
ode->base_t+=t_desired-ode->t; //Slip
else if (ode->derivative) {
ODEState2Internal(ode);
MemCpy(ode->initial_state,ode->state_internal,ode->n_internal*sizeof(F64));
while (ode->t<t_desired) {
ode->h_max=t_desired-ode->t;
ODECallDerivative(ode,ode->t,ode->state_internal,ode->DstateDt);
for (i=0;i<ode->n_internal;i++)
ode->state_scale[i]=Abs(ode->state_internal[i])+
Abs(ode->DstateDt[i]*ode->h)+ode->tolerance_internal;
ODERK5OneStep(ode);
if (tS>timeout_time) {
ode->base_t+=t_desired-ode->t; //Slip
else if (ode->derivative) {
ODEState2Internal(ode);
MemCpy(ode->initial_state,ode->state_internal,ode->n_internal*sizeof(F64));
while (ode->t<t_desired) {
ode->h_max=t_desired-ode->t;
ODECallDerivative(ode,ode->t,ode->state_internal,ode->DstateDt);
for (i=0;i<ode->n_internal;i++)
ode->state_scale[i]=Abs(ode->state_internal[i])+
Abs(ode->DstateDt[i]*ode->h)+ode->tolerance_internal;
ODERK5OneStep(ode);
if (tS>timeout_time) {
ode->base_t+=t_desired-ode->t; //Slip
goto ode_done;
}
}
//Interpolate if end time was not exact.
if (ode->t!=t_desired) {
if (interpolation=ode->t-t_initial) {
interpolation=(t_desired-t_initial)/interpolation;
if (interpolation!=1.0)
for (i=0;i<ode->n_internal;i++)
ode->state_internal[i]=(ode->state_internal[i]-
ode->initial_state[i])*interpolation+
ode->initial_state[i];
}
ode->t=t_desired;
}
ode_done:
ODEInternal2State(ode);
goto ode_done;
//Convenience call to set vals
ODECallDerivative(ode,ode->t,ode->state_internal,ode->DstateDt);
}
ode->base_t+=(1.0-ode->t_scale)*d;
}
ode=ode->next;
//Interpolate if end time was not exact.
if (ode->t!=t_desired) {
if (interpolation=ode->t-t_initial) {
interpolation=(t_desired-t_initial)/interpolation;
if (interpolation!=1.0)
for (i=0;i<ode->n_internal;i++)
ode->state_internal[i]=(ode->state_internal[i]-
ode->initial_state[i])*interpolation+
ode->initial_state[i];
}
ode->t=t_desired;
}
ode_done:
ODEInternal2State(ode);
//Convenience call to set vals
ODECallDerivative(ode,ode->t,ode->state_internal,ode->DstateDt);
}
ode->base_t+=(1.0-ode->t_scale)*d;
ode=ode->next;
}
//Now, we will dynamically adjust tolerances.
//Now, we will dynamically adjust tolerances.
//We will regulate the tolerances
//to fill the time we decided was
//okay to devote to ODE's.
//Since we might have multiple ODE's
//active we scale them by the same factor.
//We will regulate the tolerances
//to fill the time we decided was
//okay to devote to ODE's.
//Since we might have multiple ODE's
//active we scale them by the same factor.
//This algorithm is probably not stable or very good, but it's something.
//This algorithm is probably not stable or very good, but it's something.
//Target is 75% of allocated time.
d=(tS-start_time)/(timeout_time-start_time)-0.75;
//Target is 75% of alloced time.
d=(tS-start_time)/(timeout_time-start_time)-0.75;
ode=task->next_ode;
while (ode!=&task->next_ode) {
if (ode->ode_signature==ODE_SIGNATURE_VAL &&
!(ode->flags&ODEF_PAUSED) && ode->derivative) {
if (ode->min_tolerance!=ode->max_tolerance) {
if (d>0)
ode->tolerance_internal*=10.0`d;
else
ode->tolerance_internal*=2.0`d;
}
ode->tolerance_internal=Clamp(ode->tolerance_internal,ode->min_tolerance,ode->max_tolerance);
ode=task->next_ode;
while (ode!=&task->next_ode) {
if (!(ode->flags&ODEF_PAUSED) && ode->derivative) {
if (ode->min_tolerance!=ode->max_tolerance) {
if (d>0)
ode->tolerance_internal*=10.0`d;
else
ode->tolerance_internal*=2.0`d;
}
ode=ode->next;
ode->tolerance_internal=Clamp(ode->tolerance_internal,ode->min_tolerance,ode->max_tolerance);
}
winmgr.ode_time+=task->last_ode_time=tS-start_time;
//See $LK,"GrUpdateWins",A="MN:GrUpdateWins"$()
if (task!=Fs)
Suspend(task,old_suspend);
ode=ode->next;
}
winmgr.ode_time+=task->last_ode_time=tS-start_time;
//See $LK,"GrUpdateWins",A="MN:GrUpdateWins"$()
if (task!=Fs)
Suspend(task,old_suspend);
}
}

211
Adam/AUtils.CPP

@ -0,0 +1,211 @@
#help_index "Memory/Task"
public I64 TaskMemAlloced(CTask *task=NULL,Bool override_validate=FALSE)
{//Count of bytes alloced to a task, used+unused.
I64 result;
if (!task) task=Fs;
if (override_validate || TaskValidate(task)) {
result=task->code_heap->alloced_u8s;
if (task->code_heap!=task->data_heap)
result+=task->data_heap->alloced_u8s;
return result;
} else
return 0;
}
public I64 TaskMemUsed(CTask *task=NULL,Bool override_validate=FALSE)
{//Count of bytes alloced to a task and in use.
I64 result;
if (!task) task=Fs;
if (override_validate || TaskValidate(task)) {
result=task->code_heap->used_u8s;
if (task->data_heap!=task->code_heap)
result+=task->data_heap->used_u8s;
return result;
} else
return 0;
}
public Bool HeapRep(CTask *task)
{//Report status of task's heap.
I64 i,cnt;
CMemUnused *uum;
if (!task || task==Fs) {
"Task can't HeapRep on self.\n";
return FALSE;
}
if (!TaskValidate(task)) return FALSE;
PUSHFD
CLI
while (LBts(&task->code_heap->locked_flags,HClf_LOCKED))
PAUSE
if (task->data_heap!=task->code_heap)
while (LBts(&task->data_heap->locked_flags,HClf_LOCKED))
PAUSE
for (i=0;i<HEAP_HASH_SIZE>>3;i++) {
cnt=0;
uum=task->code_heap->heap_hash[i];
while (uum) {
cnt+=uum->size;
uum=uum->next;
}
if (task->data_heap!=task->code_heap) {
uum=task->data_heap->heap_hash[i];
while (uum) {
cnt+=uum->size;
uum=uum->next;
}
}
if (cnt)
"%03X:%08X\n",i<<3,cnt;
}
'\n';
uum=task->code_heap->malloc_free_lst;
while (uum) {
"%X, ",uum->size;
uum=uum->next;
}
if (task->data_heap!=task->code_heap) {
uum=task->data_heap->malloc_free_lst;
while (uum) {
"%X, ",uum->size;
uum=uum->next;
}
}
if (task->data_heap!=task->code_heap)
LBtr(&task->data_heap->locked_flags,HClf_LOCKED);
LBtr(&task->code_heap->locked_flags,HClf_LOCKED);
POPFD
'\n';
}
#help_index "Memory/HeapCtrl;Debugging/Heap"
public Bool IsInHeapCtrl(U8 *a,CHeapCtrl *hc,Bool lock=TRUE)
{//Check addr if on heap.
CMemBlk *m;
PUSHFD
CLI
if (lock)
while (LBts(&hc->locked_flags,HClf_LOCKED))
PAUSE
m=hc->next_mem_blk;
while (m!=&hc->next_mem_blk) {
if (a>=m && a<m(U8 *)+m->pages*PAGE_SIZE) {
if (lock)
LBtr(&hc->locked_flags,HClf_LOCKED);
POPFD
return TRUE;
}
m=m->next;
}
if (lock)
LBtr(&hc->locked_flags,HClf_LOCKED);
POPFD
return FALSE;
}
public Bool HeapCtrlWalk(CHeapCtrl *hc)
{//Check integrity of HeapCtrl.
I64 i;
CMemUnused *uum;
PUSHFD
CLI
while (LBts(&hc->locked_flags,HClf_LOCKED))
PAUSE
for (i=0;i<HEAP_HASH_SIZE>>3;i++) {
uum=hc->heap_hash[i];
while (uum) {
if (!IsInHeapCtrl(uum,hc,FALSE))
goto hc_false;
uum=uum->next;
}
}
uum=hc->malloc_free_lst;
while (uum) {
if (!IsInHeapCtrl(uum,hc,FALSE))
goto hc_false;
uum=uum->next;
}
#if _CFG_HEAP_DBG
CMemUsed *um,*um1;
um1=(&hc->next_um)(U8 *)-offset(CMemUsed.next);
um=um1->next;
while (um!=um1) {
if (!IsInHeapCtrl(um,hc,FALSE))
goto hc_false;
um=um->next;
}
#endif
LBtr(&hc->locked_flags,HClf_LOCKED);
POPFD
return TRUE;
hc_false:
LBtr(&hc->locked_flags,HClf_LOCKED);
POPFD
return FALSE;
}
#help_index "Memory/Task;Debugging/Heap"
public Bool IsInHeap(U8 *a,CTask *task=NULL,Bool lock=TRUE)
{//Check addr if on heap.
if (!task) task=Fs;
if (TaskValidate(task) && (IsInHeapCtrl(a,task->code_heap,lock)||
task->data_heap!=task->code_heap && IsInHeapCtrl(a,task->data_heap,lock)))
return TRUE;
else
return FALSE;
}
public Bool HeapWalk(CTask *task=NULL)
{//Check integrity of task's heaps.
if (!task) task=Fs;
if (!TaskValidate(task) || !HeapCtrlWalk(task->code_heap) ||
task->data_heap!=task->code_heap && !HeapCtrlWalk(task->data_heap))
return FALSE;
else
return TRUE;
}
#help_index "Info;Task"
U0 TaskRepTask(CTask *task,I64 indent)
{
CTask *task1;
U8 *st,*desc=MStrUtil(task->task_title,SUF_SAFE_DOLLAR);
st=MStrPrint("$$MA,T=\"%08X\",LM=\"Kill(0x%X);\n\",$$",task,task,task);
"%h*c%s $$TX,\"%Q...\",SCX=16$$ Mem:%08X\n",indent,CH_SPACE,
st,desc,TaskMemAlloced(task);
"%h*cFlags:%04X:%04X Time:%0.2fm\n",indent+2,CH_SPACE,
task->task_flags,task->display_flags,
task->total_time/60.0/cnts.time_stamp_freq_initial;
Free(st);
Free(desc);
task1=task->next_child_task;
while (task1!=(&task->next_child_task)(U8 *)-offset(CTask.next_sibling_task)) {
TaskRepTask(task1,indent+2);
task1=task1->next_sibling_task;
}
}
public U0 TaskRep()
{//Report current tasks on all cores.
I64 i;
CCPU *c;
PUSHFD
CLI
for (i=0;i<mp_cnt;i++) {
c=&cpu_structs[i];
"$$RED$$CPU:%d$$FG$$\n",i;
TaskRepTask(c->seth_task,2);
}
POPFD
}

72
Adam/LogIn.CPP → Adam/Acct.CPP

@ -1,66 +1,5 @@
#help_index "Misc/Accts"
U0 UserStartUp()
{//Temporary until defined in $LK,"HOME/Adam3eSys.CPP"$.
//Run each time a user a spawned
DocTermNew;
Type("::/Doc/Start.TXT");
LBts(&Fs->display_flags,DISPLAYf_SHOW);
WinToTop;
WinZBufUpdate;
Preempt(ON);
}
U0 SrvStartUp()
{//Temporary until defined in $LK,"HOME/Adam3eSys.CPP"$.
//Run each time a srv task is spawned.
DocTermNew;
LBts(&Fs->display_flags,DISPLAYf_SHOW);
WinToTop;
WinZBufUpdate;
Preempt(ON);
}
U8 *PopUpSysAcct()
{
U8 *result,*st;
CDoc *doc=DocNew;
CDirEntry *tempde=FilesFind("/Accts/*",FUF_RECURSE|FUF_JUST_DIRS|FUF_FLATTEN_TREE),
*tempde1=tempde;
DocPrint(doc,"$$CM+CX-LE,10$$");
DocSprite(doc,$IB,"<1>",BI=1,BP="::/Misc/StockSprites.TXT,TempleOSLogo"$,"$$SP+SIF,\"\",BI=%d$$");
DocPrint(doc,"$$CM+LX,0,12$$Select Account.\nCursor down and press <SPACE>.\n");
while (tempde) {
if (*tempde->name!='.') {
st=tempde->full_name;
if (!StrNCmp(st+2,"/Accts/",7))
st+=9;
DocPrint(doc,"$$CM+LX,2,3$$$$BT,\"%s\",LE=%d$$",st,tempde);
}
tempde=tempde->next;
}
DocPrint(doc,"\n\n\n\nLog-in as USER if you are new and get familiar\n"
"before you try to install.\n");
do tempde=PopUpMenu(doc,DOF_WIN_MAX);
while (tempde<=0);
DocDel(doc);
result=AStrNew(tempde->full_name);
DirTreeDel(tempde1);
return result;
}
U0 SysLogin()
{
U8 *st;
if (!FileFind(sys_acct)||!StrCmp(sys_acct+2,"/Accts")) {
st=sys_acct;
sys_acct=PopUpSysAcct;
Free(st);
}
}
#define ACCT_REGISTRY_FILENAME "HOME/Registry.CPP.Z"
#define ACCT_REGISTRY_FILENAME "::/Home/Registry.CPP.Z"
CDoc *sys_registry_doc=NULL;
I64 sys_msg_flags[1]={0};
F64 registry_version;
@ -69,7 +8,7 @@ Bool AcctCacheRegistry()
{
Bool old_silent;
if (!sys_registry_doc) {
old_silent=Silent(ON);
old_silent=Silent;
sys_registry_doc=DocRead(ACCT_REGISTRY_FILENAME);
Silent(old_silent);
return FALSE;
@ -91,7 +30,7 @@ public Bool AcctRegSetDftEntry(U8 *path,U8 *val,Bool is_adam_entry=FALSE)
else
Adam("%s",val);
}
if (IsDrvWritable(*sys_acct))
if (IsDrvWritable(':'))
DocWrite(sys_registry_doc);
result=FALSE;
} else
@ -118,7 +57,7 @@ public Bool AcctRegWriteBranch(U8 *path,U8 *fmt,...)
DocCut(sys_registry_doc,tree_branch,end_indent);
DocTreeMake(sys_registry_doc,path);
DocPrint(sys_registry_doc,"%s",buf);
if (IsDrvWritable(*sys_acct))
if (IsDrvWritable(':'))
DocWrite(sys_registry_doc);
if (unlock_doc)
DocUnlock(sys_registry_doc);
@ -147,8 +86,7 @@ public Bool OneTimePopUp(U8 *_flags,I64 flag_num,U8 *msg)
U0 AcctOneTimePopUp(I64 flag_num,U8 *msg)
{//You're not supposed to make system pop-up flags, only me.
if (OneTimePopUp(sys_msg_flags,flag_num,msg))
AcctRegWriteBranch("Adam/SysMsgFlags",
"sys_msg_flags[0]=0x%X;\n",
AcctRegWriteBranch("Adam/SysMsgFlags","sys_msg_flags[0]=0x%X;\n",
sys_msg_flags[0]);
}

80
Adam/Adam2.CPP

@ -1,80 +0,0 @@
#exe {OptOn(OPTf_WARN_PAREN);};
#exe {OptOn(OPTf_WARN_DUP_TYPES);};
HashTablePurge(adam_task->hash_table);
#help_index "Misc"
//Use Dbg("Type 'G;'"); to debug before window mgr is running.
public F64 os_version=2.11;//Operating system version.
//Fix here, too: $LK,"::/Demo/AcctExample/DbgAdam2.CPP"$
#include "AdamExts.HPP"
#include "Math2a"
#include "Training"
#include "Utils2a"
#include "MathODE"
Cd("::/Adam/Gr");;
#include "Gr"
Cd("::/Adam/Snd");;
#include "Snd"
Cd("::/Adam/Dsk");;
#include "Dsk2"
Cd("::/Adam");;
#include "Menu"
#include "Win2a"
#include "Win2b"
#include "Dbg2a"
#include "::/Adam/God/GodExt"
Cd("::/Adam/DolDoc");;
#include "Doc"
LBts(&sys_run_level,RLf_DOC);
Cd("::/Adam/Ctrls");;
#include "Ctrls"
Cd("::/Adam");;
#include "AutoFile2a"
#include "LogIn"
Cd("::/Adam/WordStat");;
#include "WordStat"
Cd("::/Adam/God");;
#include "God"
Cd("::/Adam");;
#include "Hash2a"
#include "TaskSettings"
#include "DevInfo"
#include "DocDefines"
//Dbg("Type 'G;'");
DocTermNew;
SetWinVert(2,10);
sys_winmgr_task=Spawn(&WinMgrTask,NULL,"Window Mgr");
Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_BORDER-WIF_SELF_GRAB_SCROLL-WIF_SELF_CTRLS;
LBts(&Fs->display_flags,DISPLAYf_CHILDREN_NOT_ON_TOP);
LBts(&Fs->display_flags,DISPLAYf_SHOW);
SysLogin;
LBts(&sys_run_level,RLf_LOGIN);
RegistryInit;
LBts(&sys_run_level,RLf_REGISTRY);
Cd("::/Adam");;
#include "WallPaper"
#exe {OptOff(OPTf_WARN_PAREN);};
#exe {OptOff(OPTf_WARN_DUP_TYPES);};
LBts(&sys_run_level,RLf_ADAM2);
#help_index ""
Cd("HOME");;
#include "Adam3"

0
Adam/WordStat/WSDefs.DAT → Adam/AutoComplete/ACDefs.DAT

158
Adam/WordStat/WSDict.CPP → Adam/AutoComplete/ACDict.CPP

@ -1,21 +1,21 @@
#help_index "WordStat/Dictionary"
#help_index "AutoComplete/Dictionary"
public U0 WSDWordsLoad()
public U0 ACDWordsLoad()
{//Put words from word list into hash table.
I64 size;
CHashGeneric *temph;
U8 *in_ptr,*in_start,*st2;
U16 *d;
wsd.num_words=0;
if (in_ptr=FileRead(WSD_WORD_FILENAME,&size)) {
acd.num_words=0;
if (in_ptr=FileRead(ACD_WORD_FILENAME,&size)) {
in_start=in_ptr;
Free(wsd.word_lst);
wsd.word_lst=AMAlloc(size);
MemCpy(wsd.word_lst,in_start,size);
wsd.word_lst_size=size;
Free(acd.word_lst);
acd.word_lst=AMAlloc(size);
MemCpy(acd.word_lst,in_start,size);
acd.word_lst_size=size;
while (in_ptr<in_start+size) {
if (*in_ptr==WSD_WORD_CHAR)
if (*in_ptr==ACD_WORD_CHAR)
in_ptr++;
if (*in_ptr) {
st2=MStrUtil(in_ptr,SUF_TO_UPPER);
@ -29,8 +29,8 @@ public U0 WSDWordsLoad()
d=in_ptr;
temph->user_data0=*d;
in_ptr+=2;
HashAdd(temph,ws.hash_table);
wsd.num_words++;
HashAdd(temph,ac.hash_table);
acd.num_words++;
} else
in_ptr+=3;
}
@ -38,29 +38,29 @@ public U0 WSDWordsLoad()
}
}
public U8 *WSDDefGet(U8 *st,I64 def_num=1)
public U8 *ACDDefGet(U8 *st,I64 def_num=1)
{//MAlloc str holding single dict definition of word.
CFile *f;
CHashGeneric *temph;
U8 *result=NULL,*buf,*in_ptr,
*st2=MStrUtil(st,SUF_TO_UPPER);
temph=HashFind(st2,ws.hash_table,HTT_DICT_WORD);
temph=HashFind(st2,ac.hash_table,HTT_DICT_WORD);
Free(st2);
if (temph) {
if (f=FOpen(WSD_DEF_FILENAME,"r")) {
buf=MAlloc(WSD_BLK_SIZE*2+1);
buf[WSD_BLK_SIZE*2]=0; //terminate
FRBlks(f,buf,temph->user_data0*WSD_BLK_SIZE/BLK_SIZE,WSD_BLK_SIZE*2/BLK_SIZE);
if (f=FOpen(ACD_DEF_FILENAME,"r")) {
buf=MAlloc(ACD_BLK_SIZE*2+1);
buf[ACD_BLK_SIZE*2]=0; //terminate
FRBlks(f,buf,temph->user_data0*ACD_BLK_SIZE/BLK_SIZE,ACD_BLK_SIZE*2/BLK_SIZE);
FClose(</