TempleOSTS_131005.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:45:52 +02:00
1 parent 1343005a29
commit 2d2a65d572
547 files changed
+33608 -12549

No files matched your search

+6 -6
View File
@@ -2,15 +2,15 @@
DefineLstLoad("ST_BIN_FILE_TYPES",
"END\0 \0"
"REL_EXPORT\0"
"LIT_EXPORT\0"
"IMM_EXPORT\0"
"REL_U8\0"
"LIT_U8\0"
"IMM_U8\0"
"REL_U16\0"
"LIT_U16\0"
"IMM_U16\0"
"REL_U32\0"
"LIT_U32\0"
"IMM_U32\0"
"REL_U64\0"
"LIT_U64\0"
"IMM_U64\0"
" \0 \0 \0 \0"
"MAIN\0"
"MODULE_ALIGN\0MODULE_ORG\0"
@@ -57,7 +57,7 @@ public Bool BinRep(U8 *filename)
ptr+=StrLen(sptr)+1;
"%16Z:$$FG,GREEN$$%s$$FG$$:%X ",etype,"ST_BIN_FILE_TYPES",sptr,i;
switch (etype) {
case EIE_REL_U8...EIE_LIT_U64:
case EIE_REL_U8...EIE_IMM_U64:
if (*sptr)
saved_hash_ptr=HashFind(sptr,Fs->hash_table,HTG_ALL);
if (!saved_hash_ptr)
+3 -3
View File
@@ -10,7 +10,7 @@ I64 PopUpDiffOptions()
{
I64 i;
CDoc *doc=DocNew;
DocPutS(doc,"$$CM+LX,2,4$$$$FG$$$$BT,\"USE FILE1\",DS_USE_FILE1$$"
DocPrint(doc,"$$CM+LX,2,4$$$$FG$$$$BT,\"USE FILE1\",DS_USE_FILE1$$"
"$$CM+LX,24,0$$$$FG,CYAN$$$$BT,\"USE FILE2\",DS_USE_FILE2$$"
"$$CM+LX,2,4$$$$FG$$$$BT,\"REMAINDER ALL FILE1\",DS_REMAINDER_1$$"
"$$CM+LX,24,0$$$$FG,CYAN$$$$BT,\"REMAINDER ALL FILE2\",DS_REMAINDER_2$$"
@@ -65,7 +65,7 @@ U0 DiffSelect(CDoc *doc,I64 *_df_flags,I64 j1_lo,I64 j1_hi,
old_flags=cur_l->flags&DOCF_PLAIN_TEXT;
cur_l->flags|=DOCF_PLAIN_TEXT;
}
"" doc_us1[i++]->tag;
"%s",doc_us1[i++]->tag;
if (cur_l)
cur_l->flags= cur_l->flags&~DOCF_PLAIN_TEXT |old_flags;
NewLine;
@@ -80,7 +80,7 @@ U0 DiffSelect(CDoc *doc,I64 *_df_flags,I64 j1_lo,I64 j1_hi,
old_flags=cur_l->flags&DOCF_PLAIN_TEXT;
cur_l->flags|=DOCF_PLAIN_TEXT;
}
"" doc_us2[i++]->tag;
"%s",doc_us2[i++]->tag;
if (cur_l)
cur_l->flags= cur_l->flags&~DOCF_PLAIN_TEXT |old_flags;
NewLine;
+27 -41
View File
@@ -11,8 +11,8 @@ I64 PopUpReplaceSkipAllCancelEd(U8 *msg)
{
I64 i;
CDoc *doc=DocNew;
DocPutS(doc,msg);
DocPutS(doc,"$$CM+LX,2,4$$$$BT,\"REPLACE\",GRF_REPLACE$$"
DocPrint(doc,"%s",msg);
DocPrint(doc,"$$CM+LX,2,4$$$$BT,\"REPLACE\",GRF_REPLACE$$"
"$$CM+LX,22,0$$$$BT,\"SKIP\",GRF_SKIP$$"
"$$CM+LX,2,4$$$$BT,\"ALL\",GRF_ALL$$"
"$$CM+LX,22,0$$$$BT,\"ABORT ALL\",DOCM_CANCEL$$"
@@ -35,15 +35,15 @@ I64 GrepFile(U8 *pattern,U8 *name,I64 *_fuf_flags,U8 *replace_text)
CDocEntry *doc_e;
if (Bt(_fuf_flags,FUf_IGNORE))
ss_flags=SRF_IGNORE_CASE;
ss_flags=SFF_IGNORE_CASE;
else
ss_flags=0;
if (Bt(_fuf_flags,FUf_WHOLE_LABELS))
ss_flags|=SRG_WHOLE_LABELS;
ss_flags|=SFG_WHOLE_LABELS;
if (Bt(_fuf_flags,FUf_WHOLE_LABELS_FRONT))
ss_flags|=SRF_WHOLE_LABELS_FRONT;
ss_flags|=SFF_WHOLE_LABELS_FRONT;
if (Bt(_fuf_flags,FUf_WHOLE_LABELS_BACK))
ss_flags|=SRF_WHOLE_LABELS_BACK;
ss_flags|=SFF_WHOLE_LABELS_BACK;
plen=StrLen(pattern);
if (replace_text)
@@ -54,12 +54,12 @@ I64 GrepFile(U8 *pattern,U8 *name,I64 *_fuf_flags,U8 *replace_text)
src=doc_e->tag;
first_on_line=TRUE;
while (src && cont) {
if (src=SearchStr(src,pattern,ss_flags)) {
if (src=StrFind(pattern,src,ss_flags)) {
cnt++;
if (first_on_line || Bt(_fuf_flags,FUf_REPLACE)) {
first_on_line=FALSE;
PutFileLink(name,doc_e->y+1,TRUE);
name_buf=MSPrintF("%s,%d",name,doc_e->y+1);
name_buf=MPrint("%s,%d",name,doc_e->y+1);
if (cur_l=DocPut) {
old_flags=cur_l->flags&DOCF_PLAIN_TEXT;
cur_l->flags|=DOCF_PLAIN_TEXT;
@@ -143,27 +143,7 @@ I64 GrepFile(U8 *pattern,U8 *name,I64 *_fuf_flags,U8 *replace_text)
return cnt;
}
I64 GrepLst(U8 *pattern,CDirEntry *tempm1,I64 *_fuf_flags,U8 *replace_text)
{
I64 cnt=0;
CDirEntry *tempm2;
while (tempm1 && !Bt(_fuf_flags,FUf_CANCEL)) {
tempm2=tempm1->next;
if (tempm1->attr & _ATTR_DIR) {
if (tempm1->sub) {
"%S %s\n","ST_SCANNING_DIR",tempm1->full_name;
cnt+=GrepLst(pattern,tempm1->sub,_fuf_flags,replace_text);
}
} else
cnt+=GrepFile(pattern,tempm1->full_name,_fuf_flags,replace_text);
CDirEntryDel(tempm1);
tempm1=tempm2;
}
return cnt;
}
public I64 Grep(U8 *pattern,U8 *files_find_mask=FILENAME_MASK_TXT,U8 *fu_flags=NULL,U8 *replace_text=NULL)
public I64 Grep(U8 *pattern,U8 *files_find_mask="*",U8 *fu_flags=NULL,U8 *replace_text=NULL)
/*
This does not do regular expressions--my bad.
Anyway, it's good for searching and replacing.
@@ -183,23 +163,29 @@ Let's say it stands for global replace ;-)
{
I64 cnt=0,fuf_flags=0;
CDirEntry *tempm;
GetFFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+i"); //Set dft flags
GetFFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
if (fuf_flags&~(FUG_FILES_FIND|FUF_IGNORE|FUF_WHOLE_LABELS|FUF_WHOLE_LABELS_FRONT|FUF_WHOLE_LABELS_BACK))
CDirEntry *tempde,*tempde1;
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+i+f+F+T");
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
if (fuf_flags&~(FUG_FILES_FIND|FUF_IGNORE|FUF_ALL|FUF_WHOLE_LABELS|FUF_WHOLE_LABELS_FRONT|FUF_WHOLE_LABELS_BACK))
throw(EXCEPT_FUF,1);
LBEqu(&fuf_flags,FUf_REPLACE,replace_text);
tempm=FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND);
fuf_flags&=FUF_REPLACE|FUF_IGNORE|FUF_WHOLE_LABELS|FUF_WHOLE_LABELS_FRONT|FUF_WHOLE_LABELS_BACK;
cnt+=GrepLst(pattern,tempm,&fuf_flags,replace_text);
tempde=tempde1=FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND);
fuf_flags&=FUF_ALL|FUF_REPLACE|FUF_IGNORE|FUF_WHOLE_LABELS|FUF_WHOLE_LABELS_FRONT|FUF_WHOLE_LABELS_BACK;
while (tempde && !Bt(&fuf_flags,FUf_CANCEL)) {
cnt+=GrepFile(pattern,tempde->full_name,&fuf_flags,replace_text);
tempde=tempde->next;
}
DirLstDel(tempde1);
return cnt;
}
public I64 FileOcc(U8 *pattern,U8 *files_find_mask=FILENAME_MASK_TXT,U8 *fu_flags="+r+i+l")
public I64 FileOcc(U8 *pattern,U8 *files_find_mask="*",U8 *fu_flags="+r+i+l")
{/*
"+r"=recurse
"+i"=ignore case
"+l"=whole labels only.
"+lf"=only checks for label chars in front
"+lb"=only checks for label chars behind (after).
*/
I64 cnt=0;
Bool old_silent=Silent(TRUE);
@@ -226,7 +212,7 @@ I64 GrepWiz()
CGrep *g=CAlloc(sizeof(CGrep));
I64 result=0;
g->recurse=TRUE;
StrCpy(g->filemask,FILENAME_MASK_TXT);
StrCpy(g->filemask,FILEMASK_TXT);
if (doc=DocPut) {
StrCpy(g->find_text,doc->find_replace->find_text);
StrCpy(g->replace_text,doc->find_replace->replace_text);
@@ -234,7 +220,7 @@ I64 GrepWiz()
g->match_case=doc->find_replace->match_case;
g->whole_labels=doc->find_replace->whole_labels;
}
if (DocFormDo(g,"CGrep",0,"$$FG,PURPLE$$$$TX+CX,\"Grep\"$$\n$$FG$$")) {
if (DocFormDo(g,,0,"$$FG,PURPLE$$$$TX+CX,\"Grep\"$$\n$$FG$$")) {
if (doc) {
StrCpy(doc->find_replace->find_text,g->find_text);
StrCpy(doc->find_replace->replace_text,g->replace_text);
@@ -252,9 +238,9 @@ I64 GrepWiz()
if (g->whole_labels)
StrCat(buf,"+l");
if (g->replace)
st=MSPrintF("\"$$$$WW+H,1$$$$\";Cd(\"%s\");Grep(\"%Q\",\"%Q\",\"%Q\",\"%Q\");UserTaskCont;",dir,g->find_text,g->filemask,buf,g->replace_text);
st=MPrint("\"$$$$WW+H,1$$$$\";Cd(\"%s\");Grep(\"%Q\",\"%Q\",\"%Q\",\"%Q\");UserTaskCont;",dir,g->find_text,g->filemask,buf,g->replace_text);
else
st=MSPrintF("\"$$$$WW+H,1$$$$\";Cd(\"%s\");Grep(\"%Q\",\"%Q\",\"%Q\");UserTaskCont;",dir,g->find_text,g->filemask,buf);
st=MPrint("\"$$$$WW+H,1$$$$\";Cd(\"%s\");Grep(\"%Q\",\"%Q\",\"%Q\");UserTaskCont;",dir,g->find_text,g->filemask,buf);
result=PopUp(st);
}
Free(dir);
+55 -61
View File
@@ -1,43 +1,37 @@
#help_index "Utils;Cmd Line (Typically)"
I64 LineCntRepFiles(CDirEntry *tempm)
I64 LineCntRepFiles(CDirEntry *tempde)
{
CDoc *doc;
I64 result=0,i;
while (tempm) {
while (tempde) {
i=0;
if (tempm->attr&_ATTR_DIR)
i=LineCntRepFiles(tempm->sub);
if (tempde->attr&_ATTR_DIR)
i=LineCntRepFiles(tempde->sub);
else {
if (FilesFindMatch(FILENAME_MASK_SRC,tempm->name)) {
doc=DocRead(tempm->full_name);
if (doc->root.next!=doc)
i=doc->root.last->y+2;
DocDel(doc);
}
doc=DocRead(tempde->full_name);
if (doc->root.next!=doc)
i=doc->root.last->y+2;
DocDel(doc);
}
tempm->user_data=i;
tempde->user_data=i;
result+=i;
tempm=tempm->next;
tempde=tempde->next;
}
return result;
}
U0 PutLineCntFiles(CDoc *doc,CDirEntry *tempm)
U0 PutLineCntFiles(CDoc *doc,CDirEntry *tempde)
{
while (tempm) {
if (tempm->attr&_ATTR_DIR) {
DocPrintF(doc,"%8,d $$TR+C,\"%s\"$$\n$$ID,2$$",tempm->user_data,tempm->name);
PutLineCntFiles(doc,tempm->sub);
DocPutS(doc,"$$ID,-2$$");
} else {
if (FilesFindMatch(FILENAME_MASK_SRC,tempm->name)) {
DocPrintF(doc,"%8,d ",tempm->user_data);
DocPrintF(doc,"$$LK,\"%s\",\"FI:%s\"$$\n",
tempm->name,tempm->full_name);
}
}
tempm=tempm->next;
while (tempde) {
if (tempde->attr&_ATTR_DIR) {
DocPrint(doc,"%8,d $$TR+C,\"%s\"$$\n$$ID,2$$",tempde->user_data,tempde->name);
PutLineCntFiles(doc,tempde->sub);
DocPrint(doc,"$$ID,-2$$");
} else
DocPrint(doc,"%8,d $$LK,\"%s\",\"FI:%s\"$$\n",
tempde->user_data,tempde->name,tempde->full_name);
tempde=tempde->next;
}
}
@@ -45,49 +39,49 @@ public I64 LineCntRep(U8 *files_find_mask="/TempleOS/*",U8 *fu_flags=NULL)
{
I64 fuf_flags=0,result=0;
CDoc *doc=DocNew;
CDirEntry *tempm1=NULL;
GetFFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r");
GetFFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
if (tempm1=FilesFind(files_find_mask,fuf_flags)) {
result=LineCntRepFiles(tempm1);
DocPrintF(doc,"%8,d $$TR+C,\"%s\"$$\n$$ID,2$$",result,files_find_mask);
PutLineCntFiles(doc,tempm1);
DocPutS(doc,"$$ID,-2$$");
CDirLstDel(tempm1);
CDirEntry *tempde1=NULL;
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+S");
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
if (tempde1=FilesFind(files_find_mask,fuf_flags)) {
result=LineCntRepFiles(tempde1);
DocPrint(doc,"%8,d $$TR+C,\"%s\"$$\n$$ID,2$$",result,files_find_mask);
PutLineCntFiles(doc,tempde1);
DocPrint(doc,"$$ID,-2$$");
DirLstDel(tempde1);
}
DocInsDoc(DocPut,doc);
DocDel(doc);
return result;
}
I64 TreeSizeRepFiles(CDirEntry *tempm)
I64 TreeSizeRepFiles(CDirEntry *tempde)
{
I64 result=0,i;
while (tempm) {
if (tempm->attr&_ATTR_DIR)
i=TreeSizeRepFiles(tempm->sub);
while (tempde) {
if (tempde->attr&_ATTR_DIR)
i=TreeSizeRepFiles(tempde->sub);
else
i=tempm->size;
tempm->user_data=i;
i=tempde->size;
tempde->user_data=i;
result+=i;
tempm=tempm->next;
tempde=tempde->next;
}
return result;
}
U0 PutTreeSizeFiles(CDoc *doc,CDirEntry *tempm)
U0 PutTreeSizeFiles(CDoc *doc,CDirEntry *tempde)
{
while (tempm) {
if (tempm->attr&_ATTR_DIR) {
DocPrintF(doc,"%10,d $$TR+C,\"%s\"$$\n$$ID,2$$",tempm->user_data,tempm->name);
PutTreeSizeFiles(doc,tempm->sub);
DocPutS(doc,"$$ID,-2$$");
while (tempde) {
if (tempde->attr&_ATTR_DIR) {
DocPrint(doc,"%10,d $$TR+C,\"%s\"$$\n$$ID,2$$",tempde->user_data,tempde->name);
PutTreeSizeFiles(doc,tempde->sub);
DocPrint(doc,"$$ID,-2$$");
} else {
DocPrintF(doc,"%10,d ",tempm->user_data);
DocPrintF(doc,"$$LK,\"%s\",\"FI:%s\"$$\n",
tempm->name,tempm->full_name);
DocPrint(doc,"%10,d ",tempde->user_data);
DocPrint(doc,"$$LK,\"%s\",\"FI:%s\"$$\n",
tempde->name,tempde->full_name);
}
tempm=tempm->next;
tempde=tempde->next;
}
}
@@ -95,15 +89,15 @@ public I64 TreeSizeRep(U8 *files_find_mask="/TempleOS/*",U8 *fu_flags=NULL)
{
I64 fuf_flags=0,result=0;
CDoc *doc=DocNew;
CDirEntry *tempm1=NULL;
GetFFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r");
GetFFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
if (tempm1=FilesFind(files_find_mask,fuf_flags)) {
result=TreeSizeRepFiles(tempm1);
DocPrintF(doc,"%10,d $$TR+C,\"%s\"$$\n$$ID,2$$",result,files_find_mask);
PutTreeSizeFiles(doc,tempm1);
DocPutS(doc,"$$ID,-2$$");
CDirLstDel(tempm1);
CDirEntry *tempde1=NULL;
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r");
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
if (tempde1=FilesFind(files_find_mask,fuf_flags)) {
result=TreeSizeRepFiles(tempde1);
DocPrint(doc,"%10,d $$TR+C,\"%s\"$$\n$$ID,2$$",result,files_find_mask);
PutTreeSizeFiles(doc,tempde1);
DocPrint(doc,"$$ID,-2$$");
DirLstDel(tempde1);
}
DocInsDoc(DocPut,doc);
DocDel(doc);
+12 -24
View File
@@ -44,31 +44,19 @@ I64 LinkChkFile(U8 *filename,I64 *_fuf_flags)
return result;
}
I64 LinkChkLst(CDirEntry *tempm1,I64 *_fuf_flags)
{
CDirEntry *tempm2;
I64 result=0;
while (tempm1 && !Bt(_fuf_flags,FUf_CANCEL)) {
tempm2=tempm1->next;
if (tempm1->attr & _ATTR_DIR) {
if (tempm1->sub) {
"%S %s\n","ST_SCANNING_DIR",tempm1->full_name;
result+=LinkChkLst(tempm1->sub,_fuf_flags);
}
} else
result+=LinkChkFile(tempm1->full_name,_fuf_flags);
CDirEntryDel(tempm1);
tempm1=tempm2;
}
return result;
}
public I64 LinkChk(U8 *files_find_mask=FILENAME_MASK_TXT,U8 *fu_flags=NULL)
public I64 LinkChk(U8 *files_find_mask="/TempleOS/*",U8 *fu_flags=NULL)
//Checks for broken file links.
{
I64 fuf_flags=0;
GetFFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+T");
GetFFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
return LinkChkLst(FilesFind(files_find_mask,fuf_flags),&fuf_flags);
I64 fuf_flags=0,result=0;
CDirEntry *tempde,*tempde1;
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+T+f+F");
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
while (tempde && !Bt(&fuf_flags,FUf_CANCEL)) {
result+=LinkChkFile(tempde->full_name,&fuf_flags);
tempde=tempde->next;
}
DirLstDel(tempde1);
return result;
}
#help_index ""
+7 -4
View File
@@ -106,7 +106,7 @@ Bool MemRepTask(CTask *task,Bool override_validate=FALSE)
if (!override_validate && !TaskValidate(task))
return FALSE;
if (task==Fs)
task->rsp=GetStkPtr;
task->rsp=GetRSP;
st=MStrUtil(task->task_title,SUF_REM_CTRL_CHARS|SUF_SAFE_DOLLAR);
"$$FG,GREEN$$Task:%010X$$FG,CYAN$$ %-30ts$$FG$$\n$$ID,2$$",task,st;
Free(st);
@@ -199,14 +199,17 @@ public U0 MemRep()
I64 i;
CTask *task;
CCPU *c;
U32 *u32_ptr;
Bool old_preempt=Preempt(OFF);
CBinFile *bfh=sys_boot_base-sizeof(CBinFile);
bfh(I64)+=bfh->file_size-1;
"$$FG,BLACK$$Low Memory\t:0000100000$$FG$$\n$$ID,2$$";
u32_ptr=SYS_BOOT_BASE;
"Kernel\t:%010X-%010X\n",*u32_ptr-sizeof(CBinFile),bfh;
"Kernel\t:%010X-%010X\n",sys_boot_base-sizeof(CBinFile),bfh;
i=++bfh(I64);
bfh(I64)+=bfh->file_size-1;
"Compiler\t:%010X-%010X\n",i,bfh;
"VGA\t\t:00000A0000-00000BFFFF\n";
"$$ID,-2$$$$FG,BLACK$$High Memory\t:0000100000-%010X$$FG$$\n",
sys_heap_limit;
+34 -46
View File
@@ -10,30 +10,30 @@ CDirEntry MCMatchFind(CDirEntry *pattern,CDirEntry *lst)
return NULL;
}
U0 MergeChkLst(CDirEntry *m1,CDirEntry *m2,I64 *_fuf_flags,I64 *_df_flags)
U0 MergeChkLst(CDirEntry *tempde1,CDirEntry *tempde2,I64 *_fuf_flags,I64 *_df_flags)
{
I64 i;
CDirEntry *tempm2;
while (m1 && !(*_df_flags & DF_ABORT_ALL_FILES)) {
tempm2=MCMatchFind(m1,m2);
if (!tempm2)
"$$FG,BROWN$$Does Not Exist:%s$$FG$$\n",m1->full_name;
CDirEntry *tempde;
while (tempde1 && !(*_df_flags & DF_ABORT_ALL_FILES)) {
tempde=MCMatchFind(tempde1,tempde2);
if (!tempde)
"$$FG,BROWN$$Does Not Exist:%s$$FG$$\n",tempde1->full_name;
else {
if (m1->attr & _ATTR_DIR)
MergeChkLst(m1->sub,tempm2->sub,_fuf_flags,_df_flags);
if (tempde1->attr & _ATTR_DIR)
MergeChkLst(tempde1->sub,tempde->sub,_fuf_flags,_df_flags);
else {
i=m1->datetime-tempm2->datetime;
i=tempde1->datetime-tempde->datetime;
if (AbsI64(i)>CDATE_FREQ*2) { //Filedates can shift due to conversion
"" m1->full_name;
"%s",tempde1->full_name;
NewLine;
if (Bt(_fuf_flags,FUf_DIFF)) {
if (FilesFindMatch(FILENAME_MASK_TXT,m1->full_name))
Diff(tempm2->full_name,m1->full_name,_df_flags);
if (FilesFindMatch(tempde1->full_name,FILEMASK_TXT))
Diff(tempde->full_name,tempde1->full_name,_df_flags);
}
}
}
}
m1=m1->next;
tempde1=tempde1->next;
}
}
@@ -44,48 +44,36 @@ public U0 MergeChk(
//"+d"=Do $LK,"Diff","MN:Diff"$() on files
{
I64 df_flags=0,fuf_flags=0;
CDirEntry *tempm1=NULL,*tempm2=NULL;
GetFFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r");
GetFFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
CDirEntry *tempde1=NULL,*tempde2=NULL;
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r");
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
if (fuf_flags&~(FUG_FILES_FIND|FUF_DIFF))
throw(EXCEPT_FUF,3);
PrintFWarn("This is based strictly on file dates.\n");
tempm1=FilesFind(src_files_find_mask,fuf_flags&FUG_FILES_FIND);
tempm2=FilesFind(dst_files_find_mask,fuf_flags&FUG_FILES_FIND);
PrintWarn("This is based strictly on file dates.\n");
tempde1=FilesFind(src_files_find_mask,fuf_flags&FUG_FILES_FIND);
tempde2=FilesFind(dst_files_find_mask,fuf_flags&FUG_FILES_FIND);
fuf_flags&=FUF_DIFF;
MergeChkLst(tempm1,tempm2,&fuf_flags,&df_flags);
CDirLstDel(tempm1);
CDirLstDel(tempm2);
MergeChkLst(tempde1,tempde2,&fuf_flags,&df_flags);
DirLstDel(tempde1);
DirLstDel(tempde2);
}
#help_index "Utils;Cmd Line (Typically)"
U0 LstNewFilesLst(CDirEntry *tempm,CDate cdt)
{
while (tempm) {
if (tempm->datetime>cdt) {
"" tempm->full_name;
NewLine;
}
LstNewFilesLst(tempm->sub,cdt);
tempm=tempm->next;
}
}
public U0 LstNewFiles(U8 *files_find_mask="/TempleOS/*",CDate cdt=0,
U8 *fu_flags=NULL)
//"+T"=is just text files
{
public U0 NewFiles(U8 *files_find_mask="/TempleOS/*",CDate cdt=0,U8 *fu_flags=NULL)
{//List new files
I64 fuf_flags=0;
CDirEntry *tempm1=NULL;
if (!cdt)
cdt=sys_compile_time;
GetFFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+T");
GetFFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
if (tempm1=FilesFind(files_find_mask,fuf_flags)) {
LstNewFilesLst(tempm1,cdt);
CDirLstDel(tempm1);
CDirEntry *tempde,*tempde1;
if (!cdt) cdt=sys_compile_time;
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F");
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
while (tempde) {
if (tempde->datetime>cdt)
"%s\n",tempde->full_name;
tempde=tempde->next;
}
DirLstDel(tempde1);
}
#help_index ""
+2 -2
View File
@@ -123,7 +123,7 @@ public U0 ProfRep(I64 filter_cnt=1)
*last_buf=0;
for (i=0;i<pf_size;i++) {
ip=pf_low+i*(pf_high-pf_low)/pf_size;
SPrintF(buf,"%P",ip);
SPrint(buf,"%P",ip);
StrCpy(buf3,buf);
StrFirstRem(buf3,"+",buf2);
if (StrCmp(buf2,last_buf)) {
@@ -164,7 +164,7 @@ public U0 ProfRep(I64 filter_cnt=1)
i++;
if (i>=pf_ptr) break;
}
SPrintF(buf,"%P",ip);
SPrint(buf,"%P",ip);
StrCpy(buf3,buf);
StrFirstRem(buf3,"+",buf2);
if (StrCmp(buf2,last_buf)) {
+14 -24
View File
@@ -2,7 +2,7 @@
//$LK,"StrUtil","MN:StrUtil"$() operations on files
public U0 SUFile(U8 *name,I64 su_flags,F64 indent_scale_factor)
U0 SUFile(U8 *name,I64 suf_flags,F64 indent_scale_factor)
{//String utility on a single file
//See $LK,"SU Flags","MN:SUF_SINGLE_SPACE"$
U8 *dst;
@@ -12,7 +12,7 @@ public U0 SUFile(U8 *name,I64 su_flags,F64 indent_scale_factor)
CDocEntry *doc_e=doc->root.next;
while (doc_e!=doc) {
if (doc_e->type_u8==DOCT_TEXT) {
dst=MStrUtil(doc_e->tag,su_flags,indent_scale_factor);
dst=MStrUtil(doc_e->tag,suf_flags,indent_scale_factor);
if (StrCmp(dst,doc_e->tag)) {
reduced+=StrLen(doc_e->tag)-StrLen(dst);
chged=TRUE;
@@ -31,38 +31,28 @@ public U0 SUFile(U8 *name,I64 su_flags,F64 indent_scale_factor)
DocDel(doc);
}
U0 SULst(CDirEntry *tempm1,I64 su_flags,F64 indent_scale_factor)
{
CDirEntry *tempm2;
while (tempm1) {
tempm2=tempm1->next;
if (tempm1->attr & _ATTR_DIR) {
if (tempm1->sub) {
"%S%s\n","ST_SCANNING_DIR",tempm1->full_name;
SULst(tempm1->sub,su_flags,indent_scale_factor);
}
} else
SUFile(tempm1->full_name,su_flags,indent_scale_factor);
CDirEntryDel(tempm1);
tempm1=tempm2;
}
}
public U0 SU(U8 *files_find_mask,I64 su_flags,U8 *fu_flags=NULL,F64 indent_scale_factor=0)
public U0 SU(U8 *files_find_mask,I64 suf_flags,U8 *fu_flags=NULL,F64 indent_scale_factor=0)
{//Apply string utilities to files
//You can convert spaces to tabs, for example
//or removing trailing spaces on lines.
//See $LK,"SU Flags","MN:SUF_SINGLE_SPACE"$
//See $LK,"SUF Flags","MN:SUF_SINGLE_SPACE"$
I64 fuf_flags=0;
GetFFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
SULst(FilesFind(files_find_mask,fuf_flags),su_flags,indent_scale_factor);
CDirEntry *tempde,*tempde1;
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+f+F+T");
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
while (tempde) {
SUFile(tempde->full_name,suf_flags,indent_scale_factor);
tempde=tempde->next;
}
DirLstDel(tempde1);
}
public U0 S2T(U8 *files_find_mask,U8 *fu_flags=NULL)
{
//Spaces to tabs.
//Use "Hard Space" (SHIFT-SPACE) for spaces
//in string constants in your code.
//in string consts in your code.
SU(files_find_mask,SUF_S2T|SUF_REM_TRAILING,fu_flags);
}
+34 -34
View File
@@ -7,8 +7,8 @@ U0 HtmlPutS(CDoc *doc,I64 c,I64 *_old_c,U8 *st,I64 *_col,U8 *style_bitmap=NULL)
U8 *ch;
if (c!=*_old_c) {
if (*_old_c!=-1)
DocPutS(doc,"</span>");
DocPrintF(doc,"<span class=c%02X>",c);
DocPrint(doc,"</span>");
DocPrint(doc,"<span class=c%02X>",c);
*_old_c=c;
if (style_bitmap)
LBts(style_bitmap,c);
@@ -22,54 +22,54 @@ U0 HtmlPutS(CDoc *doc,I64 c,I64 *_old_c,U8 *st,I64 *_col,U8 *style_bitmap=NULL)
} while (*_col&7);
break;
case '&':
DocPutS(doc,"&amp;");
DocPrint(doc,"&amp;");
*_col=*_col+1;
break;
case '<':
DocPutS(doc,"&lt;");
DocPrint(doc,"&lt;");
*_col=*_col+1;
break;
case '>':
DocPutS(doc,"&gt;");
DocPrint(doc,"&gt;");
*_col=*_col+1;
break;
case '"':
DocPutS(doc,"&quot;");
DocPrint(doc,"&quot;");
*_col=*_col+1;
break;
case 'ã':
DocPutS(doc,"pi");
DocPrint(doc,"pi");
*_col=*_col+1;
break;
case 'é':
DocPutS(doc,"theta");
DocPrint(doc,"theta");
*_col=*_col+1;
break;
case 'è':
DocPutS(doc,"phi");
DocPrint(doc,"phi");
*_col=*_col+1;
break;
case 'ê':
DocPutS(doc,"omega");
DocPrint(doc,"omega");
*_col=*_col+1;
break;
case 'ì':
DocPutS(doc,"inf");
DocPrint(doc,"inf");
*_col=*_col+1;
break;
case 'æ':
DocPutS(doc,"u");
DocPrint(doc,"u");
*_col=*_col+1;
break;
case CH_SHIFT_SPACE:
DocPutS(doc," ");
DocPrint(doc," ");
*_col=*_col+1;
break;
default:
if (CH_SPACE<=ch<0x7F || ch=='\n')
DocPutKey(doc,ch,0);
else
DocPutS(doc,".");
DocPrint(doc,".");
*_col=*_col+1;
}
}
@@ -82,7 +82,7 @@ U8 *TSLinkCvt2(U8 *filename,I64 line_num)
if (filename) {
st=ChgExt(filename,"html");
if (st && StrLen(st)>12 && !StrNCmp(st+1,":/TempleOS/",11))
result=MSPrintF("http://www.templeos.org/Wb/%s#l%d",st+12,line_num);
result=MPrint("http://www.templeos.org/Wb/%s#l%d",st+12,line_num);
Free(st);
}
return result;
@@ -152,7 +152,7 @@ public CDoc *Doc2Html(CDoc *doc_in,
if (!html_header) html_header="";
if (!body_header) body_header="";
if (!body_footer) body_footer="";
DocPrintF(doc_out,
DocPrint(doc_out,
"<!DOCTYPE HTML>\n"
"<html>\n"
"<head>\n"
@@ -161,12 +161,12 @@ public CDoc *Doc2Html(CDoc *doc_in,
"<meta name=\"generator\" content=\"TempleOS V%4.2f\">\n"
"<style type=\"text/css\">\n",html_header,os_version);
style=doc_out->cur_entry->last;
DocPutS(doc_out,
DocPrint(doc_out,
"</style>\n"
"</head>\n"
"<body>\n"
"<pre style=\"font-family:courier;font-size:10pt\">\n");
DocPutS(doc_out,body_header);
DocPrint(doc_out,"%s",body_header);
doc_e=doc_in->root.next;
s=DocSettingsLast(doc_e);
@@ -176,14 +176,14 @@ public CDoc *Doc2Html(CDoc *doc_in,
while (doc_e!=doc_in) {
if (!(doc_e->flags1&(DOCEF1_SKIP|DOCEF1_HARD_SKIP))) {
if (line_anchors && y!=old_y) {
DocPrintF(doc_out,"<a name=\"l%d\"></a>",y+1);
DocPrint(doc_out,"<a name=\"l%d\"></a>",y+1);
old_y=y;
}
while (y<doc_e->y) {
HtmlPutS(doc_out,cur_u8_attr,&old_c,"\n",&col,style_bitmap);
y++;
if (line_anchors && y!=old_y) {
DocPrintF(doc_out,"<a name=\"l%d\"></a>",y+1);
DocPrint(doc_out,"<a name=\"l%d\"></a>",y+1);
old_y=y;
}
col=0;
@@ -212,10 +212,10 @@ public CDoc *Doc2Html(CDoc *doc_in,
if (link_st) {
if (old_c!=-1) {
DocPutS(doc_out,"</span>");
DocPrint(doc_out,"</span>");
old_c=-1;
}
DocPrintF(doc_out,"<a href=\"%s\">",link_st);
DocPrint(doc_out,"<a href=\"%s\">",link_st);
}
if (doc_e->settings)
@@ -239,17 +239,17 @@ public CDoc *Doc2Html(CDoc *doc_in,
break;
case DOCT_HTML_IMG:
if (old_c!=-1) {
DocPutS(doc_out,"</span>");
DocPrint(doc_out,"</span>");
old_c=-1;
}
DocPrintF(doc_out,"<img src=\"%s\" width=\"640\" height=\"480\" alt=\"\">\n",doc_e->tag);
DocPrint(doc_out,"<img src=\"%s\" width=\"640\" height=\"480\" alt=\"\">\n",doc_e->tag);
break;
case DOCT_HTML_VIDEO:
if (old_c!=-1) {
DocPutS(doc_out,"</span>");
DocPrint(doc_out,"</span>");
old_c=-1;
}
DocPrintF(doc_out,
DocPrint(doc_out,
"<!--begin exclude-->\n"
"<object classid=\"clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" "
"codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab\" "
@@ -270,10 +270,10 @@ public CDoc *Doc2Html(CDoc *doc_in,
break;
case DOCT_HTML_CODE:
if (old_c!=-1) {
DocPutS(doc_out,"</span>");
DocPrint(doc_out,"</span>");
old_c=-1;
}
DocPutS(doc_out,doc_e->tag);
DocPrint(doc_out,"%s",doc_e->tag);
break;
case DOCT_SPRITE:
HtmlPutS(doc_out,cur_u8_attr,&old_c,doc_e->tag,&col,style_bitmap);
@@ -285,10 +285,10 @@ public CDoc *Doc2Html(CDoc *doc_in,
}
if (link_st) {
if (old_c!=-1) {
DocPutS(doc_out,"</span>");
DocPrint(doc_out,"</span>");
old_c=-1;
}
DocPutS(doc_out,"</a>");
DocPrint(doc_out,"</a>");
Free(link_st);
}
}
@@ -300,16 +300,16 @@ public CDoc *Doc2Html(CDoc *doc_in,
col=0;
}
if (old_c!=-1) {
DocPutS(doc_out,"</span>");
DocPrint(doc_out,"</span>");
old_c=-1;
}
DocPutS(doc_out,body_footer);
DocPutS(doc_out,"</pre></body>\n</html>\n");
DocPrint(doc_out,"%s",body_footer);
DocPrint(doc_out,"</pre></body>\n</html>\n");
doc_out->cur_entry=style->next;
for (i=0;i<256;i++)
if (Bt(style_bitmap,i))
DocPrintF(doc_out,".c%02X{color:#%02x%02x%02x;background-color:#%02x%02x%02x;}\n",i,p[i&15].r,p[i&15].g,p[i&15].b,p[i/16].r,p[i/16].g,p[i/16].b);
DocPrint(doc_out,".c%02X{color:#%02x%02x%02x;background-color:#%02x%02x%02x;}\n",i,p[i&15].r,p[i&15].g,p[i&15].b,p[i/16].r,p[i/16].g,p[i/16].b);
doc_out->cur_entry=&doc_out->root;
DocRecalc(doc_out);
+8 -8
View File
@@ -12,38 +12,38 @@ U0 TXTPutS(CDoc *doc,U8 *st,I64 *_col)
} while (*_col&7);
break;
case 'ã':
DocPutS(doc,"pi");
DocPrint(doc,"pi");
*_col=*_col+1;
break;
case 'é':
DocPutS(doc,"theta");
DocPrint(doc,"theta");
*_col=*_col+1;
break;
case 'è':
DocPutS(doc,"phi");
DocPrint(doc,"phi");
*_col=*_col+1;
break;
case 'ê':
DocPutS(doc,"omega");
DocPrint(doc,"omega");
*_col=*_col+1;
break;
case 'ì':
DocPutS(doc,"inf");
DocPrint(doc,"inf");
*_col=*_col+1;
break;
case 'æ':
DocPutS(doc,"u");
DocPrint(doc,"u");
*_col=*_col+1;
break;
case CH_SHIFT_SPACE:
DocPutS(doc," ");
DocPrint(doc," ");
*_col=*_col+1;
break;
default:
if (CH_SPACE<=ch<0x7F || ch=='\n')
DocPutKey(doc,ch,0);
else
DocPutS(doc,".");
DocPrint(doc,".");
*_col=*_col+1;
}
}