TempleOSCDV4.12.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:47:56 +02:00
1 parent 93ca216483
commit b84bbff6db
381 files changed
+18356 -18798

No files matched your search

+17 -17
View File
@@ -219,17 +219,17 @@ Bool DiffSub(CDoc *doc,I64 *_df_flags,I64 j1_lo,I64 j1_hi,I64 j2_lo,I64 j2_hi,
Bool DiffBins(CDoc *doc1,CDoc *doc2)
{
CDocBin *tempb1=doc1->bin_head.next,
*tempb2=doc2->bin_head.next;
CDocBin *tmpb1=doc1->bin_head.next,
*tmpb2=doc2->bin_head.next;
if (tempb1->last->last->num!=tempb2->last->last->num)
if (tmpb1->last->last->num!=tmpb2->last->last->num)
return TRUE;
while (tempb1!=&doc1->bin_head) {
if (tempb1->size!=tempb2->size ||
MemCmp(tempb1->data,tempb2->data,tempb1->size))
while (tmpb1!=&doc1->bin_head) {
if (tmpb1->size!=tmpb2->size ||
MemCmp(tmpb1->data,tmpb2->data,tmpb1->size))
return TRUE;
tempb1=tempb1->next;
tempb2=tempb2->next;
tmpb1=tmpb1->next;
tmpb2=tmpb2->next;
}
return FALSE;
}
@@ -323,24 +323,24 @@ public U0 ZipRep(U8 *files_find_mask="/*",U8 *fu_flags=NULL,
//Dft is just src files. (Used to spot
//src files with redundancy in them.)
I64 i=0,cnt,size,fuf_flags=0;
CDirEntry *tempde,*tempde1,**sort_buf;
CDirEntry *tmpde,*tmpde1,**sort_buf;
U8 *buf;
CArcCompress *arc;
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+F+S");
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
cnt=FileCnt(tempde);
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
cnt=FileCnt(tmpde);
sort_buf=MAlloc(sizeof(CDirEntry *)*cnt);
while (tempde) {
sort_buf[i++]=tempde;
buf=FileRead(tempde->full_name,&size);
while (tmpde) {
sort_buf[i++]=tmpde;
buf=FileRead(tmpde->full_name,&size);
if (just_text_not_graphics)
size=StrLen(buf);
arc=CompressBuf(buf,size);
Free(buf);
tempde->user_data(F64)=100.0*arc->compressed_size/arc->expanded_size;
tmpde->user_data(F64)=100.0*arc->compressed_size/arc->expanded_size;
Free(arc);
tempde=tempde->next;
tmpde=tmpde->next;
}
QSortI64(sort_buf,cnt,&ZRepCompare);
for (i=0;i<cnt;i++) {
@@ -349,5 +349,5 @@ public U0 ZipRep(U8 *files_find_mask="/*",U8 *fu_flags=NULL,
'\n';
}
Free(sort_buf);
DirTreeDel(tempde1);
DirTreeDel(tmpde1);
}
+4 -4
View File
@@ -333,10 +333,10 @@ public U0 DocBMP(CDoc *doc=NULL,U8 *filename,Bool dither_probability=FALSE,
DCDel(dc);
}
#help_index "Graphics/Windows BMP Files;Graphics/Screen"
public I64 BMPScreenCapture(U8 *filename,I64 bits=4,Bool include_zoom=TRUE)
{//Capture screen as BMP file.
CDC *dc=DCScreenCapture(include_zoom);
#help_index "Graphics/Windows BMP Files;Graphics/Scrn"
public I64 BMPScrnCapture(U8 *filename,I64 bits=4,Bool include_zoom=TRUE)
{//Capture scrn as BMP file.
CDC *dc=DCScrnCapture(include_zoom);
I64 size=BMPWrite(filename,dc,bits);
DCDel(dc);
return size;
+6 -6
View File
@@ -161,21 +161,21 @@ before or after "dd" are label characters.
"+la"=only checks for label chars after.
*/
I64 cnt=0,fuf_flags=0;
CDirEntry *tempde,*tempde1;
CDirEntry *tmpde,*tmpde1;
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_BEFORE|FUF_WHOLE_LABELS_AFTER))
throw('FUF');
LBEqu(&fuf_flags,FUf_REPLACE,replace_text);
tempde=tempde1=FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND);
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND);
fuf_flags&=FUF_ALL|FUF_REPLACE|FUF_IGNORE|FUF_WHOLE_LABELS|
FUF_WHOLE_LABELS_BEFORE|FUF_WHOLE_LABELS_AFTER;
while (tempde && !Bt(&fuf_flags,FUf_CANCEL)) {
cnt+=FindFile(needle_str,tempde->full_name,&fuf_flags,replace_text);
tempde=tempde->next;
while (tmpde && !Bt(&fuf_flags,FUf_CANCEL)) {
cnt+=FindFile(needle_str,tmpde->full_name,&fuf_flags,replace_text);
tmpde=tmpde->next;
}
DirTreeDel(tempde1);
DirTreeDel(tmpde1);
return cnt;
}
+41 -41
View File
@@ -25,19 +25,19 @@ CHeapLogHash *heaplog_head=NULL;
U0 HeapLogMAlloc(U8 *addr)
{
CHeapLog *temphl;
CHeapLog *tmphl;
I64 i;
if (MHeapCtrl(addr)==heaplog_hc_watched) {
temphl=MAlloc(sizeof(CHeapLog),heaplog_hc);
temphl->addr=addr;
tmphl=MAlloc(sizeof(CHeapLog),heaplog_hc);
tmphl->addr=addr;
for (i=0;i<HL_CALLER_DEPTH;i++)
temphl->caller[i]=Caller(i+2);
tmphl->caller[i]=Caller(i+2);
i=addr>>3 &(HL_HASH_SIZE-1);
PUSHFD
CLI
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
PAUSE
QueIns(temphl,heaplog_head[i].last);
QueIns(tmphl,heaplog_head[i].last);
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
POPFD
}
@@ -46,7 +46,7 @@ U0 HeapLogMAlloc(U8 *addr)
U0 HeapLogFree(U8 *addr)
{
I64 i;
CHeapLog *temphl;
CHeapLog *tmphl;
if (!addr) return;
if (MHeapCtrl(addr)==heaplog_hc_watched) {
i=addr>>3 &(HL_HASH_SIZE-1);
@@ -54,16 +54,16 @@ U0 HeapLogFree(U8 *addr)
CLI
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
PAUSE
temphl=heaplog_head[i].next;
while (temphl!=&heaplog_head[i]) {
if (addr==temphl->addr) {
QueRem(temphl);
tmphl=heaplog_head[i].next;
while (tmphl!=&heaplog_head[i]) {
if (addr==tmphl->addr) {
QueRem(tmphl);
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
POPFD
Free(temphl);
Free(tmphl);
return;
}
temphl=temphl->next;
tmphl=tmphl->next;
}
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
POPFD
@@ -115,7 +115,7 @@ public Bool HeapLog(Bool val=ON,CTask *task=NULL)
public U0 HeapLogAddrRep(Bool leave_it=OFF)
{//Call $LK,"HeapLog",A="MN:HeapLog"$() first and collect data.
I64 i,j,total=0;
CHeapLog *temphl,hl;
CHeapLog *tmphl,hl;
if (!LBtr(&sys_semas[SYS_SEMA_HEAPLOG_ACTIVE],0)) {
"HeapLog Not Active\n";
return;
@@ -124,16 +124,16 @@ public U0 HeapLogAddrRep(Bool leave_it=OFF)
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
PAUSE
for (i=0;i<HL_HASH_SIZE;i++) {
temphl=heaplog_head[i].next;
while (temphl!=&heaplog_head[i]) {
tmphl=heaplog_head[i].next;
while (tmphl!=&heaplog_head[i]) {
//Take snapshot in case modified. (while we work)
MemCpy(&hl,temphl,sizeof(CHeapLog));
MemCpy(&hl,tmphl,sizeof(CHeapLog));
"$$PURPLE$$%08X$$FG$$ %08X",MSize(hl.addr),hl.addr;
for (j=0;j<HL_CALLER_DEPTH;j++)
" %P",hl.caller[j];
'\n';
total+=MSize(hl.addr);
temphl=hl.next;
tmphl=hl.next;
}
}
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
@@ -146,7 +146,7 @@ public U0 HeapLogAddrRep(Bool leave_it=OFF)
public U0 HeapLogSizeRep(Bool leave_it=OFF)
{//Call $LK,"HeapLog",A="MN:HeapLog"$() first and collect data.
I64 i,j,k,total=0;
CHeapLog *temphla,hla,*temphls,*temphls1;
CHeapLog *tmphla,hla,*tmphls,*tmphls1;
CHeapLogHash *size_head;
if (!LBtr(&sys_semas[SYS_SEMA_HEAPLOG_ACTIVE],0)) {
"HeapLog Not Active\n";
@@ -161,45 +161,45 @@ public U0 HeapLogSizeRep(Bool leave_it=OFF)
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
PAUSE
for (i=0;i<HL_HASH_SIZE;i++) {
temphla=heaplog_head[i].next;
while (temphla!=&heaplog_head[i]) {
tmphla=heaplog_head[i].next;
while (tmphla!=&heaplog_head[i]) {
//Take snapshot in case modified. (while we work)
MemCpy(&hla,temphla,sizeof(CHeapLog));
MemCpy(&hla,tmphla,sizeof(CHeapLog));
k=(MSize(hla.addr)>>3+hla.caller[0])&(HL_HASH_SIZE-1);
temphls=size_head[k].next;
while (temphls!=&size_head[k]) {
if (MSize(hla.addr)==temphls->size) {
tmphls=size_head[k].next;
while (tmphls!=&size_head[k]) {
if (MSize(hla.addr)==tmphls->size) {
for (j=0;j<HL_CALLER_DEPTH;j++)
if (hla.caller[j]!=temphls->caller[j])
if (hla.caller[j]!=tmphls->caller[j])
goto hl_next;
temphls->cnt++;
tmphls->cnt++;
goto hl_found;
}
hl_next:
temphls=temphls->next;
tmphls=tmphls->next;
}
temphls=MAlloc(sizeof(CHeapLog),heaplog_hc);
MemCpy(temphls,&hla,sizeof(CHeapLog));
temphls->cnt=1;
temphls->size=MSize(hla.addr);
QueIns(temphls,size_head[k].last);
tmphls=MAlloc(sizeof(CHeapLog),heaplog_hc);
MemCpy(tmphls,&hla,sizeof(CHeapLog));
tmphls->cnt=1;
tmphls->size=MSize(hla.addr);
QueIns(tmphls,size_head[k].last);
hl_found:
temphla=hla.next;
tmphla=hla.next;
}
}
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
for (i=0;i<HL_HASH_SIZE;i++) {
temphls=size_head[i].next;
while (temphls!=&size_head[i]) {
temphls1=temphls->next;
"%08X*%08X=%08X",temphls->size,temphls->cnt,temphls->size*temphls->cnt;
tmphls=size_head[i].next;
while (tmphls!=&size_head[i]) {
tmphls1=tmphls->next;
"%08X*%08X=%08X",tmphls->size,tmphls->cnt,tmphls->size*tmphls->cnt;
for (j=0;j<HL_CALLER_DEPTH;j++)
" %P",temphls->caller[j];
" %P",tmphls->caller[j];
'\n';
total+=temphls->size*temphls->cnt;
Free(temphls);
temphls=temphls1;
total+=tmphls->size*tmphls->cnt;
Free(tmphls);
tmphls=tmphls1;
}
}
Free(size_head);
+42 -42
View File
@@ -1,107 +1,107 @@
#help_index "Cmd Line (Typically)"
I64 LineRep1(CDirEntry *tempde)
I64 LineRep1(CDirEntry *tmpde)
{
CDoc *doc;
I64 res=0,i;
while (tempde) {
while (tmpde) {
i=0;
if (tempde->attr&RS_ATTR_DIR)
i=LineRep1(tempde->sub);
if (tmpde->attr&RS_ATTR_DIR)
i=LineRep1(tmpde->sub);
else {
doc=DocRead(tempde->full_name);
doc=DocRead(tmpde->full_name);
if (doc->head.next!=doc)
i=doc->head.last->y+2;
DocDel(doc);
}
tempde->user_data=i;
tmpde->user_data=i;
res+=i;
tempde=tempde->next;
tmpde=tmpde->next;
}
return res;
}
U0 LineRep2(CDoc *doc,CDirEntry *tempde)
U0 LineRep2(CDoc *doc,CDirEntry *tmpde)
{
while (tempde) {
if (tempde->attr&RS_ATTR_DIR) {
DocPrint(doc,"%8,d $$TR+C,\"%s\"$$\n$$ID,2$$",tempde->user_data,tempde->name);
LineRep2(doc,tempde->sub);
while (tmpde) {
if (tmpde->attr&RS_ATTR_DIR) {
DocPrint(doc,"%8,d $$TR+C,\"%s\"$$\n$$ID,2$$",tmpde->user_data,tmpde->name);
LineRep2(doc,tmpde->sub);
DocPrint(doc,"$$ID,-2$$");
} else
DocPrint(doc,"%8,d $$LK,\"%s\",A=\"FI:%s\"$$\n",
tempde->user_data,tempde->name,tempde->full_name);
tempde=tempde->next;
tmpde->user_data,tmpde->name,tmpde->full_name);
tmpde=tmpde->next;
}
}
public I64 LineRep(U8 *files_find_mask="/*",U8 *fu_flags=NULL)
{//Source line-of-code count report.
I64 fuf_flags=0,res=0;
CDoc *doc=DocNew;
CDirEntry *tempde1=NULL;
CDirEntry *tmpde1=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)) {
res=LineRep1(tempde1);
if (tmpde1=FilesFind(files_find_mask,fuf_flags)) {
res=LineRep1(tmpde1);
DocPrint(doc,"%8,d $$TR+C,\"%s\"$$\n$$ID,2$$",res,files_find_mask);
LineRep2(doc,tempde1);
LineRep2(doc,tmpde1);
DocPrint(doc,"$$ID,-2$$");
DirTreeDel(tempde1);
DirTreeDel(tmpde1);
}
DocInsDoc(DocPut,doc);
DocDel(doc);
return res;
}
I64 SizeRep1(CDirEntry *tempde,I64 *_fuf_flags)
I64 SizeRep1(CDirEntry *tmpde,I64 *_fuf_flags)
{
I64 res=0,i;
U8 buf[BLK_SIZE];
CDrv *dv;
while (tempde) {
if (tempde->attr&RS_ATTR_DIR)
i=SizeRep1(tempde->sub,_fuf_flags);
else if ((i=tempde->size) && Bt(_fuf_flags,FUf_EXPAND) &&
FileAttr(tempde->name)&RS_ATTR_COMPRESSED) {
dv=Let2Drv(*tempde->full_name);
RBlks(dv,buf,Cluster2Blk(dv,tempde->cluster),1);
while (tmpde) {
if (tmpde->attr&RS_ATTR_DIR)
i=SizeRep1(tmpde->sub,_fuf_flags);
else if ((i=tmpde->size) && Bt(_fuf_flags,FUf_EXPAND) &&
FileAttr(tmpde->name)&RS_ATTR_COMPRESSED) {
dv=Let2Drv(*tmpde->full_name);
RBlks(dv,buf,Cluster2Blk(dv,tmpde->cluster),1);
i=(&buf)(CArcCompress *)->expanded_size;
}
tempde->user_data=i;
tmpde->user_data=i;
res+=i;
tempde=tempde->next;
tmpde=tmpde->next;
}
return res;
}
U0 SizeRep2(CDoc *doc,CDirEntry *tempde)
U0 SizeRep2(CDoc *doc,CDirEntry *tmpde)
{
while (tempde) {
if (tempde->attr&RS_ATTR_DIR) {
while (tmpde) {
if (tmpde->attr&RS_ATTR_DIR) {
DocPrint(doc,"%10,d $$TR+C,\"%s\"$$\n$$ID,2$$",
tempde->user_data,tempde->name);
SizeRep2(doc,tempde->sub);
tmpde->user_data,tmpde->name);
SizeRep2(doc,tmpde->sub);
DocPrint(doc,"$$ID,-2$$");
} else {
DocPrint(doc,"%10,d ",tempde->user_data);
DocPrint(doc,"%10,d ",tmpde->user_data);
DocPrint(doc,"$$LK,\"%s\",A=\"FI:%s\"$$\n",
tempde->name,tempde->full_name);
tmpde->name,tmpde->full_name);
}
tempde=tempde->next;
tmpde=tmpde->next;
}
}
public I64 SizeRep(U8 *files_find_mask="/*",U8 *fu_flags=NULL)
{//Report file sizes. "+x" for expanded size of compressed files.
I64 fuf_flags=0,res=0;
CDoc *doc=DocNew;
CDirEntry *tempde1=NULL;
CDirEntry *tmpde1=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&FUG_FILES_FIND)) {
if (tmpde1=FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND)) {
fuf_flags&=FUF_EXPAND;
res=SizeRep1(tempde1,&fuf_flags);
res=SizeRep1(tmpde1,&fuf_flags);
DocPrint(doc,"%10,d $$TR+C,\"%s\"$$\n$$ID,2$$",res,files_find_mask);
SizeRep2(doc,tempde1);
SizeRep2(doc,tmpde1);
DocPrint(doc,"$$ID,-2$$");
DirTreeDel(tempde1);
DirTreeDel(tmpde1);
}
DocInsDoc(DocPut,doc);
DocDel(doc);
+8 -8
View File
@@ -16,7 +16,7 @@ I64 LinkChkDoc(CDoc *doc,I64 *_fuf_flags)
old_doc=DocPut;
DocLock(old_doc);
Fs->put_doc=doc;
found=DocLinkChk(st);
found=DocLinkChk(doc,st);
Fs->put_doc=old_doc;
DocUnlock(old_doc);
if (!found) {
@@ -47,14 +47,14 @@ I64 LinkChkFile(U8 *filename,I64 *_fuf_flags)
public I64 LinkChk(U8 *files_find_mask="/*",U8 *fu_flags=NULL)
{//Check documents for broken file links.
I64 fuf_flags=0,res=0;
CDirEntry *tempde,*tempde1;
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+T+f+F+O");
CDirEntry *tmpde,*tmpde1;
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+$$+f+F+O");
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)) {
res+=LinkChkFile(tempde->full_name,&fuf_flags);
tempde=tempde->next;
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
while (tmpde && !Bt(&fuf_flags,FUf_CANCEL)) {
res+=LinkChkFile(tmpde->full_name,&fuf_flags);
tmpde=tmpde->next;
}
DirTreeDel(tempde1);
DirTreeDel(tmpde1);
return res;
}
+20 -20
View File
@@ -14,46 +14,46 @@ I64 PenBrushesSize()
return res;
}
I64 ScreenZoomTablesSize()
I64 ScrnZoomTablesSize()
{
I64 res=0,i;
for (i=1;i<=GR_MAX_SCREEN_ZOOM;i++)
res+=MSize2(gr.screen_zoom_tables[i]);
for (i=1;i<=GR_MAX_SCRN_ZOOM;i++)
res+=MSize2(gr.scrn_zoom_tables[i]);
return res;
}
I64 TaskStkSize(CTask *task)
{
CTaskStk *temps=task->stk;
CTaskStk *tmps=task->stk;
I64 res=0;
while (temps) {
res+=MSize2(temps);
temps=temps->next_stk;
while (tmps) {
res+=MSize2(tmps);
tmps=tmps->next_stk;
}
return res;
}
I64 TaskQueSize(CTask *task)
{
CSrvCmd *tempc,*tempc1;
CSrvCmd *tmpc,*tmpc1;
I64 res=0;
PUSHFD
CLI
while (LBts(&task->srv_ctrl.flags,SVCRf_LOCKED))
PAUSE
tempc1=&task->srv_ctrl.next_waiting;
tempc=tempc1->next;
while (tempc!=tempc1) {
res+=MSize2(tempc)+MSize2(tempc->aux_str);
tempc=tempc->next;
tmpc1=&task->srv_ctrl.next_waiting;
tmpc=tmpc1->next;
while (tmpc!=tmpc1) {
res+=MSize2(tmpc)+MSize2(tmpc->aux_str);
tmpc=tmpc->next;
}
tempc1=&task->srv_ctrl.next_done;
tempc=tempc1->next;
while (tempc!=tempc1) {
res+=MSize2(tempc)+MSize2(tempc->aux_str);
tempc=tempc->next;
tmpc1=&task->srv_ctrl.next_done;
tmpc=tmpc1->next;
while (tmpc!=tmpc1) {
res+=MSize2(tmpc)+MSize2(tmpc->aux_str);
tmpc=tmpc->next;
}
LBtr(&task->srv_ctrl.flags,SVCRf_LOCKED);
@@ -136,7 +136,7 @@ Bool MemRepTask(CTask *task,Bool override_validate=FALSE)
if (task==sys_winmgr_task) {
"gr.pen_brushes\t:%010X\n",PenBrushesSize;
"gr_screen_zoom_tbles:%010X\n",ScreenZoomTablesSize;
"gr_scrn_zoom_tbles:%010X\n",ScrnZoomTablesSize;
} else if (task==adam_task) {
j=0;k=0;m=0;n=0;
for (i=0;i<mp_cnt;i++) {
@@ -182,7 +182,7 @@ Bool MemRepTask(CTask *task,Bool override_validate=FALSE)
"gr.dc1\t\t:%010X\n",DCSize(gr.dc1);
"gr.dc2\t\t:%010X\n",DCSize(gr.dc2);
"gr.dc_cache\t\t:%010X\n",DCSize(gr.dc_cache);
"gr.screen_image\t:%010X\n",DCSize(gr.screen_image);
"gr.scrn_image\t:%010X\n",DCSize(gr.scrn_image);
"gr.zoomed_dc\t:%010X\n",DCSize(gr.zoomed_dc);
}
"$$ID,-2$$";
+26 -26
View File
@@ -10,28 +10,28 @@ CDirEntry MGFind(CDirEntry *needle_entry,CDirEntry *haystack_lst)
return NULL;
}
U0 Merge2(CDirEntry *tempde1,CDirEntry *tempde2,I64 *_fuf_flags,I64 *_df_flags)
U0 Merge2(CDirEntry *tmpde1,CDirEntry *tmpde2,I64 *_fuf_flags,I64 *_df_flags)
{
CDirEntry *tempde;
while (tempde1 && !(*_df_flags & DF_ABORT_ALL_FILES)) {
tempde=MGFind(tempde1,tempde2);
if (!tempde)
"$$BROWN$$Does Not Exist:%s$$FG$$\n",tempde1->full_name;
CDirEntry *tmpde;
while (tmpde1 && !(*_df_flags & DF_ABORT_ALL_FILES)) {
tmpde=MGFind(tmpde1,tmpde2);
if (!tmpde)
"$$BROWN$$Does Not Exist:%s$$FG$$\n",tmpde1->full_name;
else {
if (tempde1->attr & RS_ATTR_DIR)
Merge2(tempde1->sub,tempde->sub,_fuf_flags,_df_flags);
if (tmpde1->attr & RS_ATTR_DIR)
Merge2(tmpde1->sub,tmpde->sub,_fuf_flags,_df_flags);
else {
if (AbsI64(tempde1->datetime-tempde->datetime)>CDATE_FREQ*2) {//slop
"%s",tempde1->full_name;
if (AbsI64(tmpde1->datetime-tmpde->datetime)>CDATE_FREQ*2) {//slop
"%s",tmpde1->full_name;
'\n';
if (Bt(_fuf_flags,FUf_DIFF)) {
if (FilesFindMatch(tempde1->full_name,FILEMASK_TXT))
Diff(tempde->full_name,tempde1->full_name,_df_flags);
if (FilesFindMatch(tmpde1->full_name,FILEMASK_TXT))
Diff(tmpde->full_name,tmpde1->full_name,_df_flags);
}
}
}
}
tempde1=tempde1->next;
tmpde1=tmpde1->next;
}
}
public U0 Merge(U8 *dst_files_find_mask="/*",U8 *src_files_find_mask="/*",
@@ -44,18 +44,18 @@ merge changes from source files into
destination files.
*/
I64 df_flags=0,fuf_flags=0;
CDirEntry *tempde1=NULL,*tempde2=NULL;
CDirEntry *tmpde1=NULL,*tmpde2=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('FUF');
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);
tmpde1=FilesFind(src_files_find_mask,fuf_flags&FUG_FILES_FIND);
tmpde2=FilesFind(dst_files_find_mask,fuf_flags&FUG_FILES_FIND);
fuf_flags&=FUF_DIFF;
Merge2(tempde1,tempde2,&fuf_flags,&df_flags);
DirTreeDel(tempde1);
DirTreeDel(tempde2);
Merge2(tmpde1,tmpde2,&fuf_flags,&df_flags);
DirTreeDel(tmpde1);
DirTreeDel(tmpde2);
}
#help_index "Utils;Cmd Line (Typically)"
@@ -63,15 +63,15 @@ destination files.
public U0 NewFiles(U8 *files_find_mask="/*",CDate cdt=0,U8 *fu_flags=NULL)
{//Report files newer than a certain date.
I64 fuf_flags=0;
CDirEntry *tempde,*tempde1;
CDirEntry *tmpde,*tmpde1;
if (!cdt) cdt=sys_compile_time;
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+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;
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
while (tmpde) {
if (tmpde->datetime>cdt)
"%s\n",tmpde->full_name;
tmpde=tmpde->next;
}
DirTreeDel(tempde1);
DirTreeDel(tmpde1);
}
+1 -1
View File
@@ -27,7 +27,7 @@ U0 ProfTimerInt(CTask *task)
public U0 Prof(I64 depth=0,I64 cpu_num=0)
{/*Start collecting profiler statistics.
Profilers report where time is spent
by sampling RIP during the $TX,"1000 Hz",D="DD_JIFFY_HZ"$
by sampling RIP during the $TX,"1000Hz",D="DD_JIFFY_HZ"$
timer interrupt.
Do a $LK,"ProfRep",A="MN:ProfRep"$(), (profiler report)
+18 -18
View File
@@ -105,15 +105,15 @@ public I64 Words(U8 *files_find_mask="*",U32 *chars_bmp=chars_bmp_alpha,
{//Break file into list of not-unique words.
I64 fuf_flags=0,res=0;
CDoc *doc_out=DocNew;
CDirEntry *tempde,*tempde1;
CDirEntry *tmpde,*tmpde1;
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+T");
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
while (tempde) {
res+=DocWordsFile(doc_out,tempde->full_name,chars_bmp);
tempde=tempde->next;
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
while (tmpde) {
res+=DocWordsFile(doc_out,tmpde->full_name,chars_bmp);
tmpde=tmpde->next;
}
DirTreeDel(tempde1);
DirTreeDel(tmpde1);
DocInsDoc(NULL,doc_out);
DocDel(doc_out);
return res;
@@ -140,16 +140,16 @@ I64 LongLinesFile(U8 *filename,I64 cols)
public I64 LongLines(U8 *files_find_mask="*",I64 cols=80,U8 *fu_flags=NULL)
{//Report files with lines of too many cols.
I64 res=0,fuf_flags=0;
CDirEntry *tempde,*tempde1;
CDirEntry *tmpde,*tmpde1;
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+S");
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
while (tempde) {
if (LongLinesFile(tempde->full_name,cols))
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
while (tmpde) {
if (LongLinesFile(tmpde->full_name,cols))
res++;
tempde=tempde->next;
tmpde=tmpde->next;
}
DirTreeDel(tempde1);
DirTreeDel(tmpde1);
return res;
}
@@ -187,15 +187,15 @@ public U0 SU(U8 *files_find_mask,I64 suf_flags,U8 *fu_flags=NULL,
//or removing trailing spaces on lines.
//See $LK,"SUF Flags",A="MN:SUF_SINGLE_SPACE"$.
I64 fuf_flags=0;
CDirEntry *tempde,*tempde1;
CDirEntry *tmpde,*tmpde1;
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;
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
while (tmpde) {
SUFile(tmpde->full_name,suf_flags,indent_scale_factor);
tmpde=tmpde->next;
}
DirTreeDel(tempde1);
DirTreeDel(tmpde1);
}
public U0 S2T(U8 *files_find_mask,U8 *fu_flags=NULL)
+7 -7
View File
@@ -4,16 +4,16 @@ public U0 ToDolDoc(U8 *files_find_mask,U8 *fu_flags=NULL)
{//Convert text file to $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ by making double $$'s.
CDoc *doc;
I64 fuf_flags=0;
CDirEntry *tempde,*tempde1;
CDirEntry *tmpde,*tmpde1;
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) {
"%s\n",tempde->full_name;
doc=DocRead(tempde->full_name,DOCF_PLAIN_TEXT|DOCF_DBL_DOLLARS);
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
while (tmpde) {
"%s\n",tmpde->full_name;
doc=DocRead(tmpde->full_name,DOCF_PLAIN_TEXT|DOCF_DBL_DOLLARS);
DocWrite(doc);
DocDel(doc);
tempde=tempde->next;
tmpde=tmpde->next;
}
DirTreeDel(tempde1);
DirTreeDel(tmpde1);
}