TempleOSTS_140317.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:46:02 +02:00
1 parent 2d2a65d572
commit 7ef616a20e
1416 files changed
+223873 -53917

No files matched your search

+61
View File
@@ -0,0 +1,61 @@
#help_index "Debugging;Utils;Cmd Line (Typically)"
I64 LinkChkDoc(CDoc *doc,I64 *_fuf_flags)
{
U8 *st;
Bool found,unlock=DocLock(doc);
CDoc *old_doc;
CDocEntry *doc_e=doc->root.next;
I64 result=0;
while (doc_e!=doc) {
if (ScanKey) {
LBts(_fuf_flags,FUf_CANCEL);
break;
}
if (st=DocEntryLink(doc,doc_e)) {
old_doc=DocPut;
DocLock(old_doc);
Fs->put_doc=doc;
found=DocLinkChk(st);
Fs->put_doc=old_doc;
DocUnlock(old_doc);
if (!found) {
PutFileLink(doc->filename.name,doc_e->y);
"$$RED$$ %04d:%s\n$$FG$$",doc_e->y,st;
result++;
}
Free(st);
} else if (doc_e->type_u8==DOCT_ERROR) {
PutFileLink(doc->filename.name,doc_e->y);
"$$RED$$ Doc Error\n$$FG$$";
result++;
}
doc_e=doc_e->next;
}
if (unlock) DocUnlock(doc);
return result;
}
I64 LinkChkFile(U8 *filename,I64 *_fuf_flags)
{
CDoc *doc=DocRead(filename,DOCF_NO_CURSOR);
I64 result=LinkChkDoc(doc,_fuf_flags);
DocDel(doc);
return result;
}
public I64 LinkChk(U8 *files_find_mask="/*",U8 *fu_flags=NULL)
//Checks for broken file links.
{
I64 fuf_flags=0,result=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);
tempde=tempde->next;
}
DirLstDel(tempde1);
return result;
}
#help_index ""