TempleOSCDV4.06.ISO
This commit is contained in:
1 parent
6fe38d2d9d
commit
b632ab9a4f
261 files changed
+6282
-5801
No files matched your search
@@ -146,7 +146,7 @@ Bool DiffSub(CDoc *doc,I64 *_df_flags,I64 j1_lo,I64 j1_hi,I64 j2_lo,I64 j2_hi,
|
||||
{
|
||||
I64 i,i1=0,i2=0,i2b,j1,j2,n,
|
||||
best_j1,best_j2,best_score=0,score;
|
||||
Bool result=FALSE;
|
||||
Bool res=FALSE;
|
||||
|
||||
if (j1_lo>=j1_hi || j2_lo>=j2_hi) {
|
||||
if (j1_lo<j1_hi || j2_lo<j2_hi) {
|
||||
@@ -208,12 +208,12 @@ Bool DiffSub(CDoc *doc,I64 *_df_flags,I64 j1_lo,I64 j1_hi,I64 j2_lo,I64 j2_hi,
|
||||
} else {
|
||||
if (DiffSub(doc,_df_flags,j1_lo,best_j1,j2_lo,best_j2,cnt1,cnt2,
|
||||
doc_sorted1,doc_sorted2,doc_unsorted1,doc_unsorted2))
|
||||
result=TRUE;
|
||||
res=TRUE;
|
||||
if (DiffSub(doc,_df_flags,best_j1+best_score,j1_hi,best_j2+best_score,
|
||||
j2_hi,cnt1,cnt2,
|
||||
doc_sorted1,doc_sorted2,doc_unsorted1,doc_unsorted2))
|
||||
result=TRUE;
|
||||
return result;
|
||||
res=TRUE;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ public Bool Diff(U8 *dst_file,U8 *src_file,I64 *_df_flags=NULL)
|
||||
*doc2=DocRead(src_file,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
|
||||
CDocEntry *doc_e,**doc_sorted1,**doc_sorted2,**doc_unsorted1,**doc_unsorted2;
|
||||
I64 i,cnt1=0,cnt2=0,df_flags;
|
||||
Bool result=FALSE;
|
||||
Bool res=FALSE;
|
||||
|
||||
if (_df_flags)
|
||||
df_flags=*_df_flags;
|
||||
@@ -291,14 +291,14 @@ public Bool Diff(U8 *dst_file,U8 *src_file,I64 *_df_flags=NULL)
|
||||
doc_unsorted2[i]=doc2;
|
||||
QSortI64(doc_sorted2,cnt2,&DiffEntriesCompare);
|
||||
|
||||
result=DiffSub(doc1,&df_flags,0,cnt1,0,cnt2,cnt1,cnt2,
|
||||
res=DiffSub(doc1,&df_flags,0,cnt1,0,cnt2,cnt1,cnt2,
|
||||
doc_sorted1,doc_sorted2,doc_unsorted1,doc_unsorted2);
|
||||
if (df_flags&DF_MODIFIED && !(df_flags&DF_DONT_MODIFIED))
|
||||
DocWrite(doc1);
|
||||
|
||||
if (DiffBins(doc1,doc2)) {
|
||||
"$$RED$$Bin Data is Different$$FG$$\n";
|
||||
result=TRUE;
|
||||
res=TRUE;
|
||||
}
|
||||
|
||||
DocDel(doc1);
|
||||
@@ -309,7 +309,7 @@ public Bool Diff(U8 *dst_file,U8 *src_file,I64 *_df_flags=NULL)
|
||||
Free(doc_unsorted2);
|
||||
if (_df_flags)
|
||||
*_df_flags=df_flags;
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
#help_index "Cmd Line (Typically);Info"
|
||||
|
||||
+39
-39
@@ -185,7 +185,7 @@ U8 *BMPPaletteNew(CFileBMP *bmp)
|
||||
{
|
||||
I64 i,j,best,score,best_score;
|
||||
CBGR48 palette[NUM_COLORS];
|
||||
U8 *result=CAlloc(NUM_BMP_COLORS*sizeof(U8));
|
||||
U8 *res=CAlloc(NUM_BMP_COLORS*sizeof(U8));
|
||||
GrPaletteGet(palette);
|
||||
#assert NUM_COLORS==NUM_BMP_COLORS
|
||||
for (i=0;i<NUM_BMP_COLORS;i++) {
|
||||
@@ -200,39 +200,39 @@ U8 *BMPPaletteNew(CFileBMP *bmp)
|
||||
best_score=score;
|
||||
}
|
||||
}
|
||||
result[i]=best;
|
||||
res[i]=best;
|
||||
}
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
U8 ms_paint_palette[NUM_BMP_COLORS]={0,4,2,6,1,5,3,8,7,12,10,14,9,13,11,15};
|
||||
|
||||
I64 BMP24Color(CBGR24 *ptr,Bool dither_probability)
|
||||
{
|
||||
I64 result,k;
|
||||
I64 res,k;
|
||||
if (dither_probability) {
|
||||
k=RandU32;
|
||||
if (SqrI64(ptr->r)+SqrI64(ptr->g)+SqrI64(ptr->b)>=3*SqrI64(k.u8[0]))
|
||||
result=8;
|
||||
res=8;
|
||||
else
|
||||
result=0;
|
||||
if (ptr->r>=k.u8[1]) result|=RED;
|
||||
if (ptr->g>=k.u8[2]) result|=GREEN;
|
||||
if (ptr->b>=k.u8[3]) result|=BLUE;
|
||||
res=0;
|
||||
if (ptr->r>=k.u8[1]) res|=RED;
|
||||
if (ptr->g>=k.u8[2]) res|=GREEN;
|
||||
if (ptr->b>=k.u8[3]) res|=BLUE;
|
||||
} else {
|
||||
if (SqrI64(ptr->r)+SqrI64(ptr->g)+SqrI64(ptr->b)>=SqrI64(0x80)) {
|
||||
result=8;
|
||||
if (ptr->r>=0x80) result|=RED;
|
||||
if (ptr->g>=0x80) result|=GREEN;
|
||||
if (ptr->b>=0x80) result|=BLUE;
|
||||
res=8;
|
||||
if (ptr->r>=0x80) res|=RED;
|
||||
if (ptr->g>=0x80) res|=GREEN;
|
||||
if (ptr->b>=0x80) res|=BLUE;
|
||||
} else {
|
||||
result=0;
|
||||
if (ptr->r>=0x40) result|=RED;
|
||||
if (ptr->g>=0x40) result|=GREEN;
|
||||
if (ptr->b>=0x40) result|=BLUE;
|
||||
res=0;
|
||||
if (ptr->r>=0x40) res|=RED;
|
||||
if (ptr->g>=0x40) res|=GREEN;
|
||||
if (ptr->b>=0x40) res|=BLUE;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
public CDC *BMPRead(U8 *filename,Bool dither_probability=FALSE,
|
||||
@@ -242,11 +242,11 @@ public CDC *BMPRead(U8 *filename,Bool dither_probability=FALSE,
|
||||
U8 *palette_map,*ptr;
|
||||
Bool rle;
|
||||
CFileBMP *bmp;
|
||||
CDC *result=NULL;
|
||||
CDC *res=NULL;
|
||||
if (ptr=FileRead(filename)) {
|
||||
bmp=ptr;
|
||||
if (0<bmp->width<MAX_I32 && 0<bmp->height<MAX_I32) {
|
||||
result=DCNew(bmp->width,bmp->height);
|
||||
res=DCNew(bmp->width,bmp->height);
|
||||
ptr+=bmp->data_offset;
|
||||
if (bmp->compression==2)
|
||||
rle=TRUE;
|
||||
@@ -262,30 +262,30 @@ public CDC *BMPRead(U8 *filename,Bool dither_probability=FALSE,
|
||||
j=0;
|
||||
while (cnt=*ptr++) {
|
||||
if (cnt==1) {
|
||||
result->color=palette_map[*ptr++&15];
|
||||
GrPlot(result,j++,i);
|
||||
res->color=palette_map[*ptr++&15];
|
||||
GrPlot(res,j++,i);
|
||||
} else {
|
||||
if (cnt==2 && *ptr>>4!=*ptr&15) {
|
||||
result->color=palette_map[*ptr&15];
|
||||
GrPlot(result,j+1,i);
|
||||
result->color=palette_map[*ptr>>4];
|
||||
GrPlot(result,j,i);
|
||||
res->color=palette_map[*ptr&15];
|
||||
GrPlot(res,j+1,i);
|
||||
res->color=palette_map[*ptr>>4];
|
||||
GrPlot(res,j,i);
|
||||
ptr++;
|
||||
j+=2;
|
||||
} else {
|
||||
result->color=palette_map[*ptr++&15];
|
||||
res->color=palette_map[*ptr++&15];
|
||||
while (cnt--)
|
||||
GrPlot(result,j++,i);
|
||||
GrPlot(res,j++,i);
|
||||
}
|
||||
}
|
||||
}
|
||||
ptr++;
|
||||
} else
|
||||
for (j=0;j<(bmp->width+7)&~7;) {
|
||||
result->color=palette_map[*ptr&15];
|
||||
GrPlot(result,j+1,i);
|
||||
result->color=palette_map[*ptr>>4];
|
||||
GrPlot(result,j,i);
|
||||
res->color=palette_map[*ptr&15];
|
||||
GrPlot(res,j+1,i);
|
||||
res->color=palette_map[*ptr>>4];
|
||||
GrPlot(res,j,i);
|
||||
ptr++;
|
||||
j+=2;
|
||||
}
|
||||
@@ -294,8 +294,8 @@ public CDC *BMPRead(U8 *filename,Bool dither_probability=FALSE,
|
||||
} else if (bmp->bit_cnt==24) {
|
||||
for (i=bmp->height-1;i>=0;i--) {
|
||||
for (j=0;j<bmp->width;j++,ptr+=3) {
|
||||
result->color=BMP24Color(ptr,dither_probability);
|
||||
GrPlot(result,j,i);
|
||||
res->color=BMP24Color(ptr,dither_probability);
|
||||
GrPlot(res,j,i);
|
||||
}
|
||||
ptr+=bmp->width&3;
|
||||
}
|
||||
@@ -304,21 +304,21 @@ public CDC *BMPRead(U8 *filename,Bool dither_probability=FALSE,
|
||||
} else if (bmp->bit_cnt>=32) {
|
||||
for (i=bmp->height-1;i>=0;i--)
|
||||
for (j=0;j<bmp->width;j++,ptr+=4) {
|
||||
result->color=BMP24Color(ptr,dither_probability);
|
||||
GrPlot(result,j,i);
|
||||
res->color=BMP24Color(ptr,dither_probability);
|
||||
GrPlot(res,j,i);
|
||||
}
|
||||
if (!use_ms_paint_palette)
|
||||
Free(palette_map);
|
||||
} else {
|
||||
"Format Not Supported.\n";
|
||||
DCDel(result);
|
||||
result=NULL;
|
||||
DCDel(res);
|
||||
res=NULL;
|
||||
}
|
||||
} else
|
||||
"Invalid BMP File\n";
|
||||
Free(bmp);
|
||||
}
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
#help_index "Graphics/Sprite;Graphics/Windows BMP Files;"\
|
||||
|
||||
@@ -213,7 +213,7 @@ I64 FindWiz()
|
||||
CDoc *doc;
|
||||
U8 buf[32],*dir,*st;
|
||||
CFind *g=CAlloc(sizeof(CFind));
|
||||
I64 result=0;
|
||||
I64 res=0;
|
||||
g->recurse=TRUE;
|
||||
StrCpy(g->filemask,FILEMASK_TXT);
|
||||
if (doc=DocPut) {
|
||||
@@ -248,10 +248,10 @@ I64 FindWiz()
|
||||
st=MStrPrint("\"$$$$WW+H,1$$$$\";Cd(\"%s\");"
|
||||
"Find(\"%Q\",\"%Q\",\"%Q\");UserTaskCont;",
|
||||
dir,g->find_text,g->filemask,buf);
|
||||
result=PopUp(st);
|
||||
res=PopUp(st);
|
||||
}
|
||||
Free(dir);
|
||||
}
|
||||
Free(g);
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
#help_index "Debugging/Heap"
|
||||
#help_index "Debugging/Heap;Memory/Debugging"
|
||||
#help_file "::/Doc/HeapDbg"
|
||||
|
||||
#define HL_CALLER_DEPTH 5 //Feel free to change this.
|
||||
|
||||
+14
-14
@@ -3,7 +3,7 @@
|
||||
I64 LineRep1(CDirEntry *tempde)
|
||||
{
|
||||
CDoc *doc;
|
||||
I64 result=0,i;
|
||||
I64 res=0,i;
|
||||
while (tempde) {
|
||||
i=0;
|
||||
if (tempde->attr&RS_ATTR_DIR)
|
||||
@@ -15,10 +15,10 @@ I64 LineRep1(CDirEntry *tempde)
|
||||
DocDel(doc);
|
||||
}
|
||||
tempde->user_data=i;
|
||||
result+=i;
|
||||
res+=i;
|
||||
tempde=tempde->next;
|
||||
}
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
U0 LineRep2(CDoc *doc,CDirEntry *tempde)
|
||||
{
|
||||
@@ -35,26 +35,26 @@ U0 LineRep2(CDoc *doc,CDirEntry *tempde)
|
||||
}
|
||||
public I64 LineRep(U8 *files_find_mask="/*",U8 *fu_flags=NULL)
|
||||
{//Source line-of-code count report.
|
||||
I64 fuf_flags=0,result=0;
|
||||
I64 fuf_flags=0,res=0;
|
||||
CDoc *doc=DocNew;
|
||||
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=LineRep1(tempde1);
|
||||
DocPrint(doc,"%8,d $$TR+C,\"%s\"$$\n$$ID,2$$",result,files_find_mask);
|
||||
res=LineRep1(tempde1);
|
||||
DocPrint(doc,"%8,d $$TR+C,\"%s\"$$\n$$ID,2$$",res,files_find_mask);
|
||||
LineRep2(doc,tempde1);
|
||||
DocPrint(doc,"$$ID,-2$$");
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
DocInsDoc(DocPut,doc);
|
||||
DocDel(doc);
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 SizeRep1(CDirEntry *tempde,I64 *_fuf_flags)
|
||||
{
|
||||
I64 result=0,i;
|
||||
I64 res=0,i;
|
||||
U8 buf[BLK_SIZE];
|
||||
CDrv *dv;
|
||||
while (tempde) {
|
||||
@@ -67,10 +67,10 @@ I64 SizeRep1(CDirEntry *tempde,I64 *_fuf_flags)
|
||||
i=(&buf)(CArcCompress *)->expanded_size;
|
||||
}
|
||||
tempde->user_data=i;
|
||||
result+=i;
|
||||
res+=i;
|
||||
tempde=tempde->next;
|
||||
}
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
U0 SizeRep2(CDoc *doc,CDirEntry *tempde)
|
||||
{
|
||||
@@ -90,20 +90,20 @@ U0 SizeRep2(CDoc *doc,CDirEntry *tempde)
|
||||
}
|
||||
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,result=0;
|
||||
I64 fuf_flags=0,res=0;
|
||||
CDoc *doc=DocNew;
|
||||
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&FUG_FILES_FIND)) {
|
||||
fuf_flags&=FUF_EXPAND;
|
||||
result=SizeRep1(tempde1,&fuf_flags);
|
||||
DocPrint(doc,"%10,d $$TR+C,\"%s\"$$\n$$ID,2$$",result,files_find_mask);
|
||||
res=SizeRep1(tempde1,&fuf_flags);
|
||||
DocPrint(doc,"%10,d $$TR+C,\"%s\"$$\n$$ID,2$$",res,files_find_mask);
|
||||
SizeRep2(doc,tempde1);
|
||||
DocPrint(doc,"$$ID,-2$$");
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
DocInsDoc(DocPut,doc);
|
||||
DocDel(doc);
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
@@ -6,7 +6,7 @@ I64 LinkChkDoc(CDoc *doc,I64 *_fuf_flags)
|
||||
Bool found,unlock=DocLock(doc);
|
||||
CDoc *old_doc;
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
I64 result=0;
|
||||
I64 res=0;
|
||||
while (doc_e!=doc) {
|
||||
if (ScanKey) {
|
||||
LBts(_fuf_flags,FUf_CANCEL);
|
||||
@@ -22,38 +22,38 @@ I64 LinkChkDoc(CDoc *doc,I64 *_fuf_flags)
|
||||
if (!found) {
|
||||
PutFileLink(doc->filename.name,doc_e->y);
|
||||
"$$RED$$ %04d:%s\n$$FG$$",doc_e->y,st;
|
||||
result++;
|
||||
res++;
|
||||
}
|
||||
Free(st);
|
||||
} else if (doc_e->type_u8==DOCT_ERROR) {
|
||||
PutFileLink(doc->filename.name,doc_e->y);
|
||||
"$$RED$$ Doc Error\n$$FG$$";
|
||||
result++;
|
||||
res++;
|
||||
}
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
if (unlock) DocUnlock(doc);
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 LinkChkFile(U8 *filename,I64 *_fuf_flags)
|
||||
{
|
||||
CDoc *doc=DocRead(filename,DOCF_NO_CURSOR);
|
||||
I64 result=LinkChkDoc(doc,_fuf_flags);
|
||||
I64 res=LinkChkDoc(doc,_fuf_flags);
|
||||
DocDel(doc);
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
public I64 LinkChk(U8 *files_find_mask="/*",U8 *fu_flags=NULL)
|
||||
{//Check documents for broken file links.
|
||||
I64 fuf_flags=0,result=0;
|
||||
I64 fuf_flags=0,res=0;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+T+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)) {
|
||||
result+=LinkChkFile(tempde->full_name,&fuf_flags);
|
||||
res+=LinkChkFile(tempde->full_name,&fuf_flags);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
+19
-19
@@ -7,36 +7,36 @@ I64 TSSSize(CTSS *tss)
|
||||
|
||||
I64 PenBrushesSize()
|
||||
{
|
||||
I64 result=0,i;
|
||||
I64 res=0,i;
|
||||
for (i=0;i<GR_NUM_PEN_BRUSHES;i++)
|
||||
result+=DCSize(gr.pen_brushes[i])+DCSize(gr.collision_pen_brushes[i])+
|
||||
res+=DCSize(gr.pen_brushes[i])+DCSize(gr.collision_pen_brushes[i])+
|
||||
DCSize(gr.even_pen_brushes[i])+DCSize(gr.odd_pen_brushes[i]);
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 ScreenZoomTablesSize()
|
||||
{
|
||||
I64 result=0,i;
|
||||
I64 res=0,i;
|
||||
for (i=1;i<=GR_MAX_SCREEN_ZOOM;i++)
|
||||
result+=MSize2(gr.screen_zoom_tables[i]);
|
||||
return result;
|
||||
res+=MSize2(gr.screen_zoom_tables[i]);
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 TaskStkSize(CTask *task)
|
||||
{
|
||||
CTaskStk *temps=task->stk;
|
||||
I64 result=0;
|
||||
I64 res=0;
|
||||
while (temps) {
|
||||
result+=MSize2(temps);
|
||||
res+=MSize2(temps);
|
||||
temps=temps->next_stk;
|
||||
}
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 TaskQueSize(CTask *task)
|
||||
{
|
||||
CSrvCmd *tempc,*tempc1;
|
||||
I64 result=0;
|
||||
I64 res=0;
|
||||
PUSHFD
|
||||
CLI
|
||||
while (LBts(&task->srv_ctrl.flags,SVCRf_LOCKED))
|
||||
@@ -45,25 +45,25 @@ I64 TaskQueSize(CTask *task)
|
||||
tempc1=&task->srv_ctrl.next_waiting;
|
||||
tempc=tempc1->next;
|
||||
while (tempc!=tempc1) {
|
||||
result+=MSize2(tempc)+MSize2(tempc->aux_str);
|
||||
res+=MSize2(tempc)+MSize2(tempc->aux_str);
|
||||
tempc=tempc->next;
|
||||
}
|
||||
|
||||
tempc1=&task->srv_ctrl.next_done;
|
||||
tempc=tempc1->next;
|
||||
while (tempc!=tempc1) {
|
||||
result+=MSize2(tempc)+MSize2(tempc->aux_str);
|
||||
res+=MSize2(tempc)+MSize2(tempc->aux_str);
|
||||
tempc=tempc->next;
|
||||
}
|
||||
|
||||
LBtr(&task->srv_ctrl.flags,SVCRf_LOCKED);
|
||||
POPFD
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 BlkDevsSize()
|
||||
{
|
||||
I64 i,result=MSize2(blkdev.blkdevs);
|
||||
I64 i,res=MSize2(blkdev.blkdevs);
|
||||
CBlkDev *bd;
|
||||
for (i=0;i<NUM_BLKDEVS;i++) {
|
||||
bd=&blkdev.blkdevs[i];
|
||||
@@ -72,18 +72,18 @@ I64 BlkDevsSize()
|
||||
"RAMDsk %C\t:%010X Unused:%010X\n",
|
||||
bd->first_drv_let,(bd->max_blk+1)<<BLK_SIZE_BITS,
|
||||
UnusedDrvSpace(bd->first_drv_let);
|
||||
result+=MSize2(bd->dev_id_record);
|
||||
res+=MSize2(bd->dev_id_record);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 DrvsSize()
|
||||
{
|
||||
I64 i,result=MSize2(blkdev.drvs);
|
||||
I64 i,res=MSize2(blkdev.drvs);
|
||||
for (i=0;i<NUM_DRVS;i++)
|
||||
result+=MSize2(blkdev.drvs[i].cur_fat_blk)+MSize2(blkdev.drvs[i].fis);
|
||||
return result;
|
||||
res+=MSize2(blkdev.drvs[i].cur_fat_blk)+MSize2(blkdev.drvs[i].fis);
|
||||
return res;
|
||||
}
|
||||
|
||||
Bool MemRepTask(CTask *task,Bool override_validate=FALSE)
|
||||
|
||||
+18
-18
@@ -11,7 +11,7 @@ public I64 Sort(U8 *_in_name,U8 *_out_name=NULL,
|
||||
U8 *in_name,*out_name,*st;
|
||||
CDoc *doc;
|
||||
CDocEntry *doc_e,*doc_e1,**a;
|
||||
I64 i,j,cnt=0,result;
|
||||
I64 i,j,cnt=0,res;
|
||||
|
||||
if (!_in_name) return 0;
|
||||
in_name=DftExt(_in_name,"TXT.Z");
|
||||
@@ -41,7 +41,7 @@ public I64 Sort(U8 *_in_name,U8 *_out_name=NULL,
|
||||
}
|
||||
QSort(a,cnt/entry_lines,entry_lines*sizeof(CDocEntry *),&DEPtrCompare);
|
||||
|
||||
result=0;
|
||||
res=0;
|
||||
st=NULL;
|
||||
for (i=0;i<cnt;) {
|
||||
if (!unique || !st || StrCmp(a[i]->tag,st)) {
|
||||
@@ -52,7 +52,7 @@ public I64 Sort(U8 *_in_name,U8 *_out_name=NULL,
|
||||
doc->cur_col=0;
|
||||
DocPrint(doc,"\n");
|
||||
}
|
||||
result++;
|
||||
res++;
|
||||
} else
|
||||
for (j=0;j<entry_lines && i<cnt;j++,i++) {
|
||||
QueIns(a[i],doc->root.last);
|
||||
@@ -66,13 +66,13 @@ public I64 Sort(U8 *_in_name,U8 *_out_name=NULL,
|
||||
DocDel(doc);
|
||||
Free(in_name);
|
||||
Free(out_name);
|
||||
return result; //Num Entries
|
||||
return res; //Num Entries
|
||||
}
|
||||
|
||||
I64 DocWordsFile(CDoc *doc_out=NULL,U8 *filename,U32 *chars_bmp)
|
||||
{
|
||||
U8 *ptr,*ptr2;
|
||||
I64 result=0,ch;
|
||||
I64 res=0,ch;
|
||||
CDoc *doc_in=DocRead(filename);
|
||||
CDocEntry *doc_e=doc_in->root.next;
|
||||
while (doc_e!=doc_in) {
|
||||
@@ -90,7 +90,7 @@ I64 DocWordsFile(CDoc *doc_out=NULL,U8 *filename,U32 *chars_bmp)
|
||||
*ptr=0;
|
||||
if (*ptr2) {
|
||||
DocPrint(doc_out,"%s\n",ptr2);
|
||||
result++;
|
||||
res++;
|
||||
}
|
||||
*ptr=ch;
|
||||
}
|
||||
@@ -98,59 +98,59 @@ I64 DocWordsFile(CDoc *doc_out=NULL,U8 *filename,U32 *chars_bmp)
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
DocDel(doc_in);
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
public I64 Words(U8 *files_find_mask="*",U32 *chars_bmp=chars_bmp_alpha,
|
||||
U8 *fu_flags=NULL)
|
||||
{//Break file into list of not-unique words.
|
||||
I64 fuf_flags=0,result=0;
|
||||
I64 fuf_flags=0,res=0;
|
||||
CDoc *doc_out=DocNew;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
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) {
|
||||
result+=DocWordsFile(doc_out,tempde->full_name,chars_bmp);
|
||||
res+=DocWordsFile(doc_out,tempde->full_name,chars_bmp);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
DocInsDoc(NULL,doc_out);
|
||||
DocDel(doc_out);
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 LongLinesFile(U8 *filename,I64 cols)
|
||||
{
|
||||
I64 result=0;
|
||||
I64 res=0;
|
||||
CDoc *doc=DocRead(filename);
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_NEW_LINE && doc_e->x>=cols+1)
|
||||
result++;
|
||||
res++;
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
DocDel(doc);
|
||||
if (result) {
|
||||
"%04d ",result;
|
||||
if (res) {
|
||||
"%04d ",res;
|
||||
PutFileLink(filename);
|
||||
'\n';
|
||||
}
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
public I64 LongLines(U8 *files_find_mask="*",I64 cols=80,U8 *fu_flags=NULL)
|
||||
{//Report files with lines of too many cols.
|
||||
I64 result=0,fuf_flags=0;
|
||||
I64 res=0,fuf_flags=0;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
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))
|
||||
result++;
|
||||
res++;
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
return result;
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 SUFile(U8 *filename,I64 suf_flags,F64 indent_scale_factor)
|
||||
|
||||
Reference in new issue
Block a user