TempleOSCDV4.03.ISO
This commit is contained in:
1 parent
1541d7328d
commit
0f1a4a5d65
115 files changed
+5618
-4863
No files matched your search
@@ -295,13 +295,13 @@ Bool MyPutKey(I64 ch,I64 sc)
|
||||
return TRUE;
|
||||
case '9':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Dol /---->");
|
||||
KeyDescSet("Dol /Indent 5");
|
||||
else
|
||||
"$$ID,5$$";
|
||||
return TRUE;
|
||||
case '0':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Dol /<----");
|
||||
KeyDescSet("Dol /Unindent 5");
|
||||
else
|
||||
"$$ID,-5$$";
|
||||
return TRUE;
|
||||
@@ -319,7 +319,7 @@ Bool MyPutKey(I64 ch,I64 sc)
|
||||
return TRUE;
|
||||
case 'p':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /JukeBox(TAD)");
|
||||
KeyDescSet("Cmd /JukeBox(Home/Downloads)");
|
||||
else
|
||||
JukeBox("::/Home/Downloads/Psalmody");
|
||||
return TRUE;
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
Cd("::/Home");;
|
||||
#include "::/Home/TOSCfg"
|
||||
#include "::/Home/TOSMisc"
|
||||
#include "::/Home/TOSToHtml"
|
||||
#include "::/Home/TOSDistro"
|
||||
#include "::/Home/TOSBlog"
|
||||
#include "::/Home/TOSHolySpirit"
|
||||
Cd("::/Home");;
|
||||
@@ -9,7 +9,7 @@ U0 UserStartUp()
|
||||
WinToTop;
|
||||
WinZBufUpdate;
|
||||
Dir;
|
||||
"$TX,"80,916",D="DD_TEMPLEOS_LOC_OFFICIAL"$LOC:";
|
||||
"$TX,"81,095",D="DD_TEMPLEOS_LOC_OFFICIAL"$LOC:";
|
||||
CPURep;
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -4,8 +4,6 @@ $WW,1$$FG,5$$TX+CX,"TODO"$$FG$
|
||||
|
||||
* Add AVL or red/black binary tree library support. We have fixed-size stack. Auto-balancing binary tree is very needed. I've done everything myself. I don't want to ruin a perfect record. I'm in no hurry.
|
||||
|
||||
* In <CTRL-r> menu, transform individual elements.
|
||||
|
||||
* $LK,"SpriteEd",A="FI:::/Adam/Gr/SpriteEd.CPP"$ shift pts, Ctrl pt for ellipse/polygon w,h is off when rotated.
|
||||
|
||||
* $LK,"SpriteMesh",A="FI:::/Adam/Gr/SpriteMesh.CPP"$: $LK,"R",A="MN:R"$("Mesh",...);?
|
||||
@@ -27,19 +25,19 @@ $WW,1$$FG,5$$TX+CX,"TODO"$$FG$
|
||||
|
||||
* Cannot include ':' in $LK,"Document Links",A="FF:::/Adam/DolDoc/DocLink.CPP,AD"$ search string.
|
||||
|
||||
* $LK,"DOCEF_REMALLOC_DATA",A="FF:::/Adam/DolDoc/DocChar.CPP,DOCEF_REMALLOC_DATA"$ HexEdit Remalloc.
|
||||
|
||||
* No way to clear $LK,"DOCEf_HOLD",A="MN:DOCEf_HOLD"$ entries.
|
||||
|
||||
* $LK,"DOCF_DBL_DOLLARS",A="MN:DOCF_DBL_DOLLARS"$ in $LK,"Reindention",A="MN:EdCodeTools2"$.
|
||||
|
||||
* Compiler: Warn unnecessary typecast.
|
||||
|
||||
* Compiler Optimization: Local array vars --> reg. Might exist.
|
||||
|
||||
* Compiler Optimization: heap_glbls with added offset. Might exist.
|
||||
|
||||
* AfterEgypt: $LK,"Numbers,13:33",A="BF:Numbers,13:33"$ scouts? $LK,"Numbers,21:8",A="BF:Numbers,21:8"$ snakes?
|
||||
|
||||
* Find-and-replace text on $$PT$$ line before it.
|
||||
* Bug: Find-and-replace text on $$PT$$ line before it.
|
||||
* 12/25/2015 Copy-Paste index.html glitch if source window 40 columns.
|
||||
* 01/10/2016 find-replace editor hung on $LK,"CounterRenaissance",A="FI:::/Home/Web/TAD/CounterRenaissance.TXT"$ "Rennaisance"
|
||||
* 01/06/2016 Editor filter "str" applied to output from LineRep looks broken.
|
||||
@@ -83,10 +81,10 @@ $FG,5$$TX+CX,"TODO? Meh"$$FG$
|
||||
|
||||
* Clean-up ASCII #127 delete char? (No. Maybe, we want a new usage for 127 in future centuries.)
|
||||
|
||||
* $LK,"DocSave",A="MN:DocSave"$() $LK,"*result==CH_CURSOR",A="FF:::/Adam/DolDoc/DocFile.CPP,*result==CH_CURSOR"$ is ugly.
|
||||
|
||||
* Compiler: Exceptions don't free $LK,"CCmpCtrl",A="MN:CCmpCtrl"$ stuff.
|
||||
|
||||
* $LK,"::/Adam/DolDoc/DocHighlight.CPP"$ for code comments at top of documents.
|
||||
|
||||
* Unhandled exception msgs from MP's get overwritten by WinMgr.
|
||||
|
||||
* $LK,"Diff",A="MN:Diff"$("C:/Misc/Bible.TXT","D:/Misc/Bible.TXT"); Takes too long.
|
||||
@@ -126,6 +124,8 @@ $ID,-5$$HL,0$
|
||||
|
||||
|
||||
$FG,5$$TX+CX,"Bugs"$$FG$
|
||||
* 1/28/16 $LK,"::/Demo/Graphics/Pick3D.CPP"$ crashed in TestSuite.
|
||||
|
||||
* 1/12/16 make RAM drive 2288 blks, $FG,2$CopyTree("C:/Home","B:/Home"); $FG$ Disk runs-out of space and hangs instead of reporting errors.
|
||||
|
||||
* Bug introduced around 11/1/15. Changed $LK,"::/Kernel/Sched.CPP"$ and now $LK,"WinToTop",A="MN:WinToTop"$ is called on Adam task at start-up, sometimes. Might be user's fault because of bad keys pressed during VMware power-on init. Might be fixed by $LK,"ACf_INIT_IN_PROGRESS",A="MN:ACf_INIT_IN_PROGRESS"$.
|
||||
@@ -273,6 +273,8 @@ $FG,5$$TX+CX,"Inspirational Ideas"$$FG$
|
||||
|
||||
* Use standard terminology from "the literature".
|
||||
|
||||
* Striped and other dither patterns. Brushes?
|
||||
|
||||
* Get rid of BYTE, WORD, DWORD in opcode and replace with U8, U16, U32.
|
||||
|
||||
* Get rid of "Char".
|
||||
@@ -314,7 +316,7 @@ $FG,5$$TX+CX,"Inspirational Ideas"$$FG$
|
||||
$ID,5$$$=-CTASK_NEG_OFFSET
|
||||
offset(CTask.addr)==0
|
||||
Spawn(): CAlloc()
|
||||
TaskFinishOff(): Free()
|
||||
TaskDel(): Free()
|
||||
CSysFixedArea.adam
|
||||
Looks like task_flags,locked_flags cause problems with neg offset.
|
||||
$ID,-5$
|
||||
@@ -395,15 +397,15 @@ Meek and humble of heart $TX,"Matthew 11:29",HTML="http://www.biblegateway.com/
|
||||
$FG,5$$TX+CX,"Misc Notes"$$FG$
|
||||
Intel CEO's name: Brian Krzanich
|
||||
>$FG,2$lspci -v$FG$
|
||||
Size:$TX,"17344 KB",D="DD_TEMPLEOSCD_K_SIZE"$
|
||||
Size:$TX,"17358 KB",D="DD_TEMPLEOSCD_K_SIZE"$
|
||||
|
||||
$FG,5$$TX+CX,"My Web Bookmarks"$$FG$$WW,0$
|
||||
$TX,"My FireFox Bookmarks",HTML="http://www.templeos.org/Wb/Home/Downloads/Blog/Bookmarks"$
|
||||
Machine $HC,"<img src=\"http://www.templeos.org/images/Machine.jpg\" width=\"600\" height=\"400\" alt=\"\">"$
|
||||
Frosting $HC,"<img src=\"http://www.templeos.org/images/Frosting.jpg\" width=\"600\" height=\"400\" alt=\"\">"$
|
||||
Soap Carvings $HC,"<img src=\"http://www.templeos.org/images/SoapCarvings.jpg\" width=\"640\" height=\"480\" alt=\"\">"$
|
||||
CottonTail $HC,"<img src=\"http://www.templeos.org/images/CttnTail.jpg\" width=\"644\" height=\"1113\" alt=\"\">"$
|
||||
TempleOS Logo $HC,"<img src=\"http://www.templeos.org/images/Logo128x152.jpg\" width=\"640\" height=\"760\" alt=\"\">"$
|
||||
Machine $HC,"<center><img src=\"http://www.templeos.org/images/Machine.jpg\" width=\"600\" height=\"400\" alt=\"\"></center>"$
|
||||
Frosting $HC,"<center><img src=\"http://www.templeos.org/images/Frosting.jpg\" width=\"600\" height=\"400\" alt=\"\"></center>"$
|
||||
Soap Carvings $HC,"<center><img src=\"http://www.templeos.org/images/SoapCarvings.jpg\" width=\"640\" height=\"480\" alt=\"\"></center>"$
|
||||
CottonTail $HC,"<center><img src=\"http://www.templeos.org/images/CttnTail.jpg\" width=\"644\" height=\"1113\" alt=\"\"></center>"$
|
||||
TempleOS Logo $HC,"<center><img src=\"http://www.templeos.org/images/Logo128x152.jpg\" width=\"640\" height=\"760\" alt=\"\"></center>"$
|
||||
$TX,"SimStructure",HTML="http://www.templeos.org/files/SimStrSetUp.zip"$
|
||||
$TX,"ASU_Transcripts",HTML="http://www.templeos.org/files/ASU_Transcripts.pdf"$ $TX,"ASU Course Catalog (See page 261)",HTML="https://catalog.asu.edu/files/shared/archives/1994-1996/general/UG1994-1996.pdf/1994-1996-UG-241-267.pdf"$
|
||||
$TX,"Dr. David Pheanis",HTML="https://webapp4.asu.edu/directory/person/77201"$ $TX,"Dr. Konstantinos S. Tsakalis",HTML="http://ecee.engineering.asu.edu/directory/tenured-and-tenure-track-faculty/kostantinos-s-tsakalis"$ $TX,"Dr. Walter Higgins",HTML="https://webapp4.asu.edu/directory/directorysearch?cn=Walter+Higgins"$
|
||||
@@ -412,7 +414,7 @@ $TX,"Tom Foley",HTML="http://web.gccaz.edu/~tfoley/perspage.html"$
|
||||
|
||||
|
||||
$FG,5$$TX+CX,"Web Bookmarks"$$FG$
|
||||
Cop tying shoe $HC,"<img src=\"https://goodtimestories.files.wordpress.com/2013/04/cop-tying-shoe-cambridge-county-pd.jpg\" width=\"480\" height=\"376\" alt=\"\">"$
|
||||
Cop tying shoe $HC,"<center><img src=\"https://goodtimestories.files.wordpress.com/2013/04/cop-tying-shoe-cambridge-county-pd.jpg\" width=\"480\" height=\"376\" alt=\"\"></center>"$
|
||||
$TX,"Good Time Bad Times Lyrics",HTML="https://www.google.com/#q=led+zep+good+times+bad+times+lyrics"$
|
||||
$TX,"Unikernels",HTML="https://ma.ttias.be/what-is-a-unikernel"$
|
||||
$TX,"Handford school",HTML="https:/pinterest.com/pin/255368241346360278"$
|
||||
|
||||
@@ -2,7 +2,7 @@ $TR-UL,"Adam"$
|
||||
$ID,2$$TR,"SysMsgFlags"$
|
||||
$ID,2$sys_msg_flags[0]=0xFF;
|
||||
$ID,-2$$TR,"SysRegVer"$
|
||||
$ID,2$registry_version=4.020;
|
||||
$ID,2$registry_version=4.030;
|
||||
$ID,-2$$ID,-2$$TR-UL,"TempleOS"$
|
||||
$ID,2$$TR,"TOS"$
|
||||
$ID,2$I64 tos_code_walk_thru=105,tos_after_egypt_in_action=46;
|
||||
@@ -39,7 +39,7 @@ $ID,-2$$TR,"BomberGolf"$
|
||||
$ID,2$I64 best_score=175;
|
||||
$ID,-2$$ID,-2$$TR,"DemoCompany"$
|
||||
$ID,2$$TR,"Game1"$
|
||||
$ID,2$F64 best_score=197.26500;
|
||||
$ID,2$F64 best_score=166.32939;
|
||||
$TR,"SimpleVal"$
|
||||
$ID,2$1279;
|
||||
$ID,2$1298;
|
||||
$ID,-2$$ID,-2$$ID,-2$
|
||||
@@ -0,0 +1,107 @@
|
||||
U8 *BlogLocalDir(CDate cdt=0)
|
||||
{
|
||||
static U8 dir[STR_LEN];
|
||||
CDateStruct ds;
|
||||
if (!cdt) cdt=Now+local_time_offset;
|
||||
Date2Struct(&ds,cdt);
|
||||
StrPrint(dir,"::/Home/Web/" PERSONAL_INITIALS "/Blog/%d%Z",
|
||||
ds.year,ds.mon-1,"ST_MONTHS");
|
||||
if (!FileFind(dir,,FUF_JUST_DIRS))
|
||||
MkDir(dir);
|
||||
return dir;
|
||||
}
|
||||
|
||||
U8 *BlogLocalFile(CDate cdt=0)
|
||||
{
|
||||
static U8 file[STR_LEN];
|
||||
CDateStruct ds;
|
||||
if (!cdt) cdt=Now+local_time_offset;
|
||||
Date2Struct(&ds,cdt);
|
||||
StrPrint(file,"%s/" PERSONAL_INITIALS "%02d%02d%02d.TXT.Z",
|
||||
BlogLocalDir(cdt),ds.year%100,ds.mon,ds.day_of_mon);
|
||||
return file;
|
||||
}
|
||||
|
||||
U8 *BlogWebDir(CDate cdt=0)
|
||||
{
|
||||
static U8 dir[STR_LEN];
|
||||
CDateStruct ds;
|
||||
if (!cdt) cdt=Now+local_time_offset;
|
||||
Date2Struct(&ds,cdt);
|
||||
StrPrint(dir,PERSONAL_WEB "/Home/Web/" PERSONAL_INITIALS "/Blog/%d%Z",
|
||||
ds.year,ds.mon-1,"ST_MONTHS");
|
||||
return dir;
|
||||
}
|
||||
|
||||
U8 *BlogWebFile(CDate cdt=0)
|
||||
{
|
||||
static U8 file[STR_LEN];
|
||||
CDateStruct ds;
|
||||
if (!cdt) cdt=Now+local_time_offset;
|
||||
Date2Struct(&ds,cdt);
|
||||
StrPrint(file,"%s/" PERSONAL_INITIALS "%02d%02d%02d.TXT.Z",
|
||||
BlogWebDir(cdt),ds.year%100,ds.mon,ds.day_of_mon);
|
||||
return file;
|
||||
}
|
||||
|
||||
public U8 *FileNameNumNext(U8 *files_find_mask,U8 *fmt)
|
||||
{
|
||||
CDirEntry *tempde=FilesFind(files_find_mask);
|
||||
U8 *result=MStrPrint(fmt,FileCnt(tempde));
|
||||
DirTreeDel(tempde);
|
||||
return result;
|
||||
}
|
||||
|
||||
U0 BlogDCImgWrite(CDC *dc,CDate cdt=0)
|
||||
{
|
||||
U8 file_mask[STR_LEN],file_name[STR_LEN],*st1,*st2;
|
||||
if (!cdt) cdt=Now+local_time_offset;
|
||||
StrPrint(file_mask,"%s/Img*",BlogLocalDir(cdt));
|
||||
StrPrint(file_name,"%s/Img%%03d.BMP",BlogLocalDir(cdt));
|
||||
st1=FileNameNumNext(file_mask,file_name);
|
||||
st2=MStrPrint("http://www.templeos.org/Wb%s",st1+2);
|
||||
BMPWrite(st1,dc);
|
||||
Free(st1);
|
||||
"$$HC,\"<img src=\\\"%s\\\" width=\\\"%d\\\" "
|
||||
"height=\\\"%d\\\" alt=\\\"\\\">\"$$\n",st2,dc->width,dc->height;
|
||||
Free(st2);
|
||||
}
|
||||
|
||||
U0 BlogScreenShot()
|
||||
{
|
||||
Bool old_cursor=DocCursor;
|
||||
CDC *dc1,*dc2;
|
||||
U8 *old_fp_draw_input_ptr=gr.fp_draw_input_ptr;
|
||||
gr.fp_draw_input_ptr=NULL;
|
||||
WinMgrSync(2);
|
||||
dc1=DCScreenCapture;
|
||||
dc2=DCExtract(dc1,0,FONT_HEIGHT,GR_WIDTH-1,GR_HEIGHT-1);
|
||||
BlogDCImgWrite(dc2);
|
||||
gr.fp_draw_input_ptr=old_fp_draw_input_ptr;
|
||||
DCDel(dc1);
|
||||
DCDel(dc2);
|
||||
DocCursor(old_cursor);
|
||||
}
|
||||
|
||||
public U0 MakeWebSitePartial()
|
||||
{
|
||||
FreshenWebDir("/Home/Web");
|
||||
FreshenWebDir("/Home/Web/" PERSONAL_INITIALS);
|
||||
FreshenWebDir(BlogLocalDir+2);
|
||||
Drv('C');
|
||||
}
|
||||
|
||||
U0 Blog()
|
||||
{
|
||||
if (!FileFind(BlogLocalFile,,FUF_JUST_FILES))
|
||||
Copy("::/Home/Downloads/Blog/DailyBlogHeader.TXT.Z",BlogLocalFile);
|
||||
WinMax;
|
||||
AutoComplete;
|
||||
Msg(MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN|SCF_CTRL);
|
||||
Msg(MSG_KEY_DOWN_UP,0,SC_F6|SCF_ALT);
|
||||
Msg(MSG_KEY_DOWN_UP,'\n',0);
|
||||
if (Ed(BlogLocalFile,EDF_WAS_WRITE)) {
|
||||
Copy(BlogLocalFile,"::Home/Web/" PERSONAL_INITIALS "/DailyBlog.TXT.Z");
|
||||
MakeWebSitePartial;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,8 @@
|
||||
#help_index "TOS"
|
||||
|
||||
#define PERSONAL_WEB "http:/" "/www.templeos.org/Wb"
|
||||
#define PERSONAL_INITIALS "TAD"
|
||||
|
||||
#define SLOP BLK_SIZE
|
||||
U0 TOSBootRescueDrv1()
|
||||
{
|
||||
|
||||
+13
-129
@@ -1,5 +1,7 @@
|
||||
//The CFG defines are $LK,"::/Home/TOSCfg.CPP",A="FI:::/Demo/AcctExample/TOSCfg.CPP"$.
|
||||
|
||||
#help_index "TOS"
|
||||
|
||||
U8 TOSGetDrv()
|
||||
{
|
||||
I64 result;
|
||||
@@ -45,61 +47,20 @@ U0 TOSPromptAndCopyDrv()
|
||||
TOSCopyDrv(src,dst);
|
||||
}
|
||||
|
||||
public U0 CursorRemFile(U8 *filename)
|
||||
{
|
||||
CDoc *doc;
|
||||
doc=DocRead(filename,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR);
|
||||
DocWrite(doc);
|
||||
DocDel(doc);
|
||||
}
|
||||
public U0 CursorRem(U8 *files_find_mask="*")
|
||||
{
|
||||
I64 fuf_flags=0;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+T+f+F+O");
|
||||
CDirEntry *tempde=FilesFind(files_find_mask,fuf_flags),*tempde1=tempde;
|
||||
while (tempde) {
|
||||
CursorRemFile(tempde->full_name);
|
||||
Touch(tempde->full_name,"",,tempde->datetime);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
|
||||
U0 UncollapseFile(U8 *filename,I64 *)
|
||||
{
|
||||
CDoc *doc=DocRead(filename,DOCF_NO_CURSOR);
|
||||
DocCollapse(FALSE,doc);
|
||||
DocWrite(doc);
|
||||
DocDel(doc);
|
||||
}
|
||||
U0 Uncollapse(U8 *files_find_mask="*",U8 *fu_flags=NULL)
|
||||
{
|
||||
I64 fuf_flags=0;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+T+O");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
CDirEntry *tempde=FilesFind(files_find_mask,fuf_flags),*tempde1=tempde;
|
||||
while (tempde && !Bt(&fuf_flags,FUf_CANCEL)) {
|
||||
UncollapseFile(tempde->full_name,&fuf_flags);
|
||||
Touch(tempde->full_name,"",,tempde->datetime);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
|
||||
public U0 CopySongs(U8 threshold='7')
|
||||
{
|
||||
CDoc *s;
|
||||
CDoc *doc;
|
||||
CDocEntry *doc_e;
|
||||
CDirEntry *tempde=FilesFind("/Home/Downloads/Psalmody/*.CPP*",
|
||||
FUF_CLUSTER_ORDER),
|
||||
*tempde1=tempde;
|
||||
FUF_CLUSTER_ORDER),*tempde1=tempde;
|
||||
DelTree("/Apps/Psalmody/Examples");
|
||||
MkDir("/Apps/Psalmody/Examples");
|
||||
while (tempde) {
|
||||
s=DocRead(tempde->full_name);
|
||||
doc_e=s->root.next;
|
||||
doc=DocRead(tempde->full_name);
|
||||
doc_e=doc->root.next;
|
||||
if (doc_e->type_u8==DOCT_TEXT && doc_e->tag[2]>=threshold)
|
||||
Copy(tempde->full_name,"/Apps/Psalmody/Examples");
|
||||
DocDel(doc);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
@@ -288,7 +249,7 @@ U0 MakeTOSDistro()
|
||||
ISOFileCreate(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
|
||||
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOSTS_SIZE",
|
||||
"Download $TX,"TempleOS V4.01",D="DD_OS_NAME_VERSION"$ - T.S. Company Internal Distro (%0.1f MB)",
|
||||
"Download $TX,"TempleOS V4.03",D="DD_OS_NAME_VERSION"$ - T.S. Company Internal Distro (%0.1f MB)",
|
||||
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
|
||||
Drv('C');
|
||||
}
|
||||
@@ -323,7 +284,7 @@ U0 MakeDbgDistro()
|
||||
ISOFileCreate(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
|
||||
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOSDBG_SIZE",
|
||||
"Download $TX,"TempleOS V4.01",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.1f MB)",
|
||||
"Download $TX,"TempleOS V4.03",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.1f MB)",
|
||||
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
|
||||
Drv('C');
|
||||
}
|
||||
@@ -371,7 +332,7 @@ U0 MakeLiteDistro()
|
||||
ISOFileCreate(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
|
||||
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOSLITE_SIZE",
|
||||
"Download $TX,"TempleOS V4.01",D="DD_OS_NAME_VERSION"$ - Lite Distro (%0.1f MB)",
|
||||
"Download $TX,"TempleOS V4.03",D="DD_OS_NAME_VERSION"$ - Lite Distro (%0.1f MB)",
|
||||
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
|
||||
Drv('C');
|
||||
}
|
||||
@@ -404,98 +365,21 @@ U0 MakeUltraDistro()
|
||||
ISOFileCreate(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
|
||||
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOSULTRA_SIZE",
|
||||
"Download $TX,"TempleOS V4.01",D="DD_OS_NAME_VERSION"$ - UltraLite Distro (%0.1f MB)",
|
||||
"Download $TX,"TempleOS V4.03",D="DD_OS_NAME_VERSION"$ - UltraLite Distro (%0.1f MB)",
|
||||
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
|
||||
Drv('C');
|
||||
}
|
||||
|
||||
U0 TOSWebFile(U8 *name)
|
||||
{
|
||||
U8 *name2;
|
||||
CDirEntry de;
|
||||
if (FileFind(name,&de)) {
|
||||
Free(de.full_name);
|
||||
"File:%s\n",name;
|
||||
UncollapseFile(name,NULL);
|
||||
Touch(name,"",,de.datetime);
|
||||
name2=ChgExt(name,"html");
|
||||
ToHtml(name,name2,
|
||||
"<title>The Temple Operating System</title>\n"
|
||||
"<meta name=\"keywords\" "
|
||||
"content=\"Operating System,64-Bit,64 Bit,"
|
||||
"Temple,OS,TempleOS,Free,Open Source,Public Domain,x86_64\">\n");
|
||||
Touch(name2,"",,de.datetime);
|
||||
Free(name2);
|
||||
}
|
||||
}
|
||||
|
||||
U0 MakeWebSite()
|
||||
{
|
||||
CDirEntry *tempde,*tempde1;
|
||||
DocClear;
|
||||
Cd("D:/Wb");
|
||||
DelTree("D:/Wb/Home/Budget");
|
||||
DelTree("D:/Wb/Home/Private");
|
||||
Del("D:/Wb/Home/*");
|
||||
Touch("D:/Wb/Home/Web/index.TXT.Z","");
|
||||
Touch("D:/Wb/Home/Web/Downloads.TXT.Z","");
|
||||
Touch("D:/Wb/Home/Web/TempleOS.TXT.Z","");
|
||||
tempde=tempde1=FilesFind("*",
|
||||
FUF_RECURSE|FUF_JUST_FILES|FUF_JUST_TXT|FUF_CLUSTER_ORDER);
|
||||
while (tempde) {
|
||||
TOSWebFile(tempde->full_name);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
Copy( "D:/Wb/Home/Downloads/Bin/TempleBot",
|
||||
"D:/Wb/Home/Downloads/Bin/TempleBot.TXT");
|
||||
ToDolDoc("D:/Wb/Home/Downloads/Bin/TempleBot.TXT");
|
||||
ToHtml("D:/Wb/Home/Downloads/Bin/TempleBot.TXT");
|
||||
Del("D:/Wb/Home/Downloads/Bin/TempleBot.TXT");
|
||||
DirTreeDel(tempde1);
|
||||
Drv('C');
|
||||
}
|
||||
|
||||
U0 FreshenWebDir(U8 *dirname)
|
||||
{//No recurse
|
||||
CDirEntry *tempde,*tempde1;
|
||||
U8 *src,*dst;
|
||||
|
||||
src=MStrPrint("D:/Wb%s/*",dirname);
|
||||
Del(src);
|
||||
Free(src);
|
||||
src=MStrPrint("C:%s/*",dirname);
|
||||
dst=MStrPrint("D:/Wb%s",dirname);
|
||||
Copy(src,dst);
|
||||
Free(src);
|
||||
Free(dst);
|
||||
|
||||
src=MStrPrint("D:/Wb%s/*",dirname);
|
||||
tempde=tempde1=FilesFind(src,FUF_JUST_FILES|FUF_JUST_TXT|FUF_CLUSTER_ORDER);
|
||||
while (tempde) {
|
||||
TOSWebFile(tempde->full_name);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
|
||||
U0 MakeWebSitePartial()
|
||||
{
|
||||
FreshenWebDir("/Home/Web");
|
||||
FreshenWebDir("/Home/Web/TAD");
|
||||
FreshenWebDir("/Home/Web/Imgs");
|
||||
Drv('C');
|
||||
}
|
||||
|
||||
U0 UpdateISODocDefines()
|
||||
{
|
||||
try {
|
||||
DefinePrint("DD_TEMPLEOSCD_SIZE",
|
||||
"Download $TX,"TempleOS V4.01",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1f MB)",
|
||||
"Download $TX,"TempleOS V4.03",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1f MB)",
|
||||
0.1*(10*Size("D:/Wb/TempleOSCD.ISO","+s")/1024/1024));
|
||||
DefinePrint("DD_TEMPLEOSCD_K_SIZE",
|
||||
"%d KB",Size("D:/Wb/TempleOSCD.ISO","+s")/1024);
|
||||
DefinePrint("DD_TEMPLEOSULTRA_SIZE",
|
||||
"Download $TX,"TempleOS V4.01",D="DD_OS_NAME_VERSION"$ - UltraSmall Distro (%0.1f MB)",
|
||||
"Download $TX,"TempleOS V4.03",D="DD_OS_NAME_VERSION"$ - UltraSmall Distro (%0.1f MB)",
|
||||
0.1*(10*Size("D:/Wb/TempleOSUltra.ISO","+s")/1024/1024));
|
||||
DefinePrint("DD_TEMPLEOSULTRA_K_SIZE",
|
||||
"%d KB",Size("D:/Wb/TempleOSUltra.ISO","+s")/1024);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#help_index "TOS"
|
||||
|
||||
U0 BadCodeJump()
|
||||
{//$LK,"::/Adam/God/HSNotes.TXT"$
|
||||
CDirEntry *tempde1=FilesFind("/*",
|
||||
@@ -28,42 +30,6 @@ U0 BadCodeJump()
|
||||
Free(st);
|
||||
}
|
||||
|
||||
public U8 *FileNameNumNext(U8 *files_find_mask,U8 *fmt)
|
||||
{
|
||||
CDirEntry *tempde=FilesFind(files_find_mask);
|
||||
U8 *result=MStrPrint(fmt,FileCnt(tempde));
|
||||
DirTreeDel(tempde);
|
||||
return result;
|
||||
}
|
||||
|
||||
U0 DCImgWrite(CDC *dc)
|
||||
{
|
||||
U8 *st1=FileNameNumNext("::/Home/Web/Imgs/Img*",
|
||||
"::/Home/Web/Imgs/Img%03d.BMP"),
|
||||
*st2=MStrPrint("http://www.templeos.org/Wb%s",st1+2);
|
||||
BMPWrite(st1,dc);
|
||||
Free(st1);
|
||||
"$$HC,\"<img src=\\\"%s\\\" width=\\\"%d\\\" "
|
||||
"height=\\\"%d\\\" alt=\\\"\\\">\"$$\n",st2,dc->width,dc->height;
|
||||
Free(st2);
|
||||
}
|
||||
|
||||
U0 BlogScreenShot()
|
||||
{
|
||||
Bool old_cursor=DocCursor;
|
||||
CDC *dc1,*dc2;
|
||||
U8 *old_fp_draw_input_ptr=gr.fp_draw_input_ptr;
|
||||
gr.fp_draw_input_ptr=NULL;
|
||||
WinMgrSync(2);
|
||||
dc1=DCScreenCapture;
|
||||
dc2=DCExtract(dc1,0,FONT_HEIGHT,GR_WIDTH-1,GR_HEIGHT-1);
|
||||
DCImgWrite(dc2);
|
||||
gr.fp_draw_input_ptr=old_fp_draw_input_ptr;
|
||||
DCDel(dc1);
|
||||
DCDel(dc2);
|
||||
DocCursor(old_cursor);
|
||||
}
|
||||
|
||||
U8 *WebBookMarks(U8 *filename="::/Home/Downloads/Blog/Bookmarks.html")
|
||||
{
|
||||
U8 *st;
|
||||
@@ -149,7 +115,7 @@ class CTopMoviesForm
|
||||
U8 tag[STR_LEN];
|
||||
U8 special[STR_LEN];
|
||||
I64 timestamp;
|
||||
I64 cert fmtstr "$$DA-TRM,2,A=\"Movie #1-100:%02d\"$$\n";
|
||||
I64 cert fmtstr "$$DA-TRM,LEN=2,A=\"Movie #1-100:%02d\"$$\n";
|
||||
I64 min;
|
||||
I64 sec;
|
||||
};
|
||||
@@ -159,14 +125,14 @@ class CMetallicaForm
|
||||
U8 tag[STR_LEN];
|
||||
U8 special[STR_LEN];
|
||||
I64 timestamp;
|
||||
I64 cert fmtstr "$$DA-TRM,2,A=\"Song #1-99:%02d\"$$\n";
|
||||
I64 cert fmtstr "$$DA-TRM,LEN=2,A=\"Song #1-99:%02d\"$$\n";
|
||||
I64 min;
|
||||
I64 sec;
|
||||
};
|
||||
|
||||
class CWebBookMarkForm
|
||||
{
|
||||
U8 tag[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"Tag Text:%s\"$$\n";
|
||||
U8 tag[STR_LEN] fmtstr "$$DA-P,LEN=STR_LEN-1,A=\"Tag Text:%s\"$$\n";
|
||||
U8 special[STR_LEN];
|
||||
I64 timestamp;
|
||||
I64 cert;
|
||||
@@ -176,8 +142,8 @@ class CWebBookMarkForm
|
||||
|
||||
class CWebBibleForm
|
||||
{
|
||||
U8 tag[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"Tag Text:%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"Bible Passage:%s\"$$\n";
|
||||
U8 tag[STR_LEN] fmtstr "$$DA-P,LEN=STR_LEN-1,A=\"Tag Text:%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,LEN=STR_LEN-1,A=\"Bible Passage:%s\"$$\n";
|
||||
I64 timestamp;
|
||||
I64 cert;
|
||||
I64 min;
|
||||
@@ -186,28 +152,28 @@ class CWebBibleForm
|
||||
|
||||
class CYouTubeForm
|
||||
{
|
||||
U8 tag[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"Title:%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P-TRM,11,A=\"SerialNum:%11s\"$$\n";
|
||||
U8 tag[STR_LEN] fmtstr "$$DA-P,LEN=STR_LEN-1,A=\"Title:%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P-TRM,LEN=11,A=\"SerialNum:%11s\"$$\n";
|
||||
I64 timestamp;
|
||||
I64 cert;
|
||||
I64 min fmtstr "$$DA,32,A=\"Minutes :%d\"$$\n";
|
||||
I64 sec fmtstr "$$DA,32,A=\"Seconds :%d\"$$\n";
|
||||
I64 min fmtstr "$$DA,A=\"Minutes :%d\"$$\n";
|
||||
I64 sec fmtstr "$$DA,A=\"Seconds :%d\"$$\n";
|
||||
};
|
||||
|
||||
class CImgurForm
|
||||
{
|
||||
U8 tag[STR_LEN];
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"SerialNum:%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,LEN=STR_LEN-1,A=\"SerialNum:%s\"$$\n";
|
||||
I64 timestamp;
|
||||
I64 cert;
|
||||
I64 min fmtstr "$$DA,32,A=\"Width :%d\"$$\n";
|
||||
I64 sec fmtstr "$$DA,32,A=\"Height :%d\"$$\n";
|
||||
I64 min fmtstr "$$DA,A=\"Width :%d\"$$\n";
|
||||
I64 sec fmtstr "$$DA,A=\"Height :%d\"$$\n";
|
||||
};
|
||||
|
||||
class CWikipediaForm
|
||||
{
|
||||
U8 tag[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"Tag Text:%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"Index :%s\"$$\n";
|
||||
U8 tag[STR_LEN] fmtstr "$$DA-P,LEN=STR_LEN-1,A=\"Tag Text:%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,LEN=STR_LEN-1,A=\"Index :%s\"$$\n";
|
||||
I64 timestamp;
|
||||
I64 cert;
|
||||
I64 min;
|
||||
@@ -217,7 +183,7 @@ class CWikipediaForm
|
||||
class CRandDecForm
|
||||
{
|
||||
U8 tag[STR_LEN];
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"Line (Dec):%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,LEN=STR_LEN-1,A=\"Line (Dec):%s\"$$\n";
|
||||
I64 timestamp;
|
||||
I64 cert;
|
||||
I64 min;
|
||||
@@ -227,7 +193,7 @@ class CRandDecForm
|
||||
class CRandHexForm
|
||||
{
|
||||
U8 tag[STR_LEN];
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"Line (Hex):%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,LEN=STR_LEN-1,A=\"Line (Hex):%s\"$$\n";
|
||||
I64 timestamp;
|
||||
I64 cert;
|
||||
I64 min;
|
||||
@@ -237,9 +203,9 @@ class CRandHexForm
|
||||
class CRandCertForm
|
||||
{
|
||||
U8 tag[STR_LEN];
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"Line (Dec) :%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,LEN=STR_LEN-1,A=\"Line (Dec) :%s\"$$\n";
|
||||
I64 timestamp;
|
||||
I64 cert fmtstr "$$DA,32,A=\"Certificate:%d\"$$\n";
|
||||
I64 cert fmtstr "$$DA,A=\"Certificate:%d\"$$\n";
|
||||
I64 min;
|
||||
I64 sec;
|
||||
};
|
||||
@@ -248,8 +214,9 @@ class CRandHexBeacon5Form
|
||||
{
|
||||
U8 tag[STR_LEN];
|
||||
U8 special[STR_LEN]
|
||||
fmtstr "$$DA-P-TRM,5,A=\"Line (5-Digit Hex):%5s\"$$\n";
|
||||
I64 timestamp fmtstr "$$DA,32,A=\"TimeStamp :%d\"$$\n";
|
||||
fmtstr "$$DA-P-TRM,LEN=5,"
|
||||
"A=\"Line (5-Digit Hex):%5s\"$$\n";
|
||||
I64 timestamp fmtstr "$$DA,A=\"TimeStamp :%d\"$$\n";
|
||||
I64 cert;
|
||||
I64 min;
|
||||
I64 sec;
|
||||
@@ -259,8 +226,9 @@ class CRandHexBeacon8Form
|
||||
{
|
||||
U8 tag[STR_LEN];
|
||||
U8 special[STR_LEN]
|
||||
fmtstr "$$DA-P-TRM,8,A=\"Line (8-Digit Hex):%8s\"$$\n";
|
||||
I64 timestamp fmtstr "$$DA,32,A=\"TimeStamp :%d\"$$\n";
|
||||
fmtstr "$$DA-P-TRM,LEN=8,"
|
||||
"A=\"Line (8-Digit Hex):%8s\"$$\n";
|
||||
I64 timestamp fmtstr "$$DA,A=\"TimeStamp :%d\"$$\n";
|
||||
I64 cert;
|
||||
I64 min;
|
||||
I64 sec;
|
||||
@@ -456,7 +424,7 @@ public U0 GodBooksPassage(U8 *files_find_mask,I64 len=512,
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
|
||||
#define NIST_TIME_OFFSET (-7879-local_time_offset/CDATE_FREQ)
|
||||
#define NIST_TIME_OFFSET (-7884-local_time_offset/CDATE_FREQ)
|
||||
#define NIST_TIME_TO_SWITCH 3
|
||||
|
||||
public U0 NISTSync()
|
||||
@@ -569,8 +537,8 @@ U0 InsMyURL()
|
||||
break;
|
||||
case:
|
||||
if (DocForm(url(CImgurForm *))) {
|
||||
"$$HC,\"<img src=\\\"http://i.imgur.com/%s\\\" "
|
||||
"width=\\\"%d\\\" height=\\\"%d\\\" alt=\\\"\\\">\"$$\n",
|
||||
"$$HC,\"<center><img src=\\\"http://i.imgur.com/%s\\\" "
|
||||
"width=\\\"%d\\\" height=\\\"%d\\\" alt=\\\"\\\"></center>\"$$\n",
|
||||
url->special,url->min,url->sec;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1,3 +1,46 @@
|
||||
#help_index "TOS"
|
||||
|
||||
public U0 CursorRemFile(U8 *filename)
|
||||
{
|
||||
CDoc *doc;
|
||||
doc=DocRead(filename,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR);
|
||||
DocWrite(doc);
|
||||
DocDel(doc);
|
||||
}
|
||||
public U0 CursorRem(U8 *files_find_mask="*")
|
||||
{
|
||||
I64 fuf_flags=0;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+T+f+F+O");
|
||||
CDirEntry *tempde=FilesFind(files_find_mask,fuf_flags),*tempde1=tempde;
|
||||
while (tempde) {
|
||||
CursorRemFile(tempde->full_name);
|
||||
Touch(tempde->full_name,"",,tempde->datetime);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
|
||||
U0 UncollapseFile(U8 *filename,I64 *)
|
||||
{
|
||||
CDoc *doc=DocRead(filename,DOCF_NO_CURSOR);
|
||||
DocCollapse(FALSE,doc);
|
||||
DocWrite(doc);
|
||||
DocDel(doc);
|
||||
}
|
||||
public U0 Uncollapse(U8 *files_find_mask="*",U8 *fu_flags=NULL)
|
||||
{
|
||||
I64 fuf_flags=0;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+T+O");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
CDirEntry *tempde=FilesFind(files_find_mask,fuf_flags),*tempde1=tempde;
|
||||
while (tempde && !Bt(&fuf_flags,FUf_CANCEL)) {
|
||||
UncollapseFile(tempde->full_name,&fuf_flags);
|
||||
Touch(tempde->full_name,"",,tempde->datetime);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
|
||||
#define VIDEO_FRAME_RATE 8
|
||||
|
||||
#define FG_JUST_AUDIO 0
|
||||
@@ -198,7 +241,7 @@ U0 TOSRegWrite()
|
||||
|
||||
class CYouTubeForm2
|
||||
{
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,STR_LEN-1,A=\"SerialNum:%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,LEN=STR_LEN-1,A=\"SerialNum:%s\"$$\n";
|
||||
};
|
||||
|
||||
U8 *TOSYouTube()
|
||||
|
||||
@@ -0,0 +1,441 @@
|
||||
//This is a customized version of $LK,"::/Demo/ToHtmlToTXTExample/ToHtml.CPP"$.
|
||||
|
||||
#help_index "DolDoc/Conversion"
|
||||
//See $LK,"::/Doc/Credits.TXT"$.
|
||||
|
||||
U0 HtmlPutS(CDoc *doc,I64 u32_attr,I64 *_old_u32_attr,
|
||||
U8 *st,I64 *_col,U8 *style_bitmap=NULL)
|
||||
{
|
||||
U8 *ch,*ptr;
|
||||
u32_attr&=0xFFFFFF00;
|
||||
if (u32_attr&DOCET_INVERT)
|
||||
u32_attr.u8[1]=(u32_attr.u8[1]&15)<<4|u32_attr.u8[1]>>4;
|
||||
if (u32_attr!=*_old_u32_attr) {
|
||||
if (!(u32_attr&DOCET_BLINK) &&
|
||||
*_old_u32_attr!=-1 && *_old_u32_attr&DOCET_BLINK)
|
||||
DocPrint(doc,"</blink>");
|
||||
if (*_old_u32_attr!=-1)
|
||||
DocPrint(doc,"</span>");
|
||||
DocPrint(doc,"<span class=c%02X>",u32_attr.u8[1]);
|
||||
if (u32_attr&DOCET_BLINK &&
|
||||
(*_old_u32_attr==-1 || !(*_old_u32_attr&DOCET_BLINK)))
|
||||
DocPrint(doc,"<blink>");
|
||||
*_old_u32_attr=u32_attr;
|
||||
if (style_bitmap)
|
||||
LBts(style_bitmap,u32_attr.u8[1]);
|
||||
}
|
||||
while (ch=*st++) {
|
||||
switch (ch) {
|
||||
case '\t':
|
||||
do {
|
||||
DocPutKey(doc,CH_SPACE,0);
|
||||
*_col=*_col+1;
|
||||
} while (*_col&7);
|
||||
break;
|
||||
|
||||
sub_switch_start:
|
||||
case 'ã': ptr="pi"; break;
|
||||
case 'é': ptr="theta"; break;
|
||||
case 'è': ptr="phi"; break;
|
||||
case 'ê': ptr="omega"; break;
|
||||
case 'ì': ptr="inf"; break;
|
||||
case 'æ': ptr="u"; break;
|
||||
sub_switch_end:
|
||||
DocPrint(doc,ptr);
|
||||
*_col=*_col+StrLen(ptr);
|
||||
break;
|
||||
|
||||
sub_switch_start:
|
||||
case CH_SHIFT_SPACE: ptr=" "; break;
|
||||
case '&': ptr="&"; break;
|
||||
case '<': ptr="<"; break;
|
||||
case '>': ptr=">"; break;
|
||||
case '"': ptr="""; break;
|
||||
sub_switch_end:
|
||||
DocPrint(doc,ptr);
|
||||
*_col=*_col+1;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (CH_SPACE<=ch<0x7F || ch=='\n')
|
||||
DocPutKey(doc,ch,0);
|
||||
else
|
||||
DocPrint(doc,".");
|
||||
*_col=*_col+1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
U8 *TOSLinkCvt2(U8 *filename,I64 line_num)
|
||||
{// ::/ --> http://www.templeos.org/Wb/
|
||||
//Make your own LinkCvt routine
|
||||
U8 *result=NULL,*st;
|
||||
if (filename) {
|
||||
st=ChgExt(filename,"html");
|
||||
if (st && StrLen(st)>3 && !StrNCmp(st+1,":/",2))
|
||||
result=MStrPrint(PERSONAL_WEB "/%s#l%d",st+3,line_num);
|
||||
Free(st);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
U8 *TOSLinkCvt1(U8 *link_st)
|
||||
{
|
||||
static CDoc *bible=NULL;
|
||||
static I64 locks=0;
|
||||
U8 *result=NULL,*filename,*needle;
|
||||
I64 i,num;
|
||||
if (link_st) {
|
||||
switch (i=EdLinkCvt(link_st,&filename,&needle,&num)) {
|
||||
case LK_FILE_LINE:
|
||||
case LK_PLAIN_LINE:
|
||||
case LK_FILE:
|
||||
result=TOSLinkCvt2(filename,num);
|
||||
break;
|
||||
case -1:
|
||||
case LK_DEF:
|
||||
case LK_HELP_INDEX:
|
||||
case LK_DOC:
|
||||
case LK_DOC_ANCHOR:
|
||||
case LK_DOC_FIND:
|
||||
case LK_DOC_LINE:
|
||||
break;
|
||||
case LK_BIBLE_FIND:
|
||||
while (LBts(&locks,0))
|
||||
Yield;
|
||||
if (!bible)
|
||||
bible=Adam("DocRead(\"%s\");",filename);
|
||||
if (DocFind(bible,num,needle))
|
||||
result=TOSLinkCvt2(filename,bible->cur_entry->y+1);
|
||||
LBtr(&locks,0);
|
||||
break;
|
||||
default:
|
||||
if (DocFileEd(i,filename,needle,&num,EDF_UNCOLLAPSE|EDF_BAIL))
|
||||
result=TOSLinkCvt2(filename,num);
|
||||
}
|
||||
Free(filename);
|
||||
Free(needle);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL,
|
||||
U8 *body_footer=NULL,U8 *html_footer=NULL,Bool line_anchors=TRUE,
|
||||
U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1)
|
||||
{//Cvt $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$doc to HTML file.
|
||||
CDocEntry *doc_e,*style,*doc_e2;
|
||||
I64 i,y,old_y=MIN_I64,col,old_u32_attr=-1,old_attr;
|
||||
U32 *hl,*src;
|
||||
U8 *st,st_2[2],*link_st,*style_bitmap=CAlloc(256/8);
|
||||
CBGR48 p[NUM_COLORS];
|
||||
GrPaletteGet(p);
|
||||
CDoc *doc_out=DocNew;
|
||||
Bool unlock_doc_in=DocLock(doc_in),no_bwd;
|
||||
|
||||
old_attr=doc_in->win_task->text_attr;
|
||||
doc_in->win_task->text_attr=DOC_ATTR_DFT_TEXT;
|
||||
|
||||
for (i=0xF0;i<=0xFF;i++)
|
||||
LBts(style_bitmap,i);
|
||||
|
||||
DocRecalc(doc_in,RECALCt_NORMAL|RECALCF_TO_HTML);
|
||||
|
||||
st_2[0]=0; st_2[1]=0;
|
||||
doc_out->flags|=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
|
||||
|
||||
if (!html_header) html_header=
|
||||
"<!DOCTYPE HTML>\n"
|
||||
"<html>\n"
|
||||
"<head>\n"
|
||||
"<meta http-equiv=\"Content-Type\" "
|
||||
"content=\"text/html;charset=US-ASCII\">\n"
|
||||
"<meta name=\"generator\" content=\"$TX,"TempleOS V4.03",D="DD_OS_NAME_VERSION"$\">\n";
|
||||
if (!body_header) body_header=
|
||||
"<body>\n"
|
||||
"<pre style=\"font-family:courier;font-size:10pt\">\n";
|
||||
if (!body_footer) body_footer=
|
||||
"</pre></body>\n</html>\n";
|
||||
if (!html_footer) html_footer=
|
||||
"</html>\n";
|
||||
|
||||
DocPrint(doc_out,"%s",html_header);
|
||||
|
||||
DocPrint(doc_out,"<style type=\"text/css\">\n");
|
||||
style=doc_out->cur_entry->last;
|
||||
DocPrint(doc_out,
|
||||
"</style>\n"
|
||||
"</head>\n");
|
||||
DocPrint(doc_out,"%s",body_header);
|
||||
|
||||
doc_e=doc_in->root.next;
|
||||
col=doc_e->x;
|
||||
y=doc_e->y;
|
||||
while (doc_e!=doc_in) {
|
||||
if (!(doc_e->de_flags&DOCEF_SKIP)) {
|
||||
if (line_anchors && y!=old_y) {
|
||||
DocPrint(doc_out,"<a name=\"l%d\"></a>",y+1);
|
||||
old_y=y;
|
||||
}
|
||||
while (y<doc_e->y) {
|
||||
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
|
||||
&old_u32_attr,"\n",&col,style_bitmap);
|
||||
if (line_anchors && ++y!=old_y) {
|
||||
DocPrint(doc_out,"<a name=\"l%d\"></a>",y+1);
|
||||
old_y=y;
|
||||
}
|
||||
col=0;
|
||||
}
|
||||
|
||||
no_bwd=TRUE;
|
||||
doc_e2=doc_e->next;
|
||||
while (doc_e2!=doc_in && doc_e2->y==doc_e->y) {
|
||||
if (doc_e2->x<doc_e->x) {
|
||||
no_bwd=FALSE;
|
||||
break;
|
||||
}
|
||||
doc_e2=doc_e2->next;
|
||||
}
|
||||
if (no_bwd)
|
||||
while (col<doc_e->x)
|
||||
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
|
||||
&old_u32_attr," ",&col,style_bitmap);
|
||||
|
||||
link_st=NULL;
|
||||
if (doc_e->de_flags&DOCEF_HTML_LINK)
|
||||
link_st=StrNew(doc_e->html_link);
|
||||
else if (st=DocEntryLink(doc_in,doc_e)) {
|
||||
link_st=link_cvt(st);
|
||||
Free(st);
|
||||
}
|
||||
|
||||
if (link_st) {
|
||||
if (old_u32_attr!=-1) {
|
||||
DocPrint(doc_out,"</span>");
|
||||
old_u32_attr=-1;
|
||||
}
|
||||
DocPrint(doc_out,"<a href=\"%s\">",link_st);
|
||||
}
|
||||
|
||||
switch (doc_e->type_u8) {
|
||||
case DOCT_TEXT:
|
||||
if (doc_e->de_flags&DOCEF_HIGHLIGHT) {
|
||||
if (doc_e->last==doc_in)
|
||||
MemCpy(&doc_e->settings,&doc_in->settings_root,
|
||||
sizeof(CDocSettings));
|
||||
else
|
||||
MemCpy(&doc_e->settings,&doc_e->last->settings,
|
||||
sizeof(CDocSettings));
|
||||
src=hl=DocHighlight(doc_e,doc_e->tag,StrLen(doc_e->tag),
|
||||
doc_e->type&0xFF00);
|
||||
while (*src) {
|
||||
st_2[0]=*src&0xFF;
|
||||
HtmlPutS(doc_out,*src++,&old_u32_attr,st_2,&col,style_bitmap);
|
||||
}
|
||||
Free(hl);
|
||||
} else {
|
||||
if (doc_e->de_flags&DOCEF_CENTER_X && //$BK,1$Nonstandard$BK,0$
|
||||
doc_e->settings.final_u32_attr&0xF00==PURPLE<<8)
|
||||
DocPrint(doc_out,"<h1><center>");
|
||||
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
|
||||
&old_u32_attr,doc_e->tag,&col,style_bitmap);
|
||||
if (doc_e->de_flags&DOCEF_CENTER_X && //$BK,1$Nonstandard$BK,0$
|
||||
doc_e->settings.final_u32_attr&0xF00==PURPLE<<8)
|
||||
DocPrint(doc_out,"</center></h1>");
|
||||
}
|
||||
break;
|
||||
case DOCT_TAB:
|
||||
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
|
||||
&old_u32_attr,"\t",&col,style_bitmap);
|
||||
break;
|
||||
case DOCT_HTML_CODE:
|
||||
if (old_u32_attr!=-1) {
|
||||
DocPrint(doc_out,"</span>");
|
||||
old_u32_attr=-1;
|
||||
}
|
||||
DocPrint(doc_out,"%s",doc_e->tag);
|
||||
break;
|
||||
case DOCT_SPRITE:
|
||||
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
|
||||
&old_u32_attr,doc_e->tag,&col,style_bitmap);
|
||||
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
|
||||
&old_u32_attr,"/* Graphics Not Rendered in HTML */",
|
||||
&col,style_bitmap);
|
||||
break;
|
||||
default:
|
||||
if (doc_e->de_flags&DOCEF_TAG)
|
||||
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
|
||||
&old_u32_attr,doc_e->tag,&col,style_bitmap);
|
||||
}
|
||||
if (link_st) {
|
||||
if (old_u32_attr!=-1) {
|
||||
DocPrint(doc_out,"</span>");
|
||||
old_u32_attr=-1;
|
||||
}
|
||||
DocPrint(doc_out,"</a>");
|
||||
Free(link_st);
|
||||
}
|
||||
}
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
while (y++<doc_e->y) {
|
||||
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
|
||||
&old_u32_attr,"\n",&col,style_bitmap);
|
||||
col=0;
|
||||
}
|
||||
if (old_u32_attr!=-1) {
|
||||
if (old_u32_attr&DOCET_BLINK)
|
||||
DocPrint(doc_out,"</blink>");
|
||||
DocPrint(doc_out,"</span>");
|
||||
old_u32_attr=-1;
|
||||
}
|
||||
DocPrint(doc_out,"%s",body_footer);
|
||||
DocPrint(doc_out,"%s",html_footer);
|
||||
|
||||
doc_out->cur_entry=style->next;
|
||||
for (i=0;i<256;i++)
|
||||
if (Bt(style_bitmap,i))
|
||||
DocPrint(doc_out,
|
||||
".c%02X{color:#%02x%02x%02x;background-color:#%02x%02x%02x;}\n",
|
||||
i,p[i&15].r>>8,p[i&15].g>>8,p[i&15].b>>8,
|
||||
p[i/16].r>>8,p[i/16].g>>8,p[i/16].b>>8);
|
||||
doc_out->cur_entry=&doc_out->root;
|
||||
DocRecalc(doc_out);
|
||||
|
||||
doc_in->win_task->text_attr=old_attr;
|
||||
|
||||
if (unlock_doc_in)
|
||||
DocUnlock(doc_in);
|
||||
return doc_out;
|
||||
}
|
||||
|
||||
#help_index "Cmd Line (Typically);DolDoc/Conversion;DolDoc/Cmd Line (Typically)"
|
||||
public U0 TOSToHtml(U8 *_in_name,U8 *_out_name=NULL,U8 *html_header=NULL,
|
||||
U8 *body_header=NULL,U8 *body_footer=NULL,U8 *html_footer=NULL,
|
||||
I64 width=80,Bool line_anchors=TRUE,
|
||||
U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1)
|
||||
{//Convert $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$file to HTML.
|
||||
//Supply your own link_cvt routine.
|
||||
U8 *in_name,*out_name;
|
||||
CDoc *doc_in,*doc_out;
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
WinHorz(0,width-1); //Sets doc width for word wrap.
|
||||
|
||||
in_name=DftExt(_in_name,"CPP.Z");
|
||||
if (_out_name)
|
||||
out_name=DftExt(_out_name,"html");
|
||||
else
|
||||
out_name=ChgExt(_in_name,"html");
|
||||
|
||||
doc_in=DocRead(in_name);
|
||||
DocTop(doc_in);
|
||||
DocPrint(doc_in,"$$BD,LTCYAN$$"); //$BK,1$Nonstandard$BK,0$
|
||||
doc_out=Doc2Html(doc_in,html_header,body_header,body_footer,html_footer,
|
||||
line_anchors,link_cvt);
|
||||
StrCpy(&doc_out->filename.name,out_name);
|
||||
|
||||
SettingsPop;
|
||||
|
||||
DocWrite(doc_out);
|
||||
DocDel(doc_in);
|
||||
DocDel(doc_out);
|
||||
Free(in_name);
|
||||
Free(out_name);
|
||||
}
|
||||
|
||||
#help_index "TOS"
|
||||
U0 TOSWebFile(U8 *name)
|
||||
{
|
||||
U8 *name2;
|
||||
CDirEntry de;
|
||||
if (FileFind(name,&de)) {
|
||||
Free(de.full_name);
|
||||
"File:%s\n",name;
|
||||
UncollapseFile(name,NULL);
|
||||
Touch(name,"",,de.datetime);
|
||||
name2=ChgExt(name,"html");
|
||||
TOSToHtml(name,name2,
|
||||
"<!DOCTYPE HTML>\n"
|
||||
"<html style=\"background-color:#FFFFFF;\">\n"
|
||||
"<head>\n"
|
||||
"<meta http-equiv=\"Content-Type\" "
|
||||
"content=\"text/html;charset=US-ASCII\">\n"
|
||||
"<title>The Temple Operating System</title>\n"
|
||||
"<meta name=\"keywords\" "
|
||||
"content=\"Operating System,64-Bit,64 Bit,"
|
||||
"Temple,OS,TempleOS,Free,Open Source,Public Domain,x86_64\">\n"
|
||||
"<meta name=\"generator\" content=\"$TX,"TempleOS V4.03",D="DD_OS_NAME_VERSION"$\">\n",
|
||||
|
||||
"<body style=\"background-color:#55FFFF; border-style:solid;
|
||||
border-width:8px; border-color:#0000AA;
|
||||
margin-left:auto; margin-right:auto; width:800px; \">\n"
|
||||
"<pre style=\"font-family:courier;font-size:10pt\">\n"
|
||||
"<div style=\"margin-left:auto; margin-right:auto;"
|
||||
" width: 640px;\">\n",
|
||||
"</div></pre></body>\n",
|
||||
"</html>\n");
|
||||
Touch(name2,"",,de.datetime);
|
||||
Free(name2);
|
||||
}
|
||||
}
|
||||
|
||||
public U0 MakeWebSite()
|
||||
{
|
||||
CDirEntry *tempde,*tempde1;
|
||||
DocClear;
|
||||
Cd("D:/Wb");
|
||||
DelTree("D:/Wb/Home/Budget");
|
||||
DelTree("D:/Wb/Home/Private");
|
||||
Del("D:/Wb/Home/*");
|
||||
Touch("D:/Wb/Home/Web/index.TXT.Z","");
|
||||
Touch("D:/Wb/Home/Web/Downloads.TXT.Z","");
|
||||
Touch("D:/Wb/Home/Web/TempleOS.TXT.Z","");
|
||||
tempde=tempde1=FilesFind("*",
|
||||
FUF_RECURSE|FUF_JUST_FILES|FUF_JUST_TXT|FUF_CLUSTER_ORDER);
|
||||
while (tempde) {
|
||||
TOSWebFile(tempde->full_name);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
Copy( "D:/Wb/Home/Downloads/Bin/TempleBot",
|
||||
"D:/Wb/Home/Downloads/Bin/TempleBot.TXT");
|
||||
ToDolDoc("D:/Wb/Home/Downloads/Bin/TempleBot.TXT");
|
||||
TOSToHtml("D:/Wb/Home/Downloads/Bin/TempleBot.TXT");
|
||||
Del("D:/Wb/Home/Downloads/Bin/TempleBot.TXT");
|
||||
DirTreeDel(tempde1);
|
||||
Drv('C');
|
||||
}
|
||||
|
||||
U0 FreshenWebDir(U8 *dirname)
|
||||
{//No recurse
|
||||
CDirEntry *tempde,*tempde1;
|
||||
U8 *src,*dst;
|
||||
|
||||
MkDir("D:/Wb");
|
||||
MkDir("D:/Wb/Home");
|
||||
MkDir("D:/Wb/Home/Web");
|
||||
MkDir("D:/Wb/Home/Web/TAD");
|
||||
MkDir("D:/Wb/Home/Web/TAD/Blog");
|
||||
|
||||
src=MStrPrint("D:/Wb%s",dirname);
|
||||
MkDir(src);
|
||||
Free(src);
|
||||
|
||||
src=MStrPrint("D:/Wb%s/*",dirname);
|
||||
Del(src);
|
||||
Free(src);
|
||||
|
||||
src=MStrPrint("C:%s/*",dirname);
|
||||
dst=MStrPrint("D:/Wb%s",dirname);
|
||||
Copy(src,dst);
|
||||
Free(src);
|
||||
Free(dst);
|
||||
|
||||
src=MStrPrint("D:/Wb%s/*",dirname);
|
||||
tempde=tempde1=FilesFind(src,FUF_JUST_FILES|FUF_JUST_TXT|FUF_CLUSTER_ORDER);
|
||||
while (tempde) {
|
||||
TOSWebFile(tempde->full_name);
|
||||
tempde=tempde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
}
|
||||
Reference in new issue
Block a user