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

File renamed without changes.
+16 -16
View File
@@ -2,16 +2,16 @@
public U8 *ACDDefGet(U8 *st,I64 def_num=1)
{//MAlloc str holding single dict definition of word.
CFile *f;
CHashGeneric *temph;
CHashGeneric *tmph;
U8 *res=NULL,*buf,*in_ptr,
*st2=MStrUtil(st,SUF_TO_UPPER);
temph=HashFind(st2,ac.hash_table,HTT_DICT_WORD);
tmph=HashFind(st2,ac.hash_table,HTT_DICT_WORD);
Free(st2);
if (temph) {
if (tmph) {
if (f=FOpen(ACD_DEF_FILENAME,"r")) {
buf=MAlloc(ACD_BLK_SIZE*2+1);
buf[ACD_BLK_SIZE*2]=0; //terminate
FRBlks(f,buf,temph->user_data0*ACD_BLK_SIZE/BLK_SIZE,
FRBlks(f,buf,tmph->user_data0*ACD_BLK_SIZE/BLK_SIZE,
ACD_BLK_SIZE*2/BLK_SIZE);
FClose(f);
in_ptr=buf;
@@ -46,16 +46,16 @@ public U8 *ACDDefGet(U8 *st,I64 def_num=1)
public U8 *ACDDefsGet(U8 *st)
{//MAlloc str with all dict definitions of word.
CFile *f;
CHashGeneric *temph;
CHashGeneric *tmph;
U8 *res=NULL,*buf,*in_ptr,*in_ptr2,
*st2=MStrUtil(st,SUF_TO_UPPER);
temph=HashFind(st2,ac.hash_table,HTT_DICT_WORD);
tmph=HashFind(st2,ac.hash_table,HTT_DICT_WORD);
Free(st2);
if (temph) {
if (tmph) {
if (f=FOpen(ACD_DEF_FILENAME,"r")) {
buf=MAlloc(ACD_BLK_SIZE*2+1);
buf[ACD_BLK_SIZE*2]=0; //terminate
FRBlks(f,buf,temph->user_data0*ACD_BLK_SIZE/BLK_SIZE,
FRBlks(f,buf,tmph->user_data0*ACD_BLK_SIZE/BLK_SIZE,
ACD_BLK_SIZE*2/BLK_SIZE);
FClose(f);
in_ptr=buf;
@@ -143,7 +143,7 @@ U0 ACDFillin(I64 n)
s=acd.fillins[n]+1;
len=StrLen(s);
if (len>ac.partial_len)
Auto(s+ac.partial_len);
In(s+ac.partial_len);
}
}
@@ -246,16 +246,16 @@ U0 ACFillIn(I64 n)
if (0<=--n<ac.num_fillins) {
s=ac.fillin_matches[n]->str;
if (StrLen(s)>ac.partial_len)
Auto(s+ac.partial_len);
In(s+ac.partial_len);
}
}
U0 ACMan(I64 n,CTask *parent_task=NULL)
{
CHashAC *tempw;
CHashSrcSym *temph;
if (0<=--n<ac.num_fillins && (tempw=ac.fillin_matches[n]) &&
(temph=HashFind(tempw->str,Fs->hash_table,HTG_SRC_SYM)) &&
temph->src_link)
PopUpEd(temph->src_link,parent_task);
CHashAC *tmpw;
CHashSrcSym *tmph;
if (0<=--n<ac.num_fillins && (tmpw=ac.fillin_matches[n]) &&
(tmph=HashFind(tmpw->str,Fs->hash_table,HTG_SRC_SYM)) &&
tmph->src_link)
PopUpEd(tmph->src_link,parent_task);
}
+26 -26
View File
@@ -5,7 +5,7 @@ acd.has_defs =FileFind(ACD_DEF_FILENAME)||FileFind(ACD_DEF_FILENAME_Z);
public U0 ACDWordsLoad()
{//Put words from word list into hash table.
I64 size;
CHashGeneric *temph;
CHashGeneric *tmph;
U8 *in_ptr,*in_start,*st2;
U16 *d;
acd.num_words=0;
@@ -21,17 +21,17 @@ public U0 ACDWordsLoad()
in_ptr++;
if (*in_ptr) {
st2=MStrUtil(in_ptr,SUF_TO_UPPER);
temph=ACAlloc(sizeof(CHashGeneric)+StrLen(st2)+1);
StrCpy(temph+1,st2);
tmph=ACAlloc(sizeof(CHashGeneric)+StrLen(st2)+1);
StrCpy(tmph+1,st2);
Free(st2);
in_ptr+=StrLen(in_ptr)+1;
temph->str=temph+1;
temph->use_cnt=1;
temph->type=HTT_DICT_WORD;
tmph->str=tmph+1;
tmph->use_cnt=1;
tmph->type=HTT_DICT_WORD;
d=in_ptr;
temph->user_data0=*d;
tmph->user_data0=*d;
in_ptr+=2;
HashAdd(temph,ac.hash_table);
HashAdd(tmph,ac.hash_table);
acd.num_words++;
} else
in_ptr+=3;
@@ -43,19 +43,19 @@ public U0 ACDWordsLoad()
#help_index "AutoComplete"
CHashAC *ACHashAdd(U8 *w)
{
CHashAC *tempw=HashFind(w,ac.hash_table,HTT_WORD);
if (tempw) {
tempw->hits++;
return tempw;
CHashAC *tmpw=HashFind(w,ac.hash_table,HTT_WORD);
if (tmpw) {
tmpw->hits++;
return tmpw;
}
tempw=ACAlloc(sizeof(CHashAC));
tempw->str=AStrNew(w);
tempw->type=HTT_WORD;
tempw->use_cnt=1;
tempw->hits=1;
HashAdd(tempw,ac.hash_table);
tmpw=ACAlloc(sizeof(CHashAC));
tmpw->str=AStrNew(w);
tmpw->type=HTT_WORD;
tmpw->use_cnt=1;
tmpw->hits=1;
HashAdd(tmpw,ac.hash_table);
ac.num_words++;
return tempw;
return tmpw;
}
U0 ACSingleFileAdd(U8 *buf)
@@ -93,20 +93,20 @@ U0 ACSingleFileAdd(U8 *buf)
U0 ACMainFileLstTraverse(U8 *files_find_mask)
{
U8 *buf;
CDirEntry *tempde,*tempde1;
CDirEntry *tmpde,*tmpde1;
try {
tempde=tempde1=FilesFind(files_find_mask,
tmpde=tmpde1=FilesFind(files_find_mask,
FUF_RECURSE|FUF_JUST_TXT|FUF_JUST_FILES|FUF_CLUSTER_ORDER);
while (tempde) {
"%s\n",tempde->full_name;
buf=FileRead(tempde->full_name);
while (tmpde) {
"%s\n",tmpde->full_name;
buf=FileRead(tmpde->full_name);
ACSingleFileAdd(buf);
Free(buf);
tempde=tempde->next;
tmpde=tmpde->next;
}
} catch
Fs->catch_except=TRUE;
DirTreeDel(tempde1);
DirTreeDel(tmpde1);
}
U0 ACProgressTask(Bool *_start_flag)
+16 -16
View File
@@ -60,21 +60,21 @@ I64 ACPriorWordInStr(U8 *src,U8 *dst,I64 len,I64 buf_size)
return i+1;
}
U0 ACFillInAdd(CHashAC *tempw)
U0 ACFillInAdd(CHashAC *tmpw)
{
I64 k;
if (ac.num_fillins<AC_MAX_FILLINS ||
tempw->hits>ac.fillin_hits[ac.num_fillins-1]) {
tmpw->hits>ac.fillin_hits[ac.num_fillins-1]) {
for (k=ac.num_fillins-1;k>=0;k--) {
if (tempw->hits<=ac.fillin_hits[k])
if (tmpw->hits<=ac.fillin_hits[k])
break;
else {
ac.fillin_matches[k+1]=ac.fillin_matches[k];
ac.fillin_hits[k+1] =ac.fillin_hits[k];
}
}
ac.fillin_matches[k+1]=tempw;
ac.fillin_hits[k+1] =tempw->hits;
ac.fillin_matches[k+1]=tmpw;
ac.fillin_hits[k+1] =tmpw->hits;
if (ac.num_fillins<AC_MAX_FILLINS)
ac.num_fillins++;
}
@@ -85,9 +85,9 @@ U0 ACPutChoices(CDoc *focus_l,CDocEntry *doc_e,CTask *focus_task,
{
I64 i,data_col;
U8 *buf,*buf1,*src=NULL,*st;
CHashAC *tempw;
CHashAC *tmpw;
F64 timeout_time=tS+0.5;
CHashSrcSym *temph;
CHashSrcSym *tmph;
src=DocScanLine(focus_l,doc_e,&data_col);
DocUnlock(focus_l);
@@ -108,11 +108,11 @@ U0 ACPutChoices(CDoc *focus_l,CDocEntry *doc_e,CTask *focus_task,
ac.num_fillins=0;
if (*ac.cur_word)
for (i=0;i<=ac.hash_table->mask && tS<timeout_time;i++) {
tempw=ac.hash_table->body[i];
while (tempw) {
if (!MemCmp(ac.cur_word,tempw->str,StrLen(ac.cur_word)))
ACFillInAdd(tempw);
tempw=tempw->next;
tmpw=ac.hash_table->body[i];
while (tmpw) {
if (!MemCmp(ac.cur_word,tmpw->str,StrLen(ac.cur_word)))
ACFillInAdd(tmpw);
tmpw=tmpw->next;
}
}
ACDocRst(51,13);
@@ -122,11 +122,11 @@ U0 ACPutChoices(CDoc *focus_l,CDocEntry *doc_e,CTask *focus_task,
st=ac.fillin_matches[i]->str;
"$$GREEN$$F%02d$$FG$$ ",i+1;
if (TaskValidate(focus_task) &&
(temph=HashFind(st,focus_task->hash_table,HTG_SRC_SYM)) &&
temph->src_link) {
if (temph->type&HTF_PUBLIC)
(tmph=HashFind(st,focus_task->hash_table,HTG_SRC_SYM)) &&
tmph->src_link) {
if (tmph->type&HTF_PUBLIC)
"$$RED$$";
"$$TX+UL+L+PU,\"%$$Q\",A=\"%s\"$$$$FG$$\n",st,temph->src_link;
"$$TX+UL+L+PU,\"%$$Q\",A=\"%s\"$$$$FG$$\n",st,tmph->src_link;
} else
"%s\n",st;
}
File renamed without changes.