TempleOSCDV4.10.ISO

v6
Terry A. Davis 6 years ago committed by minexew
parent c5954d3371
commit 9206246147
  1. BIN
      0000Boot/0000Kernel.BIN.C
  2. 42
      Adam/ABlkDev/FileMgr.CPP
  3. 8
      Adam/ABlkDev/Mount.CPP
  4. 22
      Adam/ABlkDev/PrtDsk.CPP
  5. 5
      Adam/ADefine.CPP
  6. 6
      Adam/AHash.CPP
  7. 2
      Adam/AutoComplete/ACDictGen.CPP
  8. 2
      Adam/AutoComplete/ACTask.CPP
  9. 16
      Adam/DevInfo.CPP
  10. 20
      Adam/DolDoc/DocBin.CPP
  11. 10
      Adam/DolDoc/DocChar.CPP
  12. 12
      Adam/DolDoc/DocClipBoard.CPP
  13. 18
      Adam/DolDoc/DocCodeTools.CPP
  14. 2
      Adam/DolDoc/DocEd.CPP
  15. 51
      Adam/DolDoc/DocFile.CPP
  16. 12
      Adam/DolDoc/DocFind.CPP
  17. 4
      Adam/DolDoc/DocForm.CPP
  18. 2
      Adam/DolDoc/DocGet.CPP
  19. 33
      Adam/DolDoc/DocInit.CPP
  20. 32
      Adam/DolDoc/DocMacro.CPP
  21. 40
      Adam/DolDoc/DocNew.CPP
  22. 16
      Adam/DolDoc/DocOpt.CPP
  23. 26
      Adam/DolDoc/DocPlain.CPP
  24. 6
      Adam/DolDoc/DocPutKey.CPP
  25. 24
      Adam/DolDoc/DocPutS.CPP
  26. 186
      Adam/DolDoc/DocRecalc.CPP
  27. 8
      Adam/DolDoc/DocRecalcLib.CPP
  28. 4
      Adam/DolDoc/DocTree.CPP
  29. 63
      Adam/DolDoc/DocWidgetWiz.CPP
  30. 1
      Adam/DolDoc/MakeDoc.CPP
  31. 9
      Adam/God/GodBible.CPP
  32. 2
      Adam/God/GodDoodle.CPP
  33. 20
      Adam/God/HSNotes.TXT
  34. 2
      Adam/Gr/GrBitMap.CPP
  35. 2
      Adam/Gr/GrExt.CPP
  36. 2
      Adam/Gr/GrGlbls.CPP
  37. 2
      Adam/Gr/GrScreen.CPP
  38. 2
      Adam/Gr/GrSpritePlot.CPP
  39. 10
      Adam/Gr/SpriteBitMap.CPP
  40. 46
      Adam/Gr/SpriteCode.CPP
  41. 254
      Adam/Gr/SpriteEd.CPP
  42. 136
      Adam/Gr/SpriteMain.CPP
  43. 225
      Adam/Gr/SpriteMesh.CPP
  44. 12
      Adam/Opt/Boot/BootDVD.CPP
  45. 6
      Adam/Opt/Boot/BootHD.CPP
  46. 3
      Adam/Opt/Boot/BootMHD.CPP
  47. 6
      Adam/Opt/Boot/BootMHD2.CPP
  48. 28
      Adam/Opt/Boot/DskISO9660.CPP
  49. 2
      Adam/Opt/Boot/DskISORedSea.CPP
  50. 14
      Adam/Opt/Utils/Diff.CPP
  51. 2
      Adam/Opt/Utils/Find.CPP
  52. 40
      Adam/Opt/Utils/HeapLog.CPP
  53. 4
      Adam/Opt/Utils/LineRep.CPP
  54. 5
      Adam/Opt/Utils/LinkChk.CPP
  55. 16
      Adam/Opt/Utils/StrUtils.CPP
  56. 4
      Adam/Opt/Utils/ToTXT.CPP
  57. 14
      Adam/Snd/SndFile.CPP
  58. 2
      Adam/TaskRep.CPP
  59. 4
      Adam/Training.CPP
  60. 8
      Apps/Budget/BgtAccts.CPP
  61. 4
      Apps/Budget/BgtEntry.CPP
  62. 40
      Apps/Budget/BgtFile.CPP
  63. 14
      Apps/Budget/BgtMain.CPP
  64. 4
      Apps/Budget/BgtStrs.CPP
  65. 8
      Apps/Budget/BgtTemplate.CPP
  66. 8
      Apps/Budget/Budget.CPP
  67. 4
      Apps/Psalmody/JukeBox.CPP
  68. 4
      Apps/Psalmody/Psalmody.CPP
  69. 16
      Apps/Psalmody/PsalmodyDraw.CPP
  70. 46
      Apps/Psalmody/PsalmodyFile.CPP
  71. 64
      Apps/Psalmody/PsalmodyMain.CPP
  72. 16
      Apps/ToTheFront/ToTheFront.CPP
  73. 72
      Apps/X-Caliber/X-Caliber.CPP
  74. 2
      Compiler/CHash.CPP
  75. 1
      Compiler/CInit.CPP
  76. 6
      Compiler/CMain.CPP
  77. BIN
      Compiler/Compiler.BIN
  78. 219
      Compiler/Compiler.MAP
  79. 170
      Compiler/CompilerA.HPP
  80. 58
      Compiler/Lex.CPP
  81. 52
      Compiler/OpCodes.TXT
  82. 3
      Compiler/OptPass012.CPP
  83. 3
      Compiler/OptPass3.CPP
  84. 3
      Compiler/OptPass4.CPP
  85. 2
      Compiler/OptPass5.CPP
  86. 2
      Compiler/OptPass6.CPP
  87. 5
      Compiler/OptPass789A.CPP
  88. 30
      Compiler/PrsExp.CPP
  89. 20
      Compiler/PrsLib.CPP
  90. 38
      Compiler/PrsStmt.CPP
  91. 14
      Compiler/PrsVar.CPP
  92. 117
      Compiler/Templates.CPP
  93. 8
      Demo/AcctExample/HomeKeyPlugIns.CPP
  94. 2
      Demo/AcctExample/HomeSys.CPP
  95. 2
      Demo/AcctExample/HomeWrappers.CPP
  96. BIN
      Demo/AcctExample/PersonalMenu.TXT
  97. 22
      Demo/AcctExample/PersonalNotes.TXT
  98. 42
      Demo/AcctExample/Registry.CPP
  99. 5
      Demo/AcctExample/TOSBlog.CPP
  100. 2
      Demo/AcctExample/TOSCfg.CPP
  101. Some files were not shown because too many files have changed in this diff Show More

Binary file not shown.

@ -30,7 +30,7 @@ class CFMUncollapsedLst
CFMUncollapsedLst *FMCollectUncollapsedLst(CDoc *doc)
{
CDocEntry *doc_e=doc->root.next;
CDocEntry *doc_e=doc->head.next;
CFMUncollapsedLst *res=NULL,*tempc;
CDirEntry *tempde;
while (doc_e!=doc) {
@ -52,7 +52,7 @@ CFMUncollapsedLst *FMCollectUncollapsedLst(CDoc *doc)
U0 FMMarkUncollapsed(CDoc *doc,CFMUncollapsedLst *tempc,
U8 *cur_entry,U8 *next_entry)
{
CDocEntry *doc_e=doc->root.next;
CDocEntry *doc_e=doc->head.next;
CFMUncollapsedLst *tempc1;
CDirEntry *tempde;
while (doc_e!=doc) {
@ -112,7 +112,7 @@ U0 FMDelUncollapsedLst(CFMUncollapsedLst *tempc)
}
}
CDirEntry *FMRebuildDocDrv(U8 drv_let,CDoc *doc,CDirEntry **_root,Bool init)
CDirEntry *FMRebuildDocDrv(U8 drv_let,CDoc *doc,CDirEntry **_head,Bool init)
{
CDirEntry *tempde,*tempde1;
U8 *st;
@ -126,8 +126,8 @@ CDirEntry *FMRebuildDocDrv(U8 drv_let,CDoc *doc,CDirEntry **_root,Bool init)
tempde1=NULL;
Free(st);
tempde->user_data=DocPrint(doc,"$$TR,\"%s\",U=0x%X$$",tempde->full_name,tempde);
tempde->next=*_root;
*_root=tempde;
tempde->next=*_head;
*_head=tempde;
DocPrint(doc,"\n$$ID,+2$$");
DocBottom(doc);
if (init) {
@ -141,7 +141,7 @@ CDirEntry *FMRebuildDocDrv(U8 drv_let,CDoc *doc,CDirEntry **_root,Bool init)
return tempde;
}
U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_root,I64 mode)
U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_head,I64 mode)
{
CDrv *dv;
I64 i;
@ -192,9 +192,9 @@ U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_root,I64 mode)
tempc=FMCollectUncollapsedLst(doc);
DocDel(doc);
}
if (*_root) {
DirTreeDel(*_root);
*_root=NULL;
if (*_head) {
DirTreeDel(*_head);
*_head=NULL;
}
doc=DocNew;
doc->desc='FileMan';
@ -219,13 +219,13 @@ U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_root,I64 mode)
dv=&blkdev.drvs[i];
if (dv->bd->type==BDT_ATAPI) {
if (dv->bd->flags&BDF_INITIALIZED)
tempde=FMRebuildDocDrv(Drv2Let(dv),doc,_root,TRUE);
tempde=FMRebuildDocDrv(Drv2Let(dv),doc,_head,TRUE);
else {
tempde=FMRebuildDocDrv(Drv2Let(dv),doc,_root,FALSE);
tempde=FMRebuildDocDrv(Drv2Let(dv),doc,_head,FALSE);
tempde->flags|=DEF_NOT_INITIALIZED;
}
} else if (dv->fs_type==FSt_REDSEA || dv->fs_type==FSt_FAT32)
FMRebuildDocDrv(Drv2Let(dv),doc,_root,TRUE);
FMRebuildDocDrv(Drv2Let(dv),doc,_head,TRUE);
}
DocTop(doc);
FMMarkUncollapsed(doc,tempc,cur_entry,next_entry);
@ -437,7 +437,7 @@ U0 FMCopy(CDoc *doc)
CDocEntry *doc_ce=doc->cur_entry,*doc_e;
CDirEntry *tempde,*tempde1=NULL,*tempde2;
Bool unlock_doc2=DocLock(doc2);
doc_e=doc2->root.next;
doc_e=doc2->head.next;
tempde1=doc_ce->user_data;
if (doc_ce->type_u8==DOCT_MENU_VAL)
@ -580,7 +580,7 @@ U0 FMFinalScreenUpdate(CDC *dc)
public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
{//File manager. Also, used to choose files and dirs.
CDirEntry *root=NULL,*tempde,*tempde1,*tempde2;
CDirEntry *head=NULL,*tempde,*tempde1,*tempde2;
I64 sc,ch,a1,a2,msg_code;
CDoc *doc=NULL,*old_put_doc=DocPut,*old_display_doc=DocDisplay;
U8 *res=NULL,*st,*st2,*old_cur_dir=CurDir;
@ -590,8 +590,8 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
fp_old_final_screen_update=gr.fp_final_screen_update;
MenuFilePush("::/Doc/FileMgrPullDown.TXT");
FMRebuildDoc(&doc,&root,mode);
if (tempde1=Cd2DirEntry(root,old_cur_dir))
FMRebuildDoc(&doc,&head,mode);
if (tempde1=Cd2DirEntry(head,old_cur_dir))
doc->cur_entry=tempde1->user_data;
while (tempde1) {
if (tempde1->attr&RS_ATTR_DIR)
@ -636,7 +636,7 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
Silent;
Move(tempde->full_name,st2);
Silent(OFF);
FMRebuildDoc(&doc,&root,mode);
FMRebuildDoc(&doc,&head,mode);
} else if (st2 && doc_ce->type_u8==DOCT_TREE) {
tempde=doc_ce->user_data;
okay=TRUE;
@ -659,7 +659,7 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
CopyTree(tempde->full_name,st);
DelTree(tempde->full_name);
Silent(OFF);
FMRebuildDoc(&doc,&root,mode);
FMRebuildDoc(&doc,&head,mode);
}
Free(st);
}
@ -721,7 +721,7 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
FMFmtDrv(doc);
break;
end:
FMRebuildDoc(&doc,&root,mode);
FMRebuildDoc(&doc,&head,mode);
break;
case CH_SHIFT_ESC:
break;
@ -757,7 +757,7 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
default:
if (sc.u8[0]==SC_INS && sc&SCF_SHIFT && !(sc&SCF_CTRL)) {
FMCopy(doc);
FMRebuildDoc(&doc,&root,mode);
FMRebuildDoc(&doc,&head,mode);
} else if (sc.u8[0]==SC_F5) {
if (doc->cur_entry->type_u8==DOCT_MENU_VAL) {
tempde=doc->cur_entry->user_data;
@ -783,7 +783,7 @@ fm_regular_key:
Fs->display_doc=old_display_doc;
SettingsPop;
DocDel(doc);
DirTreeDel(root);
DirTreeDel(head);
Cd(old_cur_dir);
Free(old_cur_dir);
if (mode!=FM_NORMAL && !res)

@ -4,7 +4,7 @@ I64 Mount2(U8 boot_drv_let,CDoc *_doc,Bool repartition)
I64 cnt,res=0,num_hints,drv_let,type,unit;
U8 blks_buf[STR_LEN],addr_buf[STR_LEN],base0_buf[STR_LEN],base1_buf[STR_LEN],
*filename=NULL,*filename2=NULL;
CATARep *root=NULL,*tempha;
CATARep *head=NULL,*tempha;
Bool one_drv,make_free;
CDoc *doc;
boot_drv_let=ToUpper(boot_drv_let);
@ -45,7 +45,7 @@ I64 Mount2(U8 boot_drv_let,CDoc *_doc,Bool repartition)
break;
case BDT_ATA:
case BDT_ATAPI:
num_hints=ATARep(,,&root);
num_hints=ATARep(,,&head);
if (type==BDT_ATAPI && boot_drv_let)
"<ENTER> to use booted CD/DVD\n"; //Only $LK,"::/Kernel/KCfg.CPP"$
do {
@ -57,7 +57,7 @@ I64 Mount2(U8 boot_drv_let,CDoc *_doc,Bool repartition)
GetS(base0_buf,STR_LEN);
} while (!Str2I64(base0_buf) && (type!=BDT_ATAPI || !boot_drv_let));
if (1<=Str2I64(base0_buf)<=num_hints) {
tempha=ATARepFind(root,Str2I64(base0_buf));
tempha=ATARepFind(head,Str2I64(base0_buf));
StrPrint(base0_buf,"0x%X",tempha->base0);
StrPrint(base1_buf,"0x%X",tempha->base1);
unit=tempha->unit;
@ -75,7 +75,7 @@ I64 Mount2(U8 boot_drv_let,CDoc *_doc,Bool repartition)
} while (!(0<=unit<=1));
'\n';
}
LinkedLstDel(root);
LinkedLstDel(head);
break;
}
DocPrint(doc,"bd=BlkDevNextFreeSlot(\'%C\',%d);bd->unit=%d;\n",

@ -18,7 +18,7 @@ public I64 PrtDsk(U8 drv_let=0)
//drv_let=0 means add new drive that
//is not already mounted.
CBlkDev *bd;
CPlannedDrv root,*temppp;
CPlannedDrv head,*temppp;
CMasterBoot mbr;
Bool pri=TRUE;
I64 ext_base,drv_let2,pri_cnt=0,
@ -45,7 +45,7 @@ public I64 PrtDsk(U8 drv_let=0)
return 0;
drv_dsk_dsk_size=bd->max_blk+1;
QueInit(&root);
QueInit(&head);
drv_let2=bd->first_drv_let;
remaining=FloorU64(bd->max_blk+1,ROUND_DRV_TO);
while (FloorU64(remaining,ROUND_DRV_TO)>=ROUND_DRV_TO) {
@ -68,15 +68,15 @@ public I64 PrtDsk(U8 drv_let=0)
temppp->size=CeilU64(GetI64("Size in Blocks :",
remaining-DRV_HEADER)+DRV_HEADER,ROUND_DRV_TO);
} while (!(ROUND_DRV_TO<=temppp->size<=FloorU64(remaining,ROUND_DRV_TO)));
QueIns(temppp,root.last);
QueIns(temppp,head.last);
remaining-=temppp->size;
drv_let2++;
}
"\n\n!!! Repartition Drive !!!\n\n";
temppp=root.next;
temppp=head.next;
drv_let2=bd->first_drv_let;
while (temppp!=&root) {
while (temppp!=&head) {
"Drive %C:%08X ",drv_let2,temppp->size;
if (temppp->pri)
"Primary\n";
@ -89,7 +89,7 @@ public I64 PrtDsk(U8 drv_let=0)
goto pd_done;
remaining=FloorU64(bd->max_blk+1,ROUND_DRV_TO)-ROUND_DRV_TO;
temppp=root.next;
temppp=head.next;
MemSet(&mbr,0,BLK_SIZE);
mbr.signature=0xAA55;
offset=0;
@ -107,7 +107,7 @@ public I64 PrtDsk(U8 drv_let=0)
temppp=temppp->next;
}
if (!i) i++;
if (temppp!=&root) {
if (temppp!=&head) {
mbr.p[i].active=0x80;
mbr.p[i].start_head=0;
mbr.p[i].start_cyl=0x101;
@ -120,7 +120,7 @@ public I64 PrtDsk(U8 drv_let=0)
}
ATAWriteBlks(bd,&mbr,0,1);
while (temppp!=&root) {
while (temppp!=&head) {
start_offset=offset;
MemSet(&mbr,0,BLK_SIZE);
mbr.signature=0xAA55;
@ -135,7 +135,7 @@ public I64 PrtDsk(U8 drv_let=0)
mbr.p[0].size=temppp->size-DRV_HEADER;
offset+=temppp->size;
temppp=temppp->next;
if (temppp!=&root) {
if (temppp!=&head) {
mbr.p[1].active=0x80;
mbr.p[1].start_head=0;
mbr.p[1].start_cyl=0x101;
@ -154,8 +154,8 @@ public I64 PrtDsk(U8 drv_let=0)
Fmt(i,,FALSE);
pd_done:
while (root.next!=&root) {
temppp=root.next;
while (head.next!=&head) {
temppp=head.next;
QueRem(temppp);
Free(temppp);
}

@ -11,8 +11,8 @@ U0 LoadDocDefines()
//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","121,410");
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","81,046");
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","121,488");
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","81,126");
$ID,-4$
DefinePrint("DD_KERNEL","%08X",bfh);
bfh(I64)+=bfh->file_size-1;
@ -30,6 +30,7 @@ $ID,-4$
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_UNCACHED_ALIAS","%010X",dev.uncached_alias);
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);

@ -248,7 +248,7 @@ U8 *idx=NULL,CDoc *doc=NULL)
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,"$$WW,0$$$$PURPLE$$$$TX+CX,\"%$$Q\"$$$$FG$$\n",cur_idx);
}
}
@ -315,7 +315,7 @@ U8 *idx=NULL,CDoc *doc=NULL)
wh_done:
if (doc) {
if (doc->root.next==doc)
if (doc->head.next==doc)
DocPrint(doc,"No Match");
else
DocRecalc(doc);
@ -387,7 +387,7 @@ public U0 MapFileLoad(U8 *filename)
base=temph(CHashGeneric *)->user_data0+sizeof(CBinFile);
if (!doc) return;
doc_e=doc->root.next;
doc_e=doc->head.next;
while (doc_e!=doc) {
if (doc_e->type_u8==DOCT_LINK) {
if (*doc_e->tag)

@ -20,7 +20,7 @@ $$ --> $$$$
CDoc *doc;
CDocEntry *doc_e;
if (doc=DocRead(in_name,DOCF_PLAIN_TEXT_TABS|DOCF_DBL_DOLLARS)) {
doc_e=doc->root.next;
doc_e=doc->head.next;
while (doc_e!=doc) {
if (doc_e->type_u8==DOCT_TEXT) {
src=dst=doc_e->tag;

@ -126,7 +126,7 @@ U0 ACPutChoices(CDoc *focus_l,CDocEntry *doc_e,CTask *focus_task,
temph->src_link) {
if (temph->type&HTF_PUBLIC)
"$$RED$$";
"$$TX+UL+L+PU,\"%Q\",A=\"%s\"$$$$FG$$\n",st,temph->src_link;
"$$TX+UL+L+PU,\"%$$Q\",A=\"%s\"$$$$FG$$\n",st,temph->src_link;
} else
"%s\n",st;
}

@ -15,7 +15,7 @@ public U0 PCIDevFileGen()
Bool first=TRUE,del=FALSE,del2=FALSE,cont=FALSE;
CDoc *doc=DocRead(PCI_DEV_FILE,
DOCF_PLAIN_TEXT|DOCF_DBL_DOLLARS|DOCF_NO_CURSOR);
CDocEntry *doc_e=doc->root.next,*doc_e2;
CDocEntry *doc_e=doc->head.next,*doc_e2;
while (doc_e!=doc) {
doc_e2=doc_e->next;
if (first) {
@ -53,7 +53,7 @@ U0 PCILookUpSingle(CDoc *doc,I64 m,I64 d,U8 **_vendor,U8 **_dev)
{
Bool first=TRUE;
U8 buf[8],*vendor=NULL,*dev=NULL;
CDocEntry *doc_e=doc->root.next;
CDocEntry *doc_e=doc->head.next;
while (doc_e!=doc) {
if (first) {
if (doc_e->type_u8==DOCT_TEXT && doc_e->tag[0]!=';' &&
@ -120,7 +120,7 @@ U0 PCILookUpDevs()
CPCIDev *temppci;
I64 w1,w2,b,d,f,timeout=32*8*2;
CDoc *doc;
if (dev.pci_root.next!=&dev.pci_root)
if (dev.pci_head.next!=&dev.pci_head)
return;
doc=DocRead(PCI_DEV_FILE,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR);
for (b=0;b<sys_pci_busses;b++)
@ -137,7 +137,7 @@ U0 PCILookUpDevs()
temppci->sub_code=PCIReadU8(b,d,f,0xA);
temppci->base_code=PCIReadU8(b,d,f,0xB);
PCILookUpSingle(doc,w1,w2,&temppci->vendor_str,&temppci->dev_id_str);
QueIns(temppci,dev.pci_root.last);
QueIns(temppci,dev.pci_head.last);
timeout=32*8*2;
} else if (sys_pci_busses==256 && --timeout<=0)
goto lud_done;
@ -155,8 +155,8 @@ public U0 PCIRep()
return;
}
PCILookUpDevs;
temppci=dev.pci_root.next;
while (temppci!=&dev.pci_root) {
temppci=dev.pci_head.next;
while (temppci!=&dev.pci_head) {
"%02X:%02X:%01X %02X%02X $$GREEN$$%s $$CYAN$$%s$$FG$$\n",
temppci->bus,temppci->dev,temppci->fun,
temppci->base_code,temppci->sub_code,
@ -183,8 +183,8 @@ public U0 MemBIOSRep()
"32 Bit Device Mem\n";
while (LBts(&sys_semas[SYS_SEMA_DEV_MEM],0))
Yield;
tempmr=dev.mem32_root.next;
while (tempmr!=&dev.mem32_root) {
tempmr=dev.mem32_head.next;
while (tempmr!=&dev.mem32_head) {
"%02X:0x%016X-0x%016X\n",
tempmr->type,tempmr->base,tempmr->base+tempmr->size-1;
tempmr=tempmr->next;

@ -2,8 +2,8 @@
CDocBin *DocBinFindNum(CDoc *haystack_doc,I64 needle_num)
{
CDocBin *b=haystack_doc->bin_root.next;
while (b!=&haystack_doc->bin_root) {
CDocBin *b=haystack_doc->bin_head.next;
while (b!=&haystack_doc->bin_head) {
if (b->num==needle_num)
return b;
b=b->next;
@ -15,8 +15,8 @@ CDocBin *DocBinFindTag(CDoc *haystack_doc,U8 *needle_tag)
{
CDocBin *b;
if (needle_tag) {
b=haystack_doc->bin_root.next;
while (b!=&haystack_doc->bin_root) {
b=haystack_doc->bin_head.next;
while (b!=&haystack_doc->bin_head) {
if (b->tag && !StrCmp(b->tag,needle_tag))
return b;
b=b->next;
@ -31,8 +31,8 @@ U0 DocBinsValidate(CDoc *doc)
CDocBin *b,*b1;
CDocEntry *doc_e,*doc_e2;
I64 renum_num=0;
b=doc->bin_root.next;
while (b!=&doc->bin_root) {
b=doc->bin_head.next;
while (b!=&doc->bin_head) {
b->use_cnt=0;
b->temp_use_cnt=0;
b->renum_num=-1;
@ -40,7 +40,7 @@ U0 DocBinsValidate(CDoc *doc)
b->tag=NULL;
b=b->next;
}
doc_e=doc->root.next;
doc_e=doc->head.next;
while (doc_e!=doc) {
doc_e2=doc_e->next;
if (doc_e->de_flags & DOCEF_HAS_BIN) {
@ -61,9 +61,9 @@ U0 DocBinsValidate(CDoc *doc)
doc_e=doc_e2;
}
b=doc->bin_root.next;
b=doc->bin_head.next;
doc->cur_bin_num=1;
while (b!=&doc->bin_root) {
while (b!=&doc->bin_head) {
b1=b->next;
if (!b->use_cnt) {
QueRem(b);
@ -128,7 +128,7 @@ I64 DocBinPtrRst(CDoc *doc,CDocEntry *doc_e)
tempb->tag=StrNew(doc_e->tag,doc->mem_task);
else
tempb->tag=NULL;
QueIns(tempb,doc->bin_root.last);
QueIns(tempb,doc->bin_head.last);
} else
bin_num=0;
DocDel(doc2);

@ -540,7 +540,7 @@ ic_overstrike:
goto ic_done;
}
doc_ne=DocEntryNewTag(doc,doc_ce,&ch);
doc_ne->type=DOCT_TEXT | doc->settings_root.dft_text_attr<<8;
doc_ne->type=DOCT_TEXT | doc->settings_head.dft_text_attr<<8;
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
QueIns(doc_ne,doc_ce->last);
} else if (ch=='\n') {
@ -557,10 +557,10 @@ ic_not_overstrike:
if (ch=='\n') {
if (sc&SCF_CTRL && !(sc&SCF_SHIFT)) {
doc_ne=DocEntryNewBase(doc,
DOCT_PAGE_BREAK|doc->settings_root.dft_text_attr<<8);
DOCT_PAGE_BREAK|doc->settings_head.dft_text_attr<<8);
} else {
doc_ne=DocEntryNewBase(doc,
DOCT_NEW_LINE|doc->settings_root.dft_text_attr<<8);
DOCT_NEW_LINE|doc->settings_head.dft_text_attr<<8);
}
DocInsEntry(doc,doc_ne);
} else if (ch=='\t') {
@ -574,7 +574,7 @@ ic_form_tab:
DocFormFwd(doc);
goto ic_done;
} else {
doc_ne=DocEntryNewBase(doc,DOCT_TAB|doc->settings_root.dft_text_attr<<8);
doc_ne=DocEntryNewBase(doc,DOCT_TAB|doc->settings_head.dft_text_attr<<8);
DocInsEntry(doc,doc_ne);
}
} else {
@ -616,7 +616,7 @@ ic_form_tab:
doc->cur_col++;
} else {
doc_ne=DocEntryNewTag(doc,doc_ce,&ch);
doc_ne->type=DOCT_TEXT | doc->settings_root.dft_text_attr<<8;
doc_ne->type=DOCT_TEXT | doc->settings_head.dft_text_attr<<8;
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
doc_ne->x=doc_ce->x+1;
QueIns(doc_ne,doc_ce->last);

@ -12,14 +12,14 @@ public U0 EdCopyToClipboard(CDoc *doc)
CDoc *doc2=sys_clipboard_doc;
Bool unlock_doc=DocLock(doc),
unlock_doc2=DocLock(doc2);
CDocEntry *doc_e=doc->root.next,*doc_ne;
CDocEntry *doc_e=doc->head.next,*doc_ne;
ClipboardDel;
while (doc_e!=doc) {
if (doc_e->type & DOCET_SEL) {
doc_e->type&=~DOCET_SEL;
if (!Bt(doldoc.type_flags_data,doc_e->type_u8)) {
doc_ne=DocEntryCopy(doc2,doc_e);
QueIns(doc_ne,doc2->root.last);
QueIns(doc_ne,doc2->head.last);
}
}
doc_e=doc_e->next;
@ -35,7 +35,7 @@ public U0 EdCutToClipboard(CDoc *doc)
CDoc *doc2=sys_clipboard_doc;
Bool unlock_doc=DocLock(doc),
unlock_doc2=DocLock(doc2);
CDocEntry *doc_e=doc->root.next,*doc_e1,*doc_ne,*doc_e2=NULL;
CDocEntry *doc_e=doc->head.next,*doc_e1,*doc_ne,*doc_e2=NULL;
ClipboardDel;
while (doc_e!=doc) {
doc_e1=doc_e->next;
@ -43,7 +43,7 @@ public U0 EdCutToClipboard(CDoc *doc)
doc_e->type&=~DOCET_SEL;
if (!Bt(doldoc.type_flags_data,doc_e->type_u8)) {
doc_ne=DocEntryCopy(doc2,doc_e);
QueIns(doc_ne,doc2->root.last);
QueIns(doc_ne,doc2->head.last);
}
if (doc_e==doc->cur_entry || doc_e==doc_e2)
doc_e2=doc_e->next;
@ -69,7 +69,7 @@ public U0 EdPasteClipboard(CDoc *doc)
unlock_doc2=DocLock(doc2);
CDocEntry *doc_ce=doc->cur_entry,*doc_e;
if (doc_ce->type_u8==DOCT_DATA) {
doc_e=doc2->root.next;
doc_e=doc2->head.next;
while (doc_e!=doc2) {
if (doc_e->de_flags&DOCEF_TAG)
DocPrintPartial(doc,"%s",doc_e->tag);
@ -111,7 +111,7 @@ public CDoc *DocCopy(CDoc *doc,CDocEntry *start,CDocEntry *end)
while (start!=doc) {
if (!Bt(doldoc.type_flags_data,start->type_u8)) {
doc_ne=DocEntryCopy(doc2,start);
QueIns(doc_ne,doc2->root.last);
QueIns(doc_ne,doc2->head.last);
}
if (start==end)
break;

@ -343,7 +343,7 @@ I64 EdRAGetU8(CDoc *doc)
return res;
}
U0 EdRACollect(CDoc *doc,CRenum *root)
U0 EdRACollect(CDoc *doc,CRenum *head)
{
I64 ch,i;
CRenum *tempr;
@ -373,7 +373,7 @@ U0 EdRACollect(CDoc *doc,CRenum *root)
ch=EdRAGetU8(doc);
tempr=MAlloc(sizeof(CRenum));
StrCpy(tempr->label,buf);
QueIns(tempr,root->last);
QueIns(tempr,head->last);
}
}
}
@ -388,16 +388,16 @@ U0 EdRenumAsm(CDoc *doc)
{
Bool unlock=DocLock(doc);
I64 num=0;
CRenum root,*tempr,*tempr1;
CRenum head,*tempr,*tempr1;
U8 buf[sizeof(CEdFindText.find_text)],
buf2[sizeof(CEdFindText.find_text)];
QueInit(&root);
QueInit(&head);
EdSelFun(doc,TRUE);
EdRACollect(doc,&root);
EdRACollect(doc,&head);
tempr=root.next;
while (tempr!=&root) {
tempr=head.next;
while (tempr!=&head) {
tempr1=tempr->next;
num+=ASM_RENUM_SPACING;
StrPrint(buf,"@#%02d",num);
@ -531,7 +531,7 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
x=doc_e->x+1;
while (i>8) {
doc_ne=DocEntryNewBase(doc,
DOCT_TAB|doc->settings_root.dft_text_attr<<8,,
DOCT_TAB|doc->settings_head.dft_text_attr<<8,,
x,doc_e->y,doc_e->page_line_num);
MemCpy(&doc_ne->settings,
&doc_e->settings,sizeof(CDocSettings));
@ -544,7 +544,7 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
MemSet(b,CH_SPACE,i);
b[i]=0;
doc_ne=DocEntryNewBase(doc,
DOCT_TEXT|doc->settings_root.dft_text_attr<<8,,
DOCT_TEXT|doc->settings_head.dft_text_attr<<8,,
x,doc_e->y,doc_e->page_line_num);
doc_ne->tag=b;
doc_ne->max_col=1;

@ -159,7 +159,7 @@ public Bool DocEd(CDoc *doc,I64 dof_flags=0)
DocLock(doc);
if (res) {
doc_e=doc->root.next;
doc_e=doc->head.next;
while (doc_e!=doc) {
if (doc_e->type_u8==DOCT_DATA || doc_e->type_u8==DOCT_CHECK_BOX)
DocDataScan(doc,doc_e);

@ -20,7 +20,7 @@ public U0 DocLoad(CDoc *doc,U8 *src2,I64 size)
MemCpy(tempb->data,src,tempb->size);
src+=tempb->size;
}
QueIns(tempb,doc->bin_root.last);
QueIns(tempb,doc->bin_head.last);
if (tempb->num>=doc->cur_bin_num)
doc->cur_bin_num=tempb->num+1;
}
@ -37,16 +37,19 @@ public CDoc *DocRead(U8 *name=NULL,I64 flags=0)
CDoc *doc=DocNew;
U8 *src,*name2;
I64 size=0;
CDirContext *dirc;
if (!name) name=blkdev.temp_filename;
doc->flags|=flags;
name2=FileNameAbs(name);
StrCpy(doc->filename.name,name2);
src=FileRead(name2,&size,&doc->file_attr);
Free(name2);
if (src) {
DocLoad(doc,src,size);
if (src=FileRead(name2,&size,&doc->file_attr)) {
if (dirc=DirContextNew(name2)) {
DocLoad(doc,src,size);
DirContextDel(dirc);
}
Free(src);
}
Free(name2);
return doc;
}
@ -64,10 +67,10 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
DocRecalc(doc);
else {
DocRecalc(doc,RECALCF_ADD_CURSOR);
if (doc->root.next->type_u8==DOCT_CURSOR)
DocEntryDel(doc,doc->root.next); //If no cursor, $LK,"DocLoad",A="MN:DocLoad"$() puts at top.
if (doc->head.next->type_u8==DOCT_CURSOR)
DocEntryDel(doc,doc->head.next); //If no cursor, $LK,"DocLoad",A="MN:DocLoad"$() puts at top.
}
for (doc_e=doc->root.next;doc_e!=doc;doc_e=doc_e->next) {
for (doc_e=doc->head.next;doc_e!=doc;doc_e=doc_e->next) {
if (!Bt(doldoc.type_flags_data,doc_e->type_u8)) {
switch (doc_e->type_u8) {
case DOCT_TAB:
@ -100,12 +103,12 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
}
}
}
for (b=doc->bin_root.next;b!=&doc->bin_root;b=b->next)
for (b=doc->bin_head.next;b!=&doc->bin_head;b=b->next)
if (b->use_cnt>b->temp_use_cnt)
cnt+=offset(CDocBin.end)-offset(CDocBin.start)+b->size;
res=MAlloc(cnt);
dst=res;
doc_e=doc->root.next;
doc_e=doc->head.next;
while (doc_e!=doc) {
doc_e1=doc_e->next;
if (!Bt(doldoc.type_flags_data,doc_e->type_u8))
@ -151,8 +154,8 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
doc_e=doc_e1;
}
*dst++=0;
b=doc->bin_root.next;
if (b!=&doc->bin_root) {
b=doc->bin_head.next;
if (b!=&doc->bin_head) {
do {
if (b->use_cnt>b->temp_use_cnt) {
MemCpy(dst,&b->start,offset(CDocBin.end)-offset(CDocBin.start));
@ -161,7 +164,7 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
dst+=b->size;
}
b=b->next;
} while (b!=&doc->bin_root);
} while (b!=&doc->bin_head);
} else
cnt--; //No terminator
if (_size) *_size=cnt;
@ -189,7 +192,7 @@ public U0 DocInsDoc(CDoc *doc=NULL,CDoc *doc2)
//TODO: $LK,"DocRst",A="MN:DocRst"$
U8 *dst;
Bool unlock_doc,unlock_doc2=DocLock(doc2);
CDocEntry *doc_ne,*doc_e=doc2->root.next,*doc_ce;
CDocEntry *doc_ne,*doc_e=doc2->head.next,*doc_ce;
if (!doc) doc=DocPut;
unlock_doc=DocLock(doc),
DocRemSoftNewLines(doc,NULL);
@ -227,7 +230,7 @@ public U0 StreamDoc(CDoc *doc)
{//Inject doc into compile stream. Use inside #exe{}.
//TODO: $LK,"DocRst",A="MN:DocRst"$
Bool unlock_doc=DocLock(doc);
CDocEntry *doc_e=doc->root.next;
CDocEntry *doc_e=doc->head.next;
while (doc_e!=doc) {
if (doc_e->type_u8==DOCT_TEXT)
StreamPrint("%s",doc_e->tag);
@ -251,7 +254,7 @@ Bool DocCaptureUndo(CDoc *doc,Bool force=FALSE)
unlock=DocLock(doc);
time_stamp=GetTSC;
if (doc->flags&DOCF_UNDO_DIRTY &&
time_stamp>doc->undo_root.last->time_stamp+cnts.time_stamp_freq<<4 ||
time_stamp>doc->undo_head.last->time_stamp+cnts.time_stamp_freq<<4 ||
force) {
u=CAlloc(sizeof(CDocUndo),doc->mem_task);
u->time_stamp=time_stamp;
@ -259,7 +262,7 @@ Bool DocCaptureUndo(CDoc *doc,Bool force=FALSE)
doc->flags&=~DOCF_NO_CURSOR;
u->body=DocSave(doc,&u->size);
doc->flags=flags;
QueIns(u,doc->undo_root.last);
QueIns(u,doc->undo_head.last);
doc->flags&=~DOCF_UNDO_DIRTY;
doc->undo_cnt++;
u->doc_flags=doc->flags;
@ -274,19 +277,19 @@ Bool DocCaptureUndo(CDoc *doc,Bool force=FALSE)
U0 DocUndoRestore(CDoc *doc)
{
Bool unlock=DocLock(doc);
CDocUndo *u=doc->undo_root.last,*u_next,*u_last;
if (u!=&doc->undo_root) {
CDocUndo *u=doc->undo_head.last,*u_next,*u_last;
if (u!=&doc->undo_head) {
QueRem(u);
u_next=doc->undo_root.next;
u_last=doc->undo_root.last;
QueInit(&doc->undo_root);
u_next=doc->undo_head.next;
u_last=doc->undo_head.last;
QueInit(&doc->undo_head);
DocRst(doc,TRUE);
doc->flags=u->doc_flags&~DOCF_NO_CURSOR;
DocLoad(doc,u->body,u->size);
doc->flags=u->doc_flags;
DocUndoDel(doc,u);
doc->undo_root.next=u_next;
doc->undo_root.last=u_last;
doc->undo_head.next=u_next;
doc->undo_head.last=u_last;
}
DocUndoCntSet(doc);
doc->flags&=~DOCF_UNDO_DIRTY;

@ -28,7 +28,7 @@ U8 *needle,I64 match=1)
unlock=DocLock(haystack_doc);
if (start_line_num==MIN_I64) {
res=TRUE;
doc_e=haystack_doc->root.next;
doc_e=haystack_doc->head.next;
} else {
res=DocLineNumGoTo(haystack_doc,start_line_num);
doc_e=haystack_doc->cur_entry;
@ -69,7 +69,7 @@ public Bool DocAnchorFind(CDoc *haystack_doc,U8 *needle_str)
CDocEntry *doc_e;
if (haystack_doc) {
unlock=DocLock(haystack_doc);
doc_e=haystack_doc->root.next;
doc_e=haystack_doc->head.next;
if (needle_str)
while (doc_e!=haystack_doc) {
if (doc_e->type_u8==DOCT_ANCHOR && doc_e->de_flags & DOCEF_AUX_STR) {
@ -170,7 +170,7 @@ fn_skip:
public U0 EdSelAll(CDoc *doc,Bool sel)
{//Set state of $LK,"DOCET_SEL",A="MN:DOCET_SEL"$ on all entries.
Bool unlock=DocLock(doc);
CDocEntry *doc_e=doc->root.next;
CDocEntry *doc_e=doc->head.next;
while (doc_e!=doc) {
BEqu(&doc_e->type,DOCEt_SEL,sel);
doc_e=doc_e->next;
@ -401,7 +401,7 @@ I64 EdFindReplace(CDoc *doc)
sf_flags|=SFG_WHOLE_LABELS;
if (i=doc->find_replace->filter_lines) {
doc_ce=doc->root.next;
doc_ce=doc->head.next;
while (doc_ce!=doc) {
if (doc_ce->de_flags&DOCEF_TAG && doc_ce->tag &&
!(doc_ce->de_flags&DOCEF_FILTER_SKIP) &&
@ -413,7 +413,7 @@ I64 EdFindReplace(CDoc *doc)
doc_ce=doc_ce->next;
}
doc_ce=doc->root.next;
doc_ce=doc->head.next;
while (doc_ce!=doc) {
if (!(doc_ce->de_flags&DOCEF_FILTER_SKIP)) {
found=FALSE;
@ -459,7 +459,7 @@ I64 EdFindReplace(CDoc *doc)
if (!plen)
goto fr_unlock_done;
rlen=StrLen(doc->find_replace->replace_text);
if (doc->root.next!=doc) {
if (doc->head.next!=doc) {
doc_e=doc_marker=DocSplitTag(doc,doc->cur_entry,doc->cur_col,
doc->cur_entry->x+doc->cur_col,doc->cur_entry->y,DOCT_MARKER);
do {

@ -260,7 +260,7 @@ public Bool DocForm(U8 *_d,U8 *class_name=lastclass,
ml=ml->next;
}
if (footer) DocPrint(doc,"%s",footer);
if (doc->root.next!=doc) {
if (doc->head.next!=doc) {
Fs->border_src=BDS_CONST;
DocRecalc(doc);
if (DocEd(doc,dof_flags)) {
@ -273,7 +273,7 @@ public Bool DocForm(U8 *_d,U8 *class_name=lastclass,
}
}
}
doc_e=doc->root.next;
doc_e=doc->head.next;
while (doc_e!=doc) {
if (doc_e->de_flags&DOCEF_REMALLOC_DATA) {
*doc_e->user_data(U8 **)=doc_e->data;

@ -3,7 +3,7 @@
U0 EdUndoFilter(CDoc *doc)
{
Bool unlock=DocLock(doc);
CDocEntry *doc_ce=doc->root.next;
CDocEntry *doc_ce=doc->head.next;
while (doc_ce!=doc) {
doc_ce->de_flags&=~DOCEF_FILTER_SKIP;
doc_ce=doc_ce->next;

@ -7,9 +7,9 @@ U0 DocInit()
CHashGeneric *temph;
DefineLstLoad("ST_DOC_CMDS",
"TX\0CR\0SR\0CU\0MK\0TB\0CL\0PB\0PL\0LM\0RM\0HD\0FO\0ID\0FG\0"
"BG\0FD\0BD\0PT\0WW\0UL\0IV\0BK\0SX\0SY\0CM\0AN\0LK\0BT\0"
"DA\0CB\0LS\0MA\0MU\0HX\0TR\0SP\0IB\0IS\0SO\0HL\0HC\0ER\0");
"TX\0CR\0SR\0TB\0PB\0CU\0MK\0PT\0CL\0PL\0LM\0RM\0HD\0FO\0ID\0FG\0"
"BG\0FD\0BD\0WW\0HL\0BK\0IV\0UL\0SX\0SY\0CM\0AN\0LK\0BT\0"
"DA\0CB\0LS\0MA\0MU\0HX\0TR\0SP\0IB\0IS\0SO\0HC\0ER\0");
DefineLstLoad("ST_DOC_FLAGS",
"T\0LEN\0A\0D\0HTML\0LE\0LM\0RE\0RM\0BI\0BP\0RT\0SX\0SY\0SCX\0U\0"
"LC\0LA\0RC\0RA\0LX\0CX\0RX\0TY\0CY\0BY\0"
@ -52,6 +52,7 @@ U0 DocInit()
//Don't forget $LK,"cmp_type_flags_src_code",A="MN:cmp_type_flags_src_code"$.
doldoc.type_flags_nontag_invisible[0]=
1<<DOCT_PMT|
1<<DOCT_PAGE_LEN|
1<<DOCT_LEFT_MARGIN|
1<<DOCT_RIGHT_MARGIN|
@ -62,18 +63,34 @@ U0 DocInit()
1<<DOCT_BACKGROUND|
1<<DOCT_DFT_FOREGROUND|
1<<DOCT_DFT_BACKGROUND|
1<<DOCT_PMT|
1<<DOCT_WORD_WRAP|
1<<DOCT_UNDERLINE|
1<<DOCT_INVERT|
1<<DOCT_HIGHLIGHT|
1<<DOCT_BLINK|
1<<DOCT_INVERT|
1<<DOCT_UNDERLINE|
1<<DOCT_SHIFTED_X|
1<<DOCT_SHIFTED_Y|
1<<DOCT_SPRITE|
1<<DOCT_HIGHLIGHT;
1<<DOCT_SPRITE;
doldoc.type_flags_data[0]=1<<DOCT_DATA|1<<DOCT_HEX_ED|1<<DOCT_CHECK_BOX;
doldoc.type_flags_chk_dup[0]=
1<<DOCT_LEFT_MARGIN|
1<<DOCT_RIGHT_MARGIN|
1<<DOCT_HEADER|
1<<DOCT_FOOTER|
1<<DOCT_FOREGROUND|
1<<DOCT_BACKGROUND|
1<<DOCT_DFT_FOREGROUND|
1<<DOCT_DFT_BACKGROUND|
1<<DOCT_WORD_WRAP|
1<<DOCT_HIGHLIGHT|
1<<DOCT_BLINK|
1<<DOCT_INVERT|
1<<DOCT_UNDERLINE|
1<<DOCT_SHIFTED_X|
1<<DOCT_SHIFTED_Y;
Bts(doldoc.clean_scan_codes,SC_CURSOR_RIGHT);
Bts(doldoc.clean_scan_codes,SC_CURSOR_LEFT);
Bts(doldoc.clean_scan_codes,SC_CURSOR_UP);

@ -5,11 +5,11 @@ StrCpy(captured_macro_name,"Test");
I64 sys_macro_repeat_n=1;
U0 SysMacroStripKey(CSrvCmd *macro_root,I64 a1,I64 a2)
U0 SysMacroStripKey(CSrvCmd *macro_head,I64 a1,I64 a2)
{
CSrvCmd *tempc,*tempc1;
tempc=macro_root->next;
while (tempc!=macro_root) {
tempc=macro_head->next;
while (tempc!=macro_head) {
tempc1=tempc->next;
if (tempc->cmd_code==SVCT_MSG &&
(tempc->msg_code==MSG_KEY_DOWN || tempc->msg_code==MSG_KEY_UP ||
@ -50,20 +50,20 @@ CMacroTemp *Cmd2MT(CSrvCmd *tempc)
return tempmt;
}
U8 *SysMacro2Str(CSrvCmd *macro_root)
U8 *SysMacro2Str(CSrvCmd *macro_head)
{
CSrvCmd *tempc;
I64 cnt=1; //terminating zero
U8 *ptr,*m;
CMacroTemp *tempmt,*tempmt1,root;
CMacroTemp *tempmt,*tempmt1,head;
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
QueInit(&root);
root.type=MT_NULL;
tempc=macro_root->next;
while (tempc!=macro_root) {
QueInit(&head);
head.type=MT_NULL;
tempc=macro_head->next;
while (tempc!=macro_head) {
tempmt=Cmd2MT(tempc);
QueIns(tempmt,root.last);
QueIns(tempmt,head.last);
cnt+=StrLen(tempmt->buf);
if (tempmt->type==MT_CHAR) {
if (tempmt->last->type!=MT_CHAR)
@ -77,8 +77,8 @@ U8 *SysMacro2Str(CSrvCmd *macro_root)
m=MAlloc(cnt);
ptr=m;
tempmt=root.next;
while (tempmt!=&root) {
tempmt=head.next;
while (tempmt!=&head) {
tempmt1=tempmt->next;
if (tempmt->type==MT_MSG) {
StrCpy(ptr, tempmt->buf);
@ -108,7 +108,7 @@ U0 PlaySysMacro(I64 n=1)
U8 *m;
if (TaskValidate(task)) {
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
m=SysMacro2Str(&sys_macro_root);
m=SysMacro2Str(&sys_macro_head);
while (n-- && TaskValidate(task)) {
if (task==Fs)
AutoStr("%s",m);
@ -121,9 +121,9 @@ U0 PlaySysMacro(I64 n=1)
U0 EdInsCapturedMacro()
{
U8 *st=SysMacro2Str(&sys_macro_root);
U8 *st=SysMacro2Str(&sys_macro_head);
if (sys_focus_task) {
XTalk(sys_focus_task,"$$MA+LA,T=\"%s\",LM=\"%Q\"$$",
XTalk(sys_focus_task,"$$MA+LA,T=\"%s\",LM=\"%$$Q\"$$",
captured_macro_name,st);
Free(st);
}
@ -184,7 +184,7 @@ U0 MacroTask(I64)
switch (i) {
case SM_RECORD:
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
QueDel(&sys_macro_root,TRUE);
QueDel(&sys_macro_head,TRUE);
LBts(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
break;
case SM_PLAY:

@ -123,9 +123,9 @@ U0 DocUndoDel(CDoc *,CDocUndo *u)
U0 DocUndoCntSet(CDoc *doc)