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

+68
View File
@@ -0,0 +1,68 @@
public U0 DocProfile(U8 *filename,I64 flags)
{
I64 i,*cmd_stats=CAlloc(sizeof(I64)*DOCT_NUM_TYPES),
*flags_stats=CAlloc(sizeof(I64)*64),
*type_flags_stats=CAlloc(sizeof(I64)*64);
//Note, word wrap is determined by
//doc->win_task when a $LK,"CDoc",A="MN:CDoc"$ is recalculated
//use $LK,"DocRecalc",A="MN:DocRecalc"$().
CDoc *doc=DocRead(filename,flags);
//doc->root which is equal to doc is the
//header of the CQue and represents the end-of-file marker.
CDocEntry *doc_e=doc->root.next;
while (doc_e!=doc) {
cmd_stats[doc_e->type_u8]++;
for (i=0;i<64;i++)
if (Bt(&doc_e->flags1,i))
flags_stats[i]++;
for (i=16;i<32;i++)
if (Bt(&doc_e->type,i))
type_flags_stats[i]++;
doc_e=doc_e->next;
}
DocDel(doc);
"$$PURPLE$$-------%s-------\n",filename;
"$$GREEN$$The lowest byte of the 32-bit 'doc_e->type', '$$PURPLE$$doc_e->type.u8[0]$$GREEN$$', is cmd and accessed with the union '$$PURPLE$$doc_e->type_u8$$GREEN$$'. "
"See $$LK,\"CDocEntry\",A=\"MN:CDocEntry\"$$, "
"$$LK,\"Doc Type Defines\",A=\"MN:DOCT_TEXT\"$$ and $$LK,\"Doc Type Codes\",A=\"FF:::/Adam/Doc/DocInit.CPP,ST_DOC_CMDS\"$$.\n$$FG$$";
for (i=0;i<DOCT_NUM_TYPES;i++)
if (cmd_stats[i])
"%4Z:%d\n",i,"ST_DOC_CMDS",cmd_stats[i];
"\n$$GREEN$$'$$PURPLE$$doc_e->type.u8[1]$$GREEN$$' is the screen color attr of the entry. "
"'$$PURPLE$$doc_e->type.u16[1]$$GREEN$$' is some flags for blinking and stuff. "
"See $$LK,\"Doc Type Flag Defines\",A=\"MN:DOCET_BLINK\"$$.\n$$FG$$";
for (i=16;i<32;i++)
if (type_flags_stats[i])
"%4d:%d\n",i,type_flags_stats[i];
"$$GREEN$$\n'$$PURPLE$$doc_e->flags1$$GREEN$$' is 64-bit. "
"See $$LK,\"Doc Flag Defines\",A=\"MN:DOCEf1_TAG\"$$ and $$LK,\"Doc Flag Codes\",A=\"FF:::/Adam/Doc/DocInit.CPP,ST_DOC_FLAGS\"$$.\n$$FG$$";
for (i=0;i<64;i++)
if (flags_stats[i])
"%4Z:%d\n",i,"ST_DOC_FLAGS",flags_stats[i];
Free(cmd_stats);
Free(flags_stats);
PressAKey;
NewLine;
}
//See $LK,"TipOfDay",A="MN:TipOfDay"$.
//Note: Not all $LK,"CDocEntry",A="MN:CDocEntry"$'s are full-sized nodes.
//Some are $LK,"MAlloc",A="MN:MAlloc"$ed with a smaller size to save
//mem. They all have at least the size $LK,"CDocEntryBase",A="MN:CDocEntryBase"$.
//Note: $LK,"CDocEntry",A="MN:CDocEntry"$'s should be allocated from the
//heap of the owning task, doc->mem_task.
//The flag arrays $LK,"doc_type_flags_form",A="MN:doc_type_flags_form"$, etc
//are useful.
DocProfile("::/Doc/ChangeLog.TXT",0);
DocProfile("::/Doc/ChangeLog.TXT",DOCF_PLAIN_TEXT);