TempleOSCDV4.10.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:47:44 +02:00
1 parent c5954d3371
commit 9206246147
181 files changed
+4468 -4313

No files matched your search

+7 -7
View File
@@ -219,12 +219,12 @@ 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_root.next,
*tempb2=doc2->bin_root.next;
CDocBin *tempb1=doc1->bin_head.next,
*tempb2=doc2->bin_head.next;
if (tempb1->last->last->num!=tempb2->last->last->num)
return TRUE;
while (tempb1!=&doc1->bin_root) {
while (tempb1!=&doc1->bin_head) {
if (tempb1->size!=tempb2->size ||
MemCmp(tempb1->data,tempb2->data,tempb1->size))
return TRUE;
@@ -249,14 +249,14 @@ public Bool Diff(U8 *dst_file,U8 *src_file,I64 *_df_flags=NULL)
df_flags=0;
df_flags&=DF_ABORT_ALL_FILES;
doc_e=doc1->root.next;
doc_e=doc1->head.next;
while (doc_e!=doc1) {
if (doc_e->type_u8==DOCT_TEXT)
doc_e->user_data=cnt1++; //user_data is the new y
doc_e=doc_e->next;
}
doc_e=doc2->root.next;
doc_e=doc2->head.next;
while (doc_e!=doc2) {
if (doc_e->type_u8==DOCT_TEXT)
doc_e->user_data=cnt2++; //user_data is the new y
@@ -266,7 +266,7 @@ public Bool Diff(U8 *dst_file,U8 *src_file,I64 *_df_flags=NULL)
doc_sorted1=MAlloc(cnt1*sizeof(CDocEntry *));
doc_unsorted1=MAlloc((cnt1+1)*sizeof(CDocEntry *));
i=0;
doc_e=doc1->root.next;
doc_e=doc1->head.next;
while (doc_e!=doc1) {
if (doc_e->type_u8==DOCT_TEXT) {
doc_sorted1[i]=doc_e;
@@ -280,7 +280,7 @@ public Bool Diff(U8 *dst_file,U8 *src_file,I64 *_df_flags=NULL)
doc_sorted2=MAlloc(cnt2*sizeof(CDocEntry *));
doc_unsorted2=MAlloc((cnt2+1)*sizeof(CDocEntry *));
i=0;
doc_e=doc2->root.next;
doc_e=doc2->head.next;
while (doc_e!=doc2) {
if (doc_e->type_u8==DOCT_TEXT) {
doc_sorted2[i]=doc_e;
+1 -1
View File
@@ -47,7 +47,7 @@ I64 FindFile(U8 *needle_str,U8 *haystack_filename,
plen=StrLen(needle_str);
if (replace_text)
rlen=StrLen(replace_text);
doc_e=doc->root.next;
doc_e=doc->head.next;
while (doc_e!=doc && cont) {
if (doc_e->type_u8==DOCT_TEXT) {
src=doc_e->tag;
+20 -20
View File
@@ -21,7 +21,7 @@ class CHeapLogHash
};
CHeapCtrl *heaplog_hc_watched,*heaplog_hc=NULL;
CHeapLogHash *heaplog_root=NULL;
CHeapLogHash *heaplog_head=NULL;
U0 HeapLogMAlloc(U8 *addr)
{
@@ -37,7 +37,7 @@ U0 HeapLogMAlloc(U8 *addr)
CLI
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
PAUSE
QueIns(temphl,heaplog_root[i].last);
QueIns(temphl,heaplog_head[i].last);
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
POPFD
}
@@ -54,8 +54,8 @@ U0 HeapLogFree(U8 *addr)
CLI
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
PAUSE
temphl=heaplog_root[i].next;
while (temphl!=&heaplog_root[i]) {
temphl=heaplog_head[i].next;
while (temphl!=&heaplog_head[i]) {
if (addr==temphl->addr) {
QueRem(temphl);
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
@@ -90,9 +90,9 @@ public Bool HeapLog(Bool val=ON,CTask *task=NULL)
heaplog_hc=HeapCtrlInit(,,sys_data_bp);
ext[EXT_HEAPLOG_MALLOC]=&HeapLogMAlloc;
ext[EXT_HEAPLOG_FREE]=&HeapLogFree;
heaplog_root=MAlloc(sizeof(CHeapLogHash)*HL_HASH_SIZE,heaplog_hc);
heaplog_head=MAlloc(sizeof(CHeapLogHash)*HL_HASH_SIZE,heaplog_hc);
for (i=0;i<HL_HASH_SIZE;i++)
QueInit(&heaplog_root[i]);
QueInit(&heaplog_head[i]);
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
POPFD
LBts(&sys_semas[SYS_SEMA_HEAPLOG_ACTIVE],0);
@@ -104,7 +104,7 @@ public Bool HeapLog(Bool val=ON,CTask *task=NULL)
return FALSE;
} else {
HeapCtrlDel(heaplog_hc);
heaplog_root=heaplog_hc=NULL;
heaplog_head=heaplog_hc=NULL;
ext[EXT_HEAPLOG_MALLOC]=NULL;
ext[EXT_HEAPLOG_FREE]=NULL;
return TRUE;
@@ -124,8 +124,8 @@ 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_root[i].next;
while (temphl!=&heaplog_root[i]) {
temphl=heaplog_head[i].next;
while (temphl!=&heaplog_head[i]) {
//Take snapshot in case modified. (while we work)
MemCpy(&hl,temphl,sizeof(CHeapLog));
"$$PURPLE$$%08X$$FG$$ %08X",MSize(hl.addr),hl.addr;
@@ -147,27 +147,27 @@ 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;
CHeapLogHash *size_root;
CHeapLogHash *size_head;
if (!LBtr(&sys_semas[SYS_SEMA_HEAPLOG_ACTIVE],0)) {
"HeapLog Not Active\n";
return;
}
size_root=MAlloc(sizeof(CHeapLogHash)*HL_HASH_SIZE,heaplog_hc);
size_head=MAlloc(sizeof(CHeapLogHash)*HL_HASH_SIZE,heaplog_hc);
for (i=0;i<HL_HASH_SIZE;i++)
QueInit(&size_root[i]);
QueInit(&size_head[i]);
"$$WW,0$$";
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
PAUSE
for (i=0;i<HL_HASH_SIZE;i++) {
temphla=heaplog_root[i].next;
while (temphla!=&heaplog_root[i]) {
temphla=heaplog_head[i].next;
while (temphla!=&heaplog_head[i]) {
//Take snapshot in case modified. (while we work)
MemCpy(&hla,temphla,sizeof(CHeapLog));
k=(MSize(hla.addr)>>3+hla.caller[0])&(HL_HASH_SIZE-1);
temphls=size_root[k].next;
while (temphls!=&size_root[k]) {
temphls=size_head[k].next;
while (temphls!=&size_head[k]) {
if (MSize(hla.addr)==temphls->size) {
for (j=0;j<HL_CALLER_DEPTH;j++)
if (hla.caller[j]!=temphls->caller[j])
@@ -182,7 +182,7 @@ hl_next:
MemCpy(temphls,&hla,sizeof(CHeapLog));
temphls->cnt=1;
temphls->size=MSize(hla.addr);
QueIns(temphls,size_root[k].last);
QueIns(temphls,size_head[k].last);
hl_found:
temphla=hla.next;
}
@@ -190,8 +190,8 @@ hl_found:
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
for (i=0;i<HL_HASH_SIZE;i++) {
temphls=size_root[i].next;
while (temphls!=&size_root[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;
for (j=0;j<HL_CALLER_DEPTH;j++)
@@ -202,7 +202,7 @@ hl_found:
temphls=temphls1;
}
}
Free(size_root);
Free(size_head);
"\n$$LTRED$$Total:%08X$$FG$$\n",total;
LBts(&sys_semas[SYS_SEMA_HEAPLOG_ACTIVE],0);
+2 -2
View File
@@ -10,8 +10,8 @@ I64 LineRep1(CDirEntry *tempde)
i=LineRep1(tempde->sub);
else {
doc=DocRead(tempde->full_name);
if (doc->root.next!=doc)
i=doc->root.last->y+2;
if (doc->head.next!=doc)
i=doc->head.last->y+2;
DocDel(doc);
}
tempde->user_data=i;
+3 -2
View File
@@ -5,7 +5,7 @@ I64 LinkChkDoc(CDoc *doc,I64 *_fuf_flags)
U8 *st;
Bool found,unlock=DocLock(doc);
CDoc *old_doc;
CDocEntry *doc_e=doc->root.next;
CDocEntry *doc_e=doc->head.next;
I64 res=0;
while (doc_e!=doc) {
if (ScanKey) {
@@ -38,8 +38,9 @@ I64 LinkChkDoc(CDoc *doc,I64 *_fuf_flags)
I64 LinkChkFile(U8 *filename,I64 *_fuf_flags)
{
I64 res;
CDoc *doc=DocRead(filename,DOCF_NO_CURSOR);
I64 res=LinkChkDoc(doc,_fuf_flags);
res=LinkChkDoc(doc,_fuf_flags);
DocDel(doc);
return res;
}
+8 -8
View File
@@ -21,14 +21,14 @@ public I64 Sort(U8 *_in_name,U8 *_out_name=NULL,
out_name=StrNew(in_name);
doc=DocRead(in_name,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
doc_e=doc->root.next;
doc_e=doc->head.next;
while (doc_e!=doc) {
if (doc_e->type_u8==DOCT_TEXT)
cnt++;
doc_e=doc_e->next;
}
a=MAlloc(cnt*sizeof(CDocEntry *));
doc_e=doc->root.next;
doc_e=doc->head.next;
i=0;
while (doc_e!=doc) {
doc_e1=doc_e->next;
@@ -47,15 +47,15 @@ public I64 Sort(U8 *_in_name,U8 *_out_name=NULL,
if (!unique || !st || StrCmp(a[i]->tag,st)) {
st=a[i]->tag;
for (j=0;j<entry_lines && i<cnt;j++,i++) {
QueIns(a[i],doc->root.last);
doc->cur_entry=&doc->root;
QueIns(a[i],doc->head.last);
doc->cur_entry=&doc->head;
doc->cur_col=0;
DocPrint(doc,"\n");
}
res++;
} else
for (j=0;j<entry_lines && i<cnt;j++,i++) {
QueIns(a[i],doc->root.last);
QueIns(a[i],doc->head.last);
DocEntryDel(doc,a[i]);
}
}
@@ -74,7 +74,7 @@ I64 DocWordsFile(CDoc *doc_out=NULL,U8 *filename,U32 *chars_bmp)
U8 *ptr,*ptr2;
I64 res=0,ch;
CDoc *doc_in=DocRead(filename);
CDocEntry *doc_e=doc_in->root.next;
CDocEntry *doc_e=doc_in->head.next;
while (doc_e!=doc_in) {
if (doc_e->de_flags & DOCEF_TAG) {
ptr=doc_e->tag;
@@ -123,7 +123,7 @@ I64 LongLinesFile(U8 *filename,I64 cols)
{
I64 res=0;
CDoc *doc=DocRead(filename);
CDocEntry *doc_e=doc->root.next;
CDocEntry *doc_e=doc->head.next;
while (doc_e!=doc) {
if (doc_e->type_u8==DOCT_NEW_LINE && doc_e->x>=cols+1)
res++;
@@ -160,7 +160,7 @@ U0 SUFile(U8 *filename,I64 suf_flags,F64 indent_scale_factor)
Bool chged=FALSE;
I64 reduced=0;
CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
CDocEntry *doc_e=doc->root.next;
CDocEntry *doc_e=doc->head.next;
while (doc_e!=doc) {
if (doc_e->type_u8==DOCT_TEXT) {
dst=MStrUtil(doc_e->tag,suf_flags,indent_scale_factor);
+2 -2
View File
@@ -46,7 +46,7 @@ public CDoc *Doc2TXT(CDoc *doc_in)
doc_out->flags|=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
doc_e=doc_in->root.next;
doc_e=doc_in->head.next;
col=doc_e->x;
y=doc_e->y;
while (doc_e!=doc_in) {
@@ -93,7 +93,7 @@ public CDoc *Doc2TXT(CDoc *doc_in)
y++;
col=0;
}
doc_out->cur_entry=&doc_out->root;
doc_out->cur_entry=&doc_out->head;
DocRecalc(doc_out);
if (unlock_doc_in)