Nightly update (ISO SHA-1 4c95b4a)
This commit is contained in:
1 parent
56407a4a13
commit
cfe353a381
11 files changed
+144
-88
No files matched your search
@@ -10,16 +10,17 @@ U0 LoadDocDefines()
|
||||
|
||||
//This is cut and replaced when I generate a distro.
|
||||
//See $LK,"DD_TEMPLEOS_LOC",A="FF:::/Demo/AcctExample/TOS/TOSDistro.HC,DD_TEMPLEOS_LOC"$.
|
||||
$TR-C,"LineRep"$
|
||||
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","119,763");
|
||||
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","81,933");
|
||||
$ID,-4$
|
||||
|
||||
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:::/Adam/Opt/Boot/BootDVD.HC,DD_BOOT_HIGH_LOC_DVD"$
|
||||
|
||||
$TR-C,"LineRep"$
|
||||
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","119,822");
|
||||
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","81,987");
|
||||
$ID,-4$
|
||||
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);
|
||||
|
||||
@@ -43,26 +43,14 @@ public Bool RegDft(U8 *path,U8 *val,Bool is_adam_entry=FALSE)
|
||||
public I64 RegExe(U8 *path)
|
||||
{//Execute doc tree branch in registry.
|
||||
RegCache;
|
||||
return DocTreeBranchExe(sys_registry_doc,path);
|
||||
return DocTreeExe(sys_registry_doc,path);
|
||||
}
|
||||
|
||||
public Bool RegWrite(U8 *path,U8 *fmt,...)
|
||||
{//Rewrite doc tree branch in registry.
|
||||
Bool res,unlock_doc;
|
||||
CDocEntry *tree_branch,*start_indent,*end_indent;
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
Bool res;
|
||||
RegCache;
|
||||
unlock_doc=DocLock(sys_registry_doc);
|
||||
if (res=DocTreeFind(sys_registry_doc,path,
|
||||
&tree_branch,&start_indent,&end_indent))
|
||||
DocCut(sys_registry_doc,tree_branch,end_indent);
|
||||
DocTreeMake(sys_registry_doc,path);
|
||||
DocPrint(sys_registry_doc,"%s",buf);
|
||||
if (DrvIsWritable(*sys_registry_doc->filename.name))
|
||||
DocWrite(sys_registry_doc);
|
||||
if (unlock_doc)
|
||||
DocUnlock(sys_registry_doc);
|
||||
Free(buf);
|
||||
res=DocTreeWriteJoin(sys_registry_doc,path,TRUE,fmt,argc,argv);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -85,24 +73,10 @@ public I64 RegCnt(U8 *path)
|
||||
}
|
||||
|
||||
public Bool RegAppend(U8 *path,U8 *fmt,...)
|
||||
{//Rewrite doc tree branch in registry.
|
||||
Bool res,unlock_doc;
|
||||
CDocEntry *tree_branch,*start_indent,*end_indent;
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
{//Append to doc tree branch in registry.
|
||||
Bool res;
|
||||
RegCache;
|
||||
unlock_doc=DocLock(sys_registry_doc);
|
||||
if (res=DocTreeFind(sys_registry_doc,path,
|
||||
&tree_branch,&start_indent,&end_indent)) {
|
||||
sys_registry_doc->cur_entry=end_indent;
|
||||
sys_registry_doc->cur_col=sys_registry_doc->cur_entry->min_col;
|
||||
} else
|
||||
DocTreeMake(sys_registry_doc,path);
|
||||
DocPrint(sys_registry_doc,"%s",buf);
|
||||
if (DrvIsWritable(*sys_registry_doc->filename.name))
|
||||
DocWrite(sys_registry_doc);
|
||||
if (unlock_doc)
|
||||
DocUnlock(sys_registry_doc);
|
||||
Free(buf);
|
||||
res=DocTreeAppendJoin(sys_registry_doc,path,TRUE,fmt,argc,argv);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,17 +87,18 @@ public U0 DocCut(CDoc *doc,CDocEntry *start,CDocEntry *end)
|
||||
{//Del start to end entry, including end points.
|
||||
Bool unlock_doc=DocLock(doc);
|
||||
CDocEntry *doc_e1;
|
||||
while (start!=doc) {
|
||||
doc_e1=start->next;
|
||||
if (start==doc->cur_entry) {
|
||||
doc->cur_entry=start->next;
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
}
|
||||
DocEntryDel(doc,start);
|
||||
if (start==end)
|
||||
break;
|
||||
start=doc_e1;
|
||||
}
|
||||
if (start!=doc && (start->last!=end || end==doc))
|
||||
do {
|
||||
doc_e1=start->next;
|
||||
if (start==doc->cur_entry) {
|
||||
doc->cur_entry=start->next;
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
}
|
||||
DocEntryDel(doc,start);
|
||||
if (start==end)
|
||||
break;
|
||||
start=doc_e1;
|
||||
} while (start!=doc);
|
||||
DocRemSoftNewLines(doc,NULL);
|
||||
if (unlock_doc)
|
||||
DocUnlock(doc);
|
||||
@@ -108,15 +109,16 @@ public CDoc *DocCopy(CDoc *doc,CDocEntry *start,CDocEntry *end)
|
||||
CDoc *doc2=DocNew;
|
||||
Bool unlock_doc=DocLock(doc);
|
||||
CDocEntry *doc_ne;
|
||||
while (start!=doc) {
|
||||
if (!Bt(doldoc.type_flags_data,start->type_u8)) {
|
||||
doc_ne=DocEntryCopy(doc2,start);
|
||||
QueIns(doc_ne,doc2->head.last);
|
||||
}
|
||||
if (start==end)
|
||||
break;
|
||||
start=start->next;
|
||||
}
|
||||
if (start!=doc && (start->last!=end || end==doc))
|
||||
do {
|
||||
if (!Bt(doldoc.type_flags_data,start->type_u8)) {
|
||||
doc_ne=DocEntryCopy(doc2,start);
|
||||
QueIns(doc_ne,doc2->head.last);
|
||||
}
|
||||
if (start==end)
|
||||
break;
|
||||
start=start->next;
|
||||
} while (start!=doc);
|
||||
if (unlock_doc)
|
||||
DocUnlock(doc);
|
||||
return doc2;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#help_index "DolDoc"
|
||||
#help_index "DolDoc/Tree"
|
||||
|
||||
public Bool DocTreeFind(CDoc *haystack_doc,U8 *needle_path,
|
||||
CDocEntry **_tree_entry=NULL,
|
||||
CDocEntry **_start_indent=NULL, CDocEntry **_end_indent=NULL)
|
||||
{//Find registry-like tree widget start and end.
|
||||
{//Find tree widget start and end.
|
||||
I64 i=0,k=0;
|
||||
U8 *st1=StrNew(needle_path),*st2=MAlloc(StrLen(needle_path)+1);
|
||||
Bool res=FALSE,unlock_doc=DocLock(haystack_doc);
|
||||
@@ -58,8 +58,16 @@ ft_done:
|
||||
return res;
|
||||
}
|
||||
|
||||
public Bool DocTreeFFind(U8 *name,U8 *path)
|
||||
{//Find tree widget in file.
|
||||
CDoc *doc=DocRead(name);
|
||||
Bool res=DocTreeFind(doc,path);
|
||||
DocDel(doc);
|
||||
return res;
|
||||
}
|
||||
|
||||
public Bool DocTreeMake(CDoc *doc,U8 *path)
|
||||
{//Make registry-like tree widget.
|
||||
{//Make tree widget.
|
||||
I64 i=0,j=I64_MIN,k=0;
|
||||
U8 *st1=StrNew(path),
|
||||
*st2=MAlloc(StrLen(path)+1),
|
||||
@@ -113,6 +121,73 @@ mt_done:
|
||||
return res;
|
||||
}
|
||||
|
||||
Bool DocTreeWriteJoin(CDoc *doc,U8 *path,Bool write,U8 *fmt,I64 argc,I64 *argv)
|
||||
{//Rewrite doc tree branch.
|
||||
CDocEntry *tree_branch,*start_indent,*end_indent;
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
Bool res,unlock_doc=DocLock(doc);
|
||||
if (res=DocTreeFind(doc,path,
|
||||
&tree_branch,&start_indent,&end_indent)) {
|
||||
DocCut(doc,start_indent->next,end_indent->last);
|
||||
doc->cur_entry=start_indent->next;
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
} else
|
||||
DocTreeMake(doc,path);
|
||||
DocPrint(doc,"%s",buf);
|
||||
if (write && DrvIsWritable(*doc->filename.name))
|
||||
DocWrite(doc);
|
||||
if (unlock_doc)
|
||||
DocUnlock(doc);
|
||||
Free(buf);
|
||||
return res;
|
||||
}
|
||||
|
||||
Bool DocTreeAppendJoin(CDoc *doc,U8 *path,Bool write,U8 *fmt,I64 argc,I64 *argv)
|
||||
{//Append to doc tree branch.
|
||||
CDocEntry *tree_branch,*start_indent,*end_indent;
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
Bool res,unlock_doc=DocLock(doc);
|
||||
if (res=DocTreeFind(doc,path,
|
||||
&tree_branch,&start_indent,&end_indent)) {
|
||||
doc->cur_entry=end_indent;
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
} else
|
||||
DocTreeMake(doc,path);
|
||||
DocPrint(doc,"%s",buf);
|
||||
if (write && DrvIsWritable(*doc->filename.name))
|
||||
DocWrite(doc);
|
||||
if (unlock_doc)
|
||||
DocUnlock(doc);
|
||||
Free(buf);
|
||||
return res;
|
||||
}
|
||||
|
||||
public Bool DocTreeWrite(CDoc *doc,U8 *path,Bool write=TRUE,U8 *fmt,...)
|
||||
{//Rewrite doc tree branch.
|
||||
return DocTreeWriteJoin(doc,path,write,fmt,argc,argv);
|
||||
}
|
||||
|
||||
public Bool DocTreeAppend(CDoc *doc,U8 *path,Bool write=TRUE,U8 *fmt,...)
|
||||
{//Append to doc tree branch.
|
||||
return DocTreeAppendJoin(doc,path,write,fmt,argc,argv);
|
||||
}
|
||||
|
||||
public Bool DocTreeFWrite(U8 *name,U8 *path,U8 *fmt,...)
|
||||
{//Rewrite doc tree branch in file.
|
||||
CDoc *doc=DocRead(name);
|
||||
Bool res=DocTreeWriteJoin(doc,path,TRUE,fmt,argc,argv);
|
||||
DocDel(doc);
|
||||
return res;
|
||||
}
|
||||
|
||||
public Bool DocTreeFAppend(U8 *name,U8 *path,U8 *fmt,...)
|
||||
{//Append to doc tree branch in file.
|
||||
CDoc *doc=DocRead(name);
|
||||
Bool res=DocTreeAppendJoin(doc,path,TRUE,fmt,argc,argv);
|
||||
DocDel(doc);
|
||||
return res;
|
||||
}
|
||||
|
||||
#help_index "DolDoc/Compiler;Compiler"
|
||||
public I64 ExeDoc(CDoc *doc,I64 ccf_flags=0)
|
||||
{//JIT Compile and execute a document.
|
||||
@@ -141,8 +216,9 @@ public I64 ExeDoc(CDoc *doc,I64 ccf_flags=0)
|
||||
return res;
|
||||
}
|
||||
|
||||
public I64 DocTreeBranchExe(CDoc *doc,U8 *path)
|
||||
{//JIT Compile and execute code in doc tree branch.
|
||||
#help_index "DolDoc/Tree;DolDoc/Compiler;Compiler"
|
||||
public I64 DocTreeExe(CDoc *doc,U8 *path)
|
||||
{//Execute doc tree branch.
|
||||
CDoc *doc2;
|
||||
Bool unlock_doc=DocLock(doc);
|
||||
CDocEntry *tree_branch,*start_indent,*end_indent;
|
||||
@@ -157,11 +233,11 @@ public I64 DocTreeBranchExe(CDoc *doc,U8 *path)
|
||||
return res;
|
||||
}
|
||||
|
||||
public I64 ExeTreeBranch(U8 *registry_file,U8 *path)
|
||||
{//JIT Compile and execute a specified branch in a specified file.
|
||||
public I64 DocTreeFExe(U8 *name,U8 *path)
|
||||
{//Execute doc tree branch in file.
|
||||
I64 res;
|
||||
CDoc *doc=DocRead(registry_file);
|
||||
res=DocTreeBranchExe(doc,path);
|
||||
CDoc *doc=DocRead(name);
|
||||
res=DocTreeExe(doc,path);
|
||||
DocDel(doc);
|
||||
return res;
|
||||
}
|
||||
Reference in new issue
Block a user