Update to latest TOS distro
This commit is contained in:
1 parent
7e46072c81
commit
70ff1e2f75
142 files changed
+6403
-9909
No files matched your search
@@ -3,11 +3,6 @@ Cd(__DIR__);;
|
||||
#include "TOSExt"
|
||||
#include "TOSCfg"
|
||||
#include "TOSMisc"
|
||||
#include "TOSToHtml"
|
||||
#include "TOSDistro"
|
||||
#include "TOSBlog"
|
||||
#include "TOSNIST"
|
||||
#include "TOSHolySpirit"
|
||||
#include "TOSIns"
|
||||
|
||||
Cd("..");;
|
||||
@@ -1,168 +0,0 @@
|
||||
#help_index "Misc/PLog"
|
||||
|
||||
public U8 *PLogLocalDir(CDate cdt=0)
|
||||
{//MAlloc dirname of private log for date.
|
||||
static U8 dir[STR_LEN];
|
||||
CDateStruct ds;
|
||||
if (!cdt) cdt=Now+local_time_offset;
|
||||
Date2Struct(&ds,cdt);
|
||||
StrPrint(dir,"~/Private/%d%Z",ds.year,ds.mon-1,"ST_MONTHS");
|
||||
if (!FileFind(dir,,FUF_JUST_DIRS))
|
||||
DirMk(dir);
|
||||
return dir;
|
||||
}
|
||||
|
||||
public U8 *PLogLocalFile(CDate cdt=0)
|
||||
{//MAlloc filename of private log for date.
|
||||
static U8 file[STR_LEN];
|
||||
CDateStruct ds;
|
||||
if (!cdt) cdt=Now+local_time_offset;
|
||||
Date2Struct(&ds,cdt);
|
||||
StrPrint(file,"%s/" INS_REG_PERSONAL_INITIALS "PLog%02d%02d%02d.DD.Z",
|
||||
PLogLocalDir(cdt),ds.year%100,ds.mon,ds.day_of_mon);
|
||||
return file;
|
||||
}
|
||||
|
||||
|
||||
public U0 PLog()
|
||||
{//Make entry in private log.
|
||||
if (!FileFind(PLogLocalFile,,FUF_JUST_FILES))
|
||||
Copy("~/Private/DailyPLogHeader.DD.Z",PLogLocalFile);
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
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);
|
||||
Msg(MSG_KEY_DOWN_UP,CH_CTRLS,0x61F0000061F);
|
||||
if (Ed(PLogLocalFile,EDF_WAS_WRITE))
|
||||
DocOpt(PLogLocalFile,"-r");
|
||||
}
|
||||
|
||||
#help_index "Misc/Blog"
|
||||
|
||||
public U8 *BlogLocalDir(CDate cdt=0)
|
||||
{//MAlloc dirname of blog for date.
|
||||
static U8 dir[STR_LEN];
|
||||
CDateStruct ds;
|
||||
if (!cdt) cdt=Now+local_time_offset;
|
||||
Date2Struct(&ds,cdt);
|
||||
StrPrint(dir,BLOG_LOCAL_BASE "/%d%Z",ds.year,ds.mon-1,"ST_MONTHS");
|
||||
if (!FileFind(dir,,FUF_JUST_DIRS))
|
||||
DirMk(dir);
|
||||
return dir;
|
||||
}
|
||||
|
||||
public U8 *BlogLocalFile(CDate cdt=0)
|
||||
{//MAlloc filename of blog for date.
|
||||
static U8 file[STR_LEN];
|
||||
CDateStruct ds;
|
||||
if (!cdt) cdt=Now+local_time_offset;
|
||||
Date2Struct(&ds,cdt);
|
||||
StrPrint(file,"%s/" INS_REG_PERSONAL_INITIALS "%02d%02d%02d.DD.Z",
|
||||
BlogLocalDir(cdt),ds.year%100,ds.mon,ds.day_of_mon);
|
||||
return file;
|
||||
}
|
||||
|
||||
public U8 *BlogWebDir(CDate cdt=0)
|
||||
{//MAlloc D:/Wb/dirname of blog for date.
|
||||
static U8 dir[STR_LEN];
|
||||
CDateStruct ds;
|
||||
if (!cdt) cdt=Now+local_time_offset;
|
||||
Date2Struct(&ds,cdt);
|
||||
StrPrint(dir,BLOG_WEB_BASE "/%d%Z",
|
||||
ds.year,ds.mon-1,"ST_MONTHS");
|
||||
return dir;
|
||||
}
|
||||
|
||||
public U8 *BlogWebFile(CDate cdt=0)
|
||||
{//MAlloc D:/Wb/filename of blog for date.
|
||||
static U8 file[STR_LEN];
|
||||
CDateStruct ds;
|
||||
if (!cdt) cdt=Now+local_time_offset;
|
||||
Date2Struct(&ds,cdt);
|
||||
StrPrint(file,"%s/" INS_REG_PERSONAL_INITIALS "%02d%02d%02d.DD.Z",
|
||||
BlogWebDir(cdt),ds.year%100,ds.mon,ds.day_of_mon);
|
||||
return file;
|
||||
}
|
||||
|
||||
public U8 *FileNameNumNext(U8 *files_find_mask,U8 *fmt)
|
||||
{//Cnt files in a mask. Create next filename.
|
||||
CDirEntry *tmpde=FilesFind(files_find_mask);
|
||||
U8 *res=MStrPrint(fmt,FileCnt(tmpde));
|
||||
DirTreeDel(tmpde);
|
||||
return res;
|
||||
}
|
||||
|
||||
public U0 BlogDCImgWrite(CDC *dc,CDate cdt=0)
|
||||
{//Add dc to blog as BMP file.
|
||||
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);
|
||||
}
|
||||
|
||||
public U0 BlogScrnShot()
|
||||
{//Add scrn shot to blog as BMP file.
|
||||
Bool old_cursor=DocCursor,old_silent;
|
||||
CDC *dc1,*dc2;
|
||||
U8 *old_fp_draw_ms=gr.fp_draw_ms;
|
||||
gr.fp_draw_ms=NULL;
|
||||
Refresh(2);
|
||||
dc1=DCScrnCapture;
|
||||
dc2=DCExt(dc1,0,FONT_HEIGHT,GR_WIDTH-1,GR_HEIGHT-1);
|
||||
BlogDCImgWrite(dc2);
|
||||
gr.fp_draw_ms=old_fp_draw_ms;
|
||||
DCDel(dc1);
|
||||
DCDel(dc2);
|
||||
DocCursor(old_cursor);
|
||||
old_silent=Silent;
|
||||
FreshenBlog;
|
||||
Silent(old_silent);
|
||||
}
|
||||
|
||||
public U0 FreshenBlog()
|
||||
{//Regen html files for D:/Home/Web.
|
||||
DirMk("D:/Wb");
|
||||
DirMk("D:/Wb/Home");
|
||||
DirMk("D:/Wb/Home/Web");
|
||||
DirMk("D:/Wb/Home/Web/" INS_REG_PERSONAL_INITIALS);
|
||||
DirMk("D:/Wb/Home/Web/" INS_REG_PERSONAL_INITIALS "/BlogDir");
|
||||
|
||||
FreshenWebDir("/Home/Web");
|
||||
FreshenWebDir("/Home/Web/" INS_REG_PERSONAL_INITIALS);
|
||||
FreshenWebDir(BlogLocalDir+2);
|
||||
Drv('C');
|
||||
}
|
||||
|
||||
public U0 Blog(Bool god_misc2=FALSE)
|
||||
{//Make entry in blog.
|
||||
if (!FileFind(BlogLocalFile,,FUF_JUST_FILES))
|
||||
Copy("~/Web/" INS_REG_PERSONAL_INITIALS "/DailyBlogHeader.DD.Z",
|
||||
BlogLocalFile);
|
||||
AutoComplete;
|
||||
WinBorder;
|
||||
WinMax;
|
||||
Msg(MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN|SCF_CTRL);
|
||||
if (god_misc2)
|
||||
Msg(MSG_KEY_DOWN_UP,0,SC_F7|SCF_SHIFT|SCF_ALT);
|
||||
else {
|
||||
Msg(MSG_KEY_DOWN_UP,0,SC_F6|SCF_ALT);
|
||||
Msg(MSG_KEY_DOWN_UP,'\n',0);
|
||||
}
|
||||
Msg(MSG_KEY_DOWN_UP,CH_CTRLS,0x61F0000061F);
|
||||
if (Ed(BlogLocalFile,EDF_WAS_WRITE)) {
|
||||
DocOpt(BlogLocalFile,"-r");
|
||||
Copy(BlogLocalFile,"::" DAILY_BASE ".DD.Z");
|
||||
Copy(BlogLocalFile,"D:" DAILY_BASE ".DD.Z");
|
||||
Copy(BlogLocalFile,"D:/Wb" DAILY_BASE ".DD.Z");
|
||||
TOSWebFile("D:/Wb" DAILY_BASE ".DD.Z");
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,7 @@
|
||||
#help_index "Misc/TOS/Cfg"
|
||||
|
||||
#define PERSONAL_WEB "http:/" "/www.templeos.org/Wb"
|
||||
#define BLOG_BASE "/Home/Web/"\
|
||||
INS_REG_PERSONAL_INITIALS "/BlogDir"
|
||||
#define DAILY_BASE "/Home/Web/"\
|
||||
INS_REG_PERSONAL_INITIALS "/DailyBlog"
|
||||
#define BLOG_LOCAL_BASE "::" BLOG_BASE
|
||||
#define BLOG_WEB_BASE PERSONAL_WEB BLOG_BASE
|
||||
|
||||
#define SLOP BLK_SIZE
|
||||
|
||||
U0 TOSDbgDistro1()
|
||||
{
|
||||
CBinFile *bfh=mem_boot_base-sizeof(CBinFile);
|
||||
@@ -51,8 +44,7 @@ U0 TOSInit()
|
||||
}
|
||||
} TOSInit;
|
||||
|
||||
#define TOS_ISO_NAME "B:/TempleOSCD.ISO"
|
||||
#define TOS_ISO_C_NAME "B:/TempleOSCD.ISO.C"
|
||||
#define TOS_ISO_NAME "B:/TOS_Distro.ISO.C"
|
||||
#define TOS_DISTRO_DIR "B:/Distro"
|
||||
#define CFG_OPTS "StaffMode\nMountIDEAuto\nCT\n"
|
||||
#define CFG_DBG_OPTS "StaffMode\nMountIDEAuto\nCT"\
|
||||
|
||||
@@ -2,17 +2,8 @@
|
||||
|
||||
#help_index "Misc/TOS/Distro"
|
||||
|
||||
#define MAKE_STD 1
|
||||
#define MAKE_STD_RS 0
|
||||
#define MAKE_ULTRA 1
|
||||
#define MAKE_ULTRA_RS 0
|
||||
#define MAKE_SUP1 1
|
||||
#define MAKE_WEB 1
|
||||
#define MAKE_BOOKS1 0
|
||||
#define MAKE_BOOKS2 0
|
||||
#define MAKE_DBG 0
|
||||
#define MAKE_STAFF 1
|
||||
#define PROFANITY_CHK 0
|
||||
|
||||
public U8 TOSGetDrv()
|
||||
{//Pmt for drv let.
|
||||
@@ -59,25 +50,6 @@ public U0 TOSPmtAndCopyDrv()
|
||||
TOSCopyDrv(src,dst);
|
||||
}
|
||||
|
||||
U0 DistroSongsPrep(U8 threshold='7')
|
||||
{
|
||||
CDoc *doc;
|
||||
CDocEntry *doc_e;
|
||||
CDirEntry *tmpde=FilesFind("/Home/Sup1/Sup1Hymns/*.HC*",
|
||||
FUF_CLUS_ORDER),*tmpde1=tmpde;
|
||||
DelTree("/Apps/Psalmody/Examples");
|
||||
DirMk("/Apps/Psalmody/Examples");
|
||||
while (tmpde) {
|
||||
doc=DocRead(tmpde->full_name);
|
||||
doc_e=doc->head.next;
|
||||
if (doc_e->type_u8==DOCT_TEXT && doc_e->tag[2]>=threshold)
|
||||
Copy(tmpde->full_name,"/Apps/Psalmody/Examples");
|
||||
DocDel(doc);
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirTreeDel(tmpde1);
|
||||
}
|
||||
|
||||
U0 DistroPrep()
|
||||
{
|
||||
AOnceFlush; //Don't want in Registry
|
||||
@@ -85,8 +57,6 @@ U0 DistroPrep()
|
||||
|
||||
Del("/Home/Demo*");
|
||||
DelTree("/Home/*Tmp.DD.Z");
|
||||
if (FileFind("/Home/Sup1/Sup1Hymns"))
|
||||
DistroSongsPrep;
|
||||
|
||||
DelTree("/Tmp");
|
||||
DirMk("/Tmp");
|
||||
@@ -97,22 +67,12 @@ U0 DistroPrep()
|
||||
|
||||
DelTree("/Demo/AcctExample");
|
||||
CopyTree("/Home","/Demo/AcctExample");
|
||||
DelTree("/Demo/AcctExample/Private");
|
||||
DelTree("/Demo/AcctExample/TAD");
|
||||
DelTree("/Demo/AcctExample/Sup1");
|
||||
DelTree("/Demo/AcctExample/Books1");
|
||||
DelTree("/Demo/AcctExample/Books2");
|
||||
DelTree("/Demo/AcctExample/Web");
|
||||
Del("/Demo/AcctExample/Test*");
|
||||
Copy("/Home/Web/index.DD.Z",
|
||||
"/Demo/ToHtmlToTXTDemo/DemoInPage.DD.Z");
|
||||
if (FileFind("~/Sup1/Sup1Utils/SortHeaders.HC.Z"))
|
||||
ExeFile("~/Sup1/Sup1Utils/SortHeaders.HC.Z");
|
||||
|
||||
if (FileFind("~/Sup1/Sup1Blog/YouTube.DD.Z"))
|
||||
Sort("~/Sup1/Sup1Blog/YouTube.DD.Z",,2);
|
||||
|
||||
//Once in a while, do ~/Sup1/Sup1Utils/DblSpaceScan.HC.
|
||||
|
||||
CursorRem("/*");
|
||||
DelTree("/Demo/*.BI*");
|
||||
S2T("/*","+r+S");
|
||||
@@ -155,81 +115,6 @@ U0 DbgDistroFilePrep()
|
||||
bd->RAM_dsk,(bd->max_blk+1)<<BLK_SIZE_BITS);
|
||||
}
|
||||
|
||||
U0 MakeSymFiles()
|
||||
{
|
||||
CDoc *doc;
|
||||
U8 *st;
|
||||
|
||||
DocClear;
|
||||
DocMax;
|
||||
HashTablePurge(adam_task->hash_table);
|
||||
Who;
|
||||
if (doc=DocPut) {
|
||||
st=StrNew(doc->filename.name);
|
||||
StrCpy(doc->filename.name,"D:/Wb/Home/Web/SymsAlpha.DD.Z");
|
||||
DocWrite(doc);
|
||||
StrCpy(doc->filename.name,st);
|
||||
Free(st);
|
||||
}
|
||||
DocClear;
|
||||
DocMax;
|
||||
Who("+m");
|
||||
if (doc=DocPut) {
|
||||
st=StrNew(doc->filename.name);
|
||||
StrCpy(doc->filename.name,"D:/Wb/Home/Web/SymsAddress.DD.Z");
|
||||
DocWrite(doc);
|
||||
StrCpy(doc->filename.name,st);
|
||||
Free(st);
|
||||
}
|
||||
DocClear;
|
||||
}
|
||||
|
||||
I64 MakeLineRepFile()
|
||||
{
|
||||
U8 *st;
|
||||
CDoc *doc;
|
||||
I64 res,official;
|
||||
|
||||
DocClear;
|
||||
Drv('C');
|
||||
DistroPrep;
|
||||
|
||||
Cd("C:/");
|
||||
DelTree("B:/TOS/TOS");
|
||||
CopyTree("C:/Home","B:/TOS/TOS");
|
||||
DelTree("C:/Home");
|
||||
|
||||
DocMax;
|
||||
DocClear;
|
||||
res=LineRep;
|
||||
if (doc=DocPut) {
|
||||
st=StrNew(doc->filename.name);
|
||||
StrCpy(doc->filename.name,"B:/TOS/TOS/Web/LineRep.DD.Z");
|
||||
DocWrite(doc);
|
||||
StrCpy(doc->filename.name,st);
|
||||
Free(st);
|
||||
}
|
||||
DocClear;
|
||||
official=LineRep("C:/*","-r")+
|
||||
LineRep("C:/Adam/*")+
|
||||
LineRep("C:/Compiler/*","-S+$$")+
|
||||
LineRep("C:/Kernel/*");
|
||||
DocClear;
|
||||
CopyTree("B:/TOS/TOS","C:/Home");
|
||||
DelTree("B:/TOS/TOS");
|
||||
|
||||
DocTreeFWrite("C:/Adam/ADefine.HC.Z","LineRep",
|
||||
"DefinePrint(\"DD_TEMPLEOS_LOC\",\"%,d\");\n",res);
|
||||
DocTreeFAppend("C:/Adam/ADefine.HC.Z","LineRep",
|
||||
"DefinePrint(\"DD_TEMPLEOS_LOC_OFFICIAL\",\"%,d\");\n",official);
|
||||
|
||||
DefinePrint("DD_TEMPLEOS_LOC","%,d",res);
|
||||
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","%,d",official);
|
||||
|
||||
"Total LOC:%12,d\n\n",res;
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 StaffDistroPrep()
|
||||
{
|
||||
Drv('C');
|
||||
@@ -240,15 +125,12 @@ U0 StaffDistroPrep()
|
||||
DelTree(TOS_DISTRO_DIR);
|
||||
CopyTree("C:/",TOS_DISTRO_DIR "/");
|
||||
DelTree(TOS_DISTRO_DIR "/Home/Sup1");
|
||||
DelTree(TOS_DISTRO_DIR "/Home/Books1");
|
||||
DelTree(TOS_DISTRO_DIR "/Home/Books2");
|
||||
Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C);
|
||||
}
|
||||
U0 MakeStaffDistro()
|
||||
{
|
||||
StaffDistroPrep;
|
||||
ISO9660ISO(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
|
||||
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
RedSeaISO(TOS_ISO_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOS_STAFF_SIZE",
|
||||
"Download $TX,"TempleOS V5.03",D="DD_OS_NAME_VERSION"$ - T.S. Company Internal Distro (%0.1fMB)",
|
||||
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
|
||||
@@ -274,8 +156,7 @@ U0 DbgDistroPrep()
|
||||
U0 MakeDbgDistro()
|
||||
{
|
||||
DbgDistroPrep;
|
||||
ISO9660ISO(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
|
||||
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
RedSeaISO(TOS_ISO_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOS_DBG_SIZE",
|
||||
"Download $TX,"TempleOS V5.03",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.1fMB)",
|
||||
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
|
||||
@@ -300,96 +181,49 @@ U0 StdDistroPrep()
|
||||
U0 MakeStdDistro()
|
||||
{
|
||||
StdDistroPrep;
|
||||
ISO9660ISO(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
|
||||
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
RedSeaISO(TOS_ISO_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOSCD_SIZE",
|
||||
"Download $TX,"TempleOS V5.03",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)",
|
||||
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
|
||||
Drv('C');
|
||||
}
|
||||
U0 MakeStdRedSeaDistro()
|
||||
{
|
||||
StdDistroPrep;
|
||||
RedSeaISO(TOS_ISO_C_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOSCD_RS_SIZE",
|
||||
"Download $TX,"TempleOS V5.03",D="DD_OS_NAME_VERSION"$ - Standard RedSea Distro (%0.1fMB)",
|
||||
0.1*(10*Size(TOS_ISO_C_NAME,"+s")/1024/1024));
|
||||
Drv('C');
|
||||
}
|
||||
|
||||
U0 UltraDistroPrep()
|
||||
I64 UpdateLineCnts()
|
||||
{
|
||||
StdDistroPrep;
|
||||
DelTree(TOS_DISTRO_DIR "/Linux");
|
||||
Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C);
|
||||
Del(TOS_DISTRO_DIR "/Adam/AutoComplete/ACDefs.DATA*");
|
||||
Del(TOS_DISTRO_DIR "/Misc/PCIDevices.DD.Z");
|
||||
Del(TOS_DISTRO_DIR "/Misc/Bible.TXT.Z");
|
||||
I64 res;
|
||||
|
||||
DelTree(TOS_DISTRO_DIR "/Apps");
|
||||
DirMk(TOS_DISTRO_DIR "/Apps");
|
||||
DelTree(TOS_DISTRO_DIR "/Demo");
|
||||
DelTree(TOS_DISTRO_DIR "/Misc/Tour");
|
||||
Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C);
|
||||
Del(TOS_DISTRO_DIR "/Adam/AutoComplete/ACWords.DATA*");
|
||||
Del(TOS_DISTRO_DIR "/Adam/God/Vocab.DD.Z");
|
||||
Del(TOS_DISTRO_DIR "/Misc/OSTestSuite.HC.Z");
|
||||
Copy("C:/Home/Sup1/Sup1Distro/UltraMenu.DD.Z",
|
||||
TOS_DISTRO_DIR "/PersonalMenu.DD.Z");
|
||||
Copy("C:/Demo/Games/Talons.HC.Z",
|
||||
TOS_DISTRO_DIR "/Misc");
|
||||
}
|
||||
U0 MakeUltraDistro()
|
||||
{
|
||||
UltraDistroPrep;
|
||||
ISO9660ISO(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",,
|
||||
TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOS_ULTRA_SIZE",
|
||||
"Download $TX,"TempleOS V5.03",D="DD_OS_NAME_VERSION"$ - UltraSmall Distro (%0.2fMB)",
|
||||
0.01*(100*Size(TOS_ISO_NAME,"+s")/1024/1024));
|
||||
Drv('C');
|
||||
}
|
||||
U0 MakeUltraRedSeaDistro()
|
||||
{
|
||||
UltraDistroPrep;
|
||||
RedSeaISO(TOS_ISO_C_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
|
||||
DefinePrint("DD_TEMPLEOS_ULTRA_RS_SIZE",
|
||||
"Download $TX,"TempleOS V5.03",D="DD_OS_NAME_VERSION"$ - UltraSmall RedSea Distro (%0.2fMB)",
|
||||
0.01*(100*Size(TOS_ISO_C_NAME,"+s")/1024/1024));
|
||||
DocClear;
|
||||
Drv('C');
|
||||
DistroPrep;
|
||||
|
||||
Cd("C:/");
|
||||
DelTree("B:/TOS/TOS");
|
||||
CopyTree("C:/Home","B:/TOS/TOS");
|
||||
DelTree("C:/Home");
|
||||
|
||||
DocMax;
|
||||
DocClear;
|
||||
res=LineRep("C:/*","-r")+LineRep("C:/Adam/*")+
|
||||
LineRep("C:/Compiler/*","-S+$$")+LineRep("C:/Kernel/*");
|
||||
CopyTree("B:/TOS/TOS","C:/Home");
|
||||
DelTree("B:/TOS/TOS");
|
||||
|
||||
DocTreeFWrite("C:/Adam/ADefine.HC.Z","LineRep",
|
||||
"DefinePrint(\"DD_TEMPLEOS_LOC\",\"%,d\");\n",res);
|
||||
DefinePrint("DD_TEMPLEOS_LOC","%,d",res);
|
||||
|
||||
"Total LOC:%12,d\n\n",res;
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 UpdateISODocDefines()
|
||||
{
|
||||
try {
|
||||
#if MAKE_STD
|
||||
DefinePrint("DD_TEMPLEOSCD_SIZE",
|
||||
"Download $TX,"TempleOS V5.03",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)",
|
||||
0.1*(10*Size("D:/Wb/TempleOSCD.ISO","+s")/1024/1024));
|
||||
0.1*(10*Size("D:/TOS_Distro.ISO","+s")/1024/1024));
|
||||
DefinePrint("DD_TEMPLEOSCD_K_SIZE",
|
||||
"%dKB",Size("D:/Wb/TempleOSCD.ISO","+s")/1024);
|
||||
#endif
|
||||
#if MAKE_STD_RS
|
||||
DefinePrint("DD_TEMPLEOSCD_RS_SIZE",
|
||||
"Download $TX,"TempleOS V5.03",D="DD_OS_NAME_VERSION"$ - Standard RedSea Distro (%0.1fMB)",
|
||||
0.1*(10*Size("D:/Wb/TempleOSCDRS.ISO","+s")/1024/1024));
|
||||
DefinePrint("DD_TEMPLEOSCD_RS_K_SIZE",
|
||||
"%dKB",Size("D:/Wb/TempleOSCDRS.ISO","+s")/1024);
|
||||
#endif
|
||||
#if MAKE_ULTRA
|
||||
DefinePrint("DD_TEMPLEOS_ULTRA_SIZE",
|
||||
"Download $TX,"TempleOS V5.03",D="DD_OS_NAME_VERSION"$ - UltraSmall Distro (%0.2fMB)",
|
||||
0.01*(100*Size("D:/Wb/TempleOSUltra.ISO","+s")/1024/1024));
|
||||
DefinePrint("DD_TEMPLEOS_ULTRA_K_SIZE",
|
||||
"%dKB",Size("D:/Wb/TempleOSUltra.ISO","+s")/1024);
|
||||
#endif
|
||||
#if MAKE_ULTRA_RS
|
||||
DefinePrint("DD_TEMPLEOS_ULTRA_RS_SIZE",
|
||||
"Download $TX,"TempleOS V5.03",D="DD_OS_NAME_VERSION"$ - UltraSmall RedSea Distro (%0.2fMB)",
|
||||
0.01*(100*Size("D:/Wb/TempleOSUltraRS.ISO","+s")/1024/1024));
|
||||
DefinePrint("DD_TEMPLEOS_ULTRA_RS_K_SIZE",
|
||||
"%dKB",Size("D:/Wb/TempleOSUltraRS.ISO","+s")/1024);
|
||||
#endif
|
||||
"%dKB",Size("D:/TOS_Distro.ISO","+s")/1024);
|
||||
} catch
|
||||
Fs->catch_except=TRUE;
|
||||
}
|
||||
@@ -405,8 +239,7 @@ U0 TOSProgress(U8 *st)
|
||||
progress4=tos_progress;
|
||||
progress3_max=1;
|
||||
*progress4_desc=0;
|
||||
progress4_max=13+MAKE_STD+MAKE_STD_RS+MAKE_ULTRA+MAKE_ULTRA_RS+MAKE_SUP1+
|
||||
MAKE_WEB+MAKE_BOOKS1+MAKE_BOOKS2+MAKE_DBG+MAKE_STAFF+PROFANITY_CHK;
|
||||
progress4_max=8+MAKE_DBG+MAKE_STAFF;
|
||||
progress4_t0=tos_progress_t0;
|
||||
StrPrint(buf,"%d. %s",++progress4,st);
|
||||
"$$PURPLE$$$$TX+CX,\"%s\"$$$$FG$$\n",buf;
|
||||
@@ -414,31 +247,7 @@ U0 TOSProgress(U8 *st)
|
||||
tos_progress=progress4;
|
||||
}
|
||||
|
||||
I64 TOSProfanity()
|
||||
{
|
||||
I64 res;
|
||||
if (res=Profanity(,"D:/Wb/*;"
|
||||
"!*/Misc/PCIDevices.DD*;!*/Misc/Bible.TXT*;"
|
||||
"!*/Books?/*;!*/Sup1/Sup1Words/*;!*/Sup1/Sup1Blog/Profanity.DD*;"
|
||||
"!*/Sup1/Sup1Blog/NumBible.TXT*;!*/God/Vocab.DD*")) {
|
||||
while (PressAKey!=CH_SHIFT_ESC) {
|
||||
ProgressBarsRst;
|
||||
if (Profanity(,"C:/Home/*;"
|
||||
"!*/Misc/PCIDevices.DD*;!*/Misc/Bible.TXT*;"
|
||||
"!*/Books?/*;!*/Sup1/Sup1Words/*;!*/Sup1/Sup1Blog/Profanity.DD*;"
|
||||
"!*/Sup1/Sup1Blog/NumBible.TXT*;!*/God/Vocab.DD*")) {
|
||||
"\n\nEdit profanity and press $FG,2$ESC$FG$.\n";
|
||||
if (!View)
|
||||
break;
|
||||
DocBottom;
|
||||
} else
|
||||
break;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 TOSRegen3()
|
||||
U0 TOSRegen2()
|
||||
{
|
||||
I64 slash_home=0;
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
@@ -452,71 +261,31 @@ U0 TOSRegen3()
|
||||
WinMax;
|
||||
DskChkAll;
|
||||
|
||||
TOSProgress("Make LineRep");
|
||||
MakeLineRepFile;
|
||||
TOSProgress("Update Line Cnts");
|
||||
UpdateLineCnts;
|
||||
|
||||
TOSProgress("Copy C to D");
|
||||
TOSCopyDrv('C','D');
|
||||
|
||||
TOSProgress("Del D:/Wb");
|
||||
DelTree ("D:/Wb");
|
||||
|
||||
TOSProgress("Copy C to D:/Wb");
|
||||
CopyTree("C:/","D:/Wb");
|
||||
DocClear;
|
||||
|
||||
#if MAKE_STD
|
||||
TOSProgress("Make Standard Distro ISO");
|
||||
MakeStdDistro;
|
||||
DocClear;
|
||||
Move(TOS_ISO_NAME,"D:/Wb/TempleOSCD.ISO");
|
||||
#endif
|
||||
#if MAKE_STD_RS
|
||||
TOSProgress("Make Standard RedSea Distro ISO");
|
||||
MakeStdRedSeaDistro;
|
||||
DocClear;
|
||||
Move(TOS_ISO_C_NAME,"D:/Wb/TempleOSCDRS.ISO");
|
||||
#endif
|
||||
#if MAKE_ULTRA
|
||||
TOSProgress("Make Ultra Distro ISO");
|
||||
MakeUltraDistro;
|
||||
DocClear;
|
||||
Move(TOS_ISO_NAME,"D:/Wb/TempleOSUltra.ISO");
|
||||
#endif
|
||||
#if MAKE_ULTRA_RS
|
||||
TOSProgress("Make Ultra RedSea Distro ISO");
|
||||
MakeUltraRedSeaDistro;
|
||||
DocClear;
|
||||
Move(TOS_ISO_C_NAME,"D:/Wb/TempleOSUltraRS.ISO");
|
||||
#endif
|
||||
Move(TOS_ISO_NAME,"D:/TOS_Distro.ISO");
|
||||
|
||||
TOSProgress("Make Supplemental1 ISO");
|
||||
RedSeaISO("D:/TOS_Supplemental1","C:/Home/Sup1");
|
||||
|
||||
#if MAKE_DBG
|
||||
TOSProgress("Make Dbg Distro ISO");
|
||||
MakeDbgDistro;
|
||||
DocClear;
|
||||
Move(TOS_ISO_NAME,"D:/Wb/TempleOSDbg.ISO");
|
||||
Move(TOS_ISO_NAME,"D:/TOS_Dbg.ISO");
|
||||
#endif
|
||||
#if MAKE_STAFF
|
||||
TOSProgress("Make Staff Distro ISO");
|
||||
MakeStaffDistro;
|
||||
DocClear;
|
||||
Move(TOS_ISO_NAME,"D:/Wb/TempleOSStaff.ISO");
|
||||
#endif
|
||||
|
||||
#if MAKE_SUP1
|
||||
TOSProgress("Make Supplemental #1 ISO");
|
||||
RedSeaISO("D:/Wb/TempleOSSup1","C:/Home/Sup1");
|
||||
#endif
|
||||
#if MAKE_WEB
|
||||
TOSProgress("Make www.templeos.org ISO");
|
||||
RedSeaISO("D:/Wb/TempleOSWeb","C:/Home/Web");
|
||||
#endif
|
||||
#if MAKE_BOOKS1
|
||||
TOSProgress("Make Books #1 ISO");
|
||||
RedSeaISO("D:/Wb/TempleOSBooks1","C:/Home/Books1");
|
||||
#endif
|
||||
#if MAKE_BOOKS2
|
||||
TOSProgress("Make Books #2 ISO");
|
||||
RedSeaISO("D:/Wb/TempleOSBooks2","C:/Home/Books2");
|
||||
Move(TOS_ISO_NAME,"D:/TOS_Staff.ISO");
|
||||
#endif
|
||||
|
||||
UpdateISODocDefines;
|
||||
@@ -532,21 +301,6 @@ U0 TOSRegen3()
|
||||
if (LinkChk)
|
||||
throw;
|
||||
|
||||
DocClear;
|
||||
TOSProgress("Make Symbol Files");
|
||||
MakeSymFiles;
|
||||
|
||||
DocClear;
|
||||
TOSProgress("Freshen WebSite");
|
||||
FreshenSite;
|
||||
|
||||
#if PROFANITY_CHK
|
||||
DocClear;
|
||||
TOSProgress("Check WebSite for Profanity");
|
||||
if (TOSProfanity)
|
||||
throw;
|
||||
#endif
|
||||
|
||||
TOSProgress("Find /Home");
|
||||
slash_home=F2("/Home","-i+la");
|
||||
|
||||
@@ -563,53 +317,17 @@ U0 TOSRegen3()
|
||||
|
||||
public U0 TOSPreRegen()
|
||||
{//Copy bookmarks and bins from D:/Home/Sup1 to C:/Home/Sup1
|
||||
Copy("D:/Home/Private/*","C:/Home/Private");
|
||||
Copy("D:/Home/Sup1/Sup1Blog/Bookmarks.html","C:/Home/Sup1/Sup1Blog");
|
||||
Del("C:/Home/Sup1/Sup1Bin/*");
|
||||
Copy("D:/Home/Sup1/Sup1Bin/*","C:/Home/Sup1/Sup1Bin");
|
||||
Copy("D:/Home/" INS_REG_PERSONAL_INITIALS "/*",
|
||||
"C:/Home/" INS_REG_PERSONAL_INITIALS);
|
||||
DelTree("C:/Home/Sup1/Sup1Bin");
|
||||
CopyTree("D:/Home/Sup1/Sup1Bin","C:/Home/Sup1/Sup1Bin");
|
||||
Copy("D:/Home/Sup1/Sup1CodeScraps/Comm/TOSSocket*",
|
||||
"C:/Home/Sup1/Sup1CodeScraps/Comm");
|
||||
Copy("D:/Home/Sup1/Sup1Bin/God*","C:/Linux");
|
||||
}
|
||||
|
||||
public U0 TOSHomeIn()
|
||||
{//Copy D:/Home to C:/Home
|
||||
DelTree("C:/Home");
|
||||
CopyTree("D:/Home","C:/Home");
|
||||
}
|
||||
|
||||
public U0 TOSHomeOut()
|
||||
{//Copy C:/Home to D:/Home
|
||||
DelTree("D:/Home");
|
||||
CopyTree("C:/Home","D:/Home");
|
||||
}
|
||||
|
||||
public U0 TOSSongsIn()
|
||||
{//Copy songs from D:/Home/Sup1 to C:/Home/Sup1
|
||||
Del("C:/Home/Sup1/Sup1Hymns/*");
|
||||
Del("C:/Home/Sup1/Sup1Songs/*");
|
||||
Copy("D:/Home/Sup1/Sup1Hymns/*","C:/Home/Sup1/Sup1Hymns");
|
||||
Copy("D:/Home/Sup1/Sup1Songs/*","C:/Home/Sup1/Sup1Songs");
|
||||
}
|
||||
|
||||
public U0 TOSSongsOut()
|
||||
{//Copy songs from C:/Home/Sup1 to D:/Home/Sup1
|
||||
Del("D:/Home/Sup1/Sup1Hymns/*");
|
||||
Del("D:/Home/Sup1/Sup1Songs/*");
|
||||
Copy("C:/Home/Sup1/Sup1Hymns/*","D:/Home/Sup1/Sup1Hymns");
|
||||
Copy("C:/Home/Sup1/Sup1Songs/*","D:/Home/Sup1/Sup1Songs");
|
||||
}
|
||||
|
||||
U0 TOSRegen2()
|
||||
{
|
||||
TOSChgLog; //$LK,"::/Doc/ChgLog.DD"$ datetime matches Kernel $LK,"sys_compile_time",A="MN:sys_compile_time"$.
|
||||
TOSBootHDIns('C');
|
||||
Once("TOSRegen3;");
|
||||
BootRAM("C:/Kernel/" KERNEL_BIN_C); //Boot new Kernel and Compiler.
|
||||
}
|
||||
|
||||
public U0 TOSRegen()
|
||||
{//Generate distro ISO's and website image, D:/Wb.
|
||||
{//Generate distro ISO's
|
||||
TOSBootHDIns('C');
|
||||
Once("TOSRegen2;");
|
||||
BootRAM("C:/Kernel/" KERNEL_BIN_C); //Boot to load $LK,"TOS_CFG",A="PF:::/Demo/AcctExample/TOS/TOSCfg.HC,TOS_CFG"$.
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
class CRandExtDec5Form
|
||||
{
|
||||
I64 timestamp;
|
||||
U8 rnd0[512] fmtstr "$$DA-P,A=\"5 Decimal Digits from Hex:%s\"$$\n";
|
||||
U8 rnd0[512] format "$$DA-P,A=\"5 Decimal Digits from Hex:%s\"$$\n";
|
||||
U8 rnd1[512];
|
||||
U8 rnd2[512];
|
||||
U8 rnd3[512];
|
||||
@@ -39,43 +39,43 @@ class CRandExtDec5Form
|
||||
class CHexWordForm
|
||||
{
|
||||
I64 timestamp;
|
||||
U8 rnd0[512] fmtstr "$$DA-P,A=\"Hex Word Indices#0:%s\"$$\n";
|
||||
U8 rnd1[512] fmtstr "$$DA-P,A=\"Hex Word Indices#1:%s\"$$\n";
|
||||
U8 rnd2[512] fmtstr "$$DA-P,A=\"Hex Word Indices#2:%s\"$$\n";
|
||||
U8 rnd3[512] fmtstr "$$DA-P,A=\"Hex Word Indices#3:%s\"$$\n";
|
||||
U8 rnd4[512] fmtstr "$$DA-P,A=\"Hex Word Indices#4:%s\"$$\n";
|
||||
U8 rnd5[512] fmtstr "$$DA-P,A=\"Hex Word Indices#5:%s\"$$\n";
|
||||
U8 rnd6[512] fmtstr "$$DA-P,A=\"Hex Word Indices#6:%s\"$$\n";
|
||||
U8 rnd7[512] fmtstr "$$DA-P,A=\"Hex Word Indices#7:%s\"$$\n";
|
||||
U8 rnd8[512] fmtstr "$$DA-P,A=\"Hex Word Indices#8:%s\"$$\n";
|
||||
U8 rnd9[512] fmtstr "$$DA-P,A=\"Hex Word Indices#9:%s\"$$\n";
|
||||
U8 rndA[512] fmtstr "$$DA-P,A=\"Hex Word Indices#A:%s\"$$\n";
|
||||
U8 rndB[512] fmtstr "$$DA-P,A=\"Hex Word Indices#B:%s\"$$\n";
|
||||
U8 rnd0[512] format "$$DA-P,A=\"Hex Word Indices#0:%s\"$$\n";
|
||||
U8 rnd1[512] format "$$DA-P,A=\"Hex Word Indices#1:%s\"$$\n";
|
||||
U8 rnd2[512] format "$$DA-P,A=\"Hex Word Indices#2:%s\"$$\n";
|
||||
U8 rnd3[512] format "$$DA-P,A=\"Hex Word Indices#3:%s\"$$\n";
|
||||
U8 rnd4[512] format "$$DA-P,A=\"Hex Word Indices#4:%s\"$$\n";
|
||||
U8 rnd5[512] format "$$DA-P,A=\"Hex Word Indices#5:%s\"$$\n";
|
||||
U8 rnd6[512] format "$$DA-P,A=\"Hex Word Indices#6:%s\"$$\n";
|
||||
U8 rnd7[512] format "$$DA-P,A=\"Hex Word Indices#7:%s\"$$\n";
|
||||
U8 rnd8[512] format "$$DA-P,A=\"Hex Word Indices#8:%s\"$$\n";
|
||||
U8 rnd9[512] format "$$DA-P,A=\"Hex Word Indices#9:%s\"$$\n";
|
||||
U8 rndA[512] format "$$DA-P,A=\"Hex Word Indices#A:%s\"$$\n";
|
||||
U8 rndB[512] format "$$DA-P,A=\"Hex Word Indices#B:%s\"$$\n";
|
||||
I64 cert;
|
||||
};
|
||||
|
||||
class CNISTBeaconHexWordForm
|
||||
{
|
||||
I64 timestamp fmtstr "$$DA,A=\"TimeStamp:%d\"$$\n";
|
||||
U8 rnd0[512] fmtstr "$$DA-P,A=\"Hex Word Indices#0:%s\"$$\n";
|
||||
U8 rnd1[512] fmtstr "$$DA-P,A=\"Hex Word Indices#1:%s\"$$\n";
|
||||
U8 rnd2[512] fmtstr "$$DA-P,A=\"Hex Word Indices#2:%s\"$$\n";
|
||||
U8 rnd3[512] fmtstr "$$DA-P,A=\"Hex Word Indices#3:%s\"$$\n";
|
||||
U8 rnd4[512] fmtstr "$$DA-P,A=\"Hex Word Indices#4:%s\"$$\n";
|
||||
U8 rnd5[512] fmtstr "$$DA-P,A=\"Hex Word Indices#5:%s\"$$\n";
|
||||
U8 rnd6[512] fmtstr "$$DA-P,A=\"Hex Word Indices#6:%s\"$$\n";
|
||||
U8 rnd7[512] fmtstr "$$DA-P,A=\"Hex Word Indices#7:%s\"$$\n";
|
||||
U8 rnd8[512] fmtstr "$$DA-P,A=\"Hex Word Indices#8:%s\"$$\n";
|
||||
U8 rnd9[512] fmtstr "$$DA-P,A=\"Hex Word Indices#9:%s\"$$\n";
|
||||
U8 rndA[512] fmtstr "$$DA-P,A=\"Hex Word Indices#A:%s\"$$\n";
|
||||
U8 rndB[512] fmtstr "$$DA-P,A=\"Hex Word Indices#B:%s\"$$\n";
|
||||
I64 timestamp format "$$DA,A=\"TimeStamp:%d\"$$\n";
|
||||
U8 rnd0[512] format "$$DA-P,A=\"Hex Word Indices#0:%s\"$$\n";
|
||||
U8 rnd1[512] format "$$DA-P,A=\"Hex Word Indices#1:%s\"$$\n";
|
||||
U8 rnd2[512] format "$$DA-P,A=\"Hex Word Indices#2:%s\"$$\n";
|
||||
U8 rnd3[512] format "$$DA-P,A=\"Hex Word Indices#3:%s\"$$\n";
|
||||
U8 rnd4[512] format "$$DA-P,A=\"Hex Word Indices#4:%s\"$$\n";
|
||||
U8 rnd5[512] format "$$DA-P,A=\"Hex Word Indices#5:%s\"$$\n";
|
||||
U8 rnd6[512] format "$$DA-P,A=\"Hex Word Indices#6:%s\"$$\n";
|
||||
U8 rnd7[512] format "$$DA-P,A=\"Hex Word Indices#7:%s\"$$\n";
|
||||
U8 rnd8[512] format "$$DA-P,A=\"Hex Word Indices#8:%s\"$$\n";
|
||||
U8 rnd9[512] format "$$DA-P,A=\"Hex Word Indices#9:%s\"$$\n";
|
||||
U8 rndA[512] format "$$DA-P,A=\"Hex Word Indices#A:%s\"$$\n";
|
||||
U8 rndB[512] format "$$DA-P,A=\"Hex Word Indices#B:%s\"$$\n";
|
||||
I64 cert;
|
||||
};
|
||||
|
||||
class CRandHex5Form
|
||||
{
|
||||
I64 timestamp;
|
||||
U8 rnd0[512] fmtstr "$$DA-P-TRM,LEN=5,"
|
||||
U8 rnd0[512] format "$$DA-P-TRM,LEN=5,"
|
||||
"A=\"Line (5-Digit Hex):%5s\"$$\n";
|
||||
U8 rnd1[512];
|
||||
U8 rnd2[512];
|
||||
@@ -94,7 +94,7 @@ class CRandHex5Form
|
||||
class CRandHex8Form
|
||||
{
|
||||
I64 timestamp;
|
||||
U8 rnd0[512] fmtstr "$$DA-P-TRM,LEN=8,"
|
||||
U8 rnd0[512] format "$$DA-P-TRM,LEN=8,"
|
||||
"A=\"Line (8-Digit Hex):%8s\"$$\n";
|
||||
U8 rnd1[512];
|
||||
U8 rnd2[512];
|
||||
@@ -113,7 +113,7 @@ class CRandHex8Form
|
||||
class CMoviesForm
|
||||
{
|
||||
I64 timestamp;
|
||||
U8 rnd0[512] fmtstr "$$DA-P,"
|
||||
U8 rnd0[512] format "$$DA-P,"
|
||||
"A=\"Movie #1-100 (2 Decimal Digits from Hex):%s\"$$\n";
|
||||
U8 rnd1[512];
|
||||
U8 rnd2[512];
|
||||
@@ -132,7 +132,7 @@ class CMoviesForm
|
||||
class CPaintings100Form
|
||||
{
|
||||
I64 timestamp;
|
||||
U8 rnd0[512] fmtstr "$$DA-P,"
|
||||
U8 rnd0[512] format "$$DA-P,"
|
||||
"A=\"Painting #00-99 (2 Decimal Digits from Hex):%s\"$$\n";
|
||||
U8 rnd1[512];
|
||||
U8 rnd2[512];
|
||||
@@ -151,7 +151,7 @@ class CPaintings100Form
|
||||
class CPaintings1000Form
|
||||
{
|
||||
I64 timestamp;
|
||||
U8 rnd0[512] fmtstr "$$DA-P,"
|
||||
U8 rnd0[512] format "$$DA-P,"
|
||||
"A=\"Painting #000-999 (3 Decimal Digits from Hex):%s\"$$\n";
|
||||
U8 rnd1[512];
|
||||
U8 rnd2[512];
|
||||
@@ -170,7 +170,7 @@ class CPaintings1000Form
|
||||
class CPoems100Form
|
||||
{
|
||||
I64 timestamp;
|
||||
U8 rnd0[512] fmtstr "$$DA-P,"
|
||||
U8 rnd0[512] format "$$DA-P,"
|
||||
"A=\"Poems #00-99 (2 Decimal Digits from Hex):%s\"$$\n";
|
||||
U8 rnd1[512];
|
||||
U8 rnd2[512];
|
||||
@@ -189,7 +189,7 @@ class CPoems100Form
|
||||
class CMetallicaForm
|
||||
{
|
||||
I64 timestamp;
|
||||
U8 rnd0[512] fmtstr "$$DA-P,"
|
||||
U8 rnd0[512] format "$$DA-P,"
|
||||
"A=\"Song #1-99 (2 Decimal Digits from Hex):%s\"$$\n";
|
||||
U8 rnd1[512];
|
||||
U8 rnd2[512];
|
||||
@@ -208,7 +208,7 @@ class CMetallicaForm
|
||||
class CCertRandDec5Form
|
||||
{
|
||||
I64 timestamp;
|
||||
U8 rnd0[512] fmtstr "$$DA-P,A=\"Line (Dec):%s\"$$\n";
|
||||
U8 rnd0[512] format "$$DA-P,A=\"Line (Dec):%s\"$$\n";
|
||||
U8 rnd1[512];
|
||||
U8 rnd2[512];
|
||||
U8 rnd3[512];
|
||||
@@ -220,57 +220,83 @@ class CCertRandDec5Form
|
||||
U8 rnd9[512];
|
||||
U8 rndA[512];
|
||||
U8 rndB[512];
|
||||
I64 cert fmtstr "$$DA,A=\"Certificate:%d\"$$\n";
|
||||
I64 cert format "$$DA,A=\"Certificate:%d\"$$\n";
|
||||
};
|
||||
|
||||
class CGodVideoForm
|
||||
{
|
||||
U8 title[STR_LEN] fmtstr "$$DA-P,A=\"Title:%s\"$$\n";
|
||||
U8 serial[STR_LEN] fmtstr "$$DA-P-TRM,LEN=11,A=\"SerialNum:%11s\"$$\n";
|
||||
I64 min fmtstr "$$DA,A=\"Minutes:%d\"$$\n";
|
||||
I64 sec fmtstr "$$DA,A=\"Seconds:%d\"$$\n";
|
||||
U8 title[STR_LEN] format "$$DA-P,A=\"Title:%s\"$$\n";
|
||||
U8 serial[STR_LEN] format "$$DA-P-TRM,LEN=11,A=\"SerialNum:%11s\"$$\n";
|
||||
I64 min format "$$DA,A=\"Minutes:%d\"$$\n";
|
||||
I64 sec format "$$DA,A=\"Seconds:%d\"$$\n";
|
||||
};
|
||||
|
||||
class CWebBibleForm
|
||||
{
|
||||
U8 tag[STR_LEN] fmtstr "$$DA-P,A=\"Tag Text:%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,A=\"Bible Passage:%s\"$$\n";
|
||||
U8 tag[STR_LEN] format "$$DA-P,A=\"Tag Text:%s\"$$\n";
|
||||
U8 special[STR_LEN] format "$$DA-P,A=\"Bible Passage:%s\"$$\n";
|
||||
I64 min;
|
||||
I64 sec;
|
||||
};
|
||||
|
||||
class CYouTubeForm
|
||||
{
|
||||
U8 tag[STR_LEN] fmtstr "$$DA-P,A=\"Title:%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P-TRM,LEN=11,A=\"SerialNum:%11s\"$$\n";
|
||||
I64 min fmtstr "$$DA,A=\"Minutes:%d\"$$\n";
|
||||
I64 sec fmtstr "$$DA,A=\"Seconds:%d\"$$\n";
|
||||
U8 tag[STR_LEN] format "$$DA-P,A=\"Title:%s\"$$\n";
|
||||
U8 special[STR_LEN] format "$$DA-P-TRM,LEN=11,A=\"SerialNum:%11s\"$$\n";
|
||||
I64 min format "$$DA,A=\"Minutes:%d\"$$\n";
|
||||
I64 sec format "$$DA,A=\"Seconds:%d\"$$\n";
|
||||
};
|
||||
|
||||
class CImgurForm
|
||||
{
|
||||
U8 tag[STR_LEN];
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,A=\"SerialNum:%s\"$$\n";
|
||||
I64 min fmtstr "$$DA,A=\"Width :%d\"$$\n";
|
||||
I64 sec fmtstr "$$DA,A=\"Height :%d\"$$\n";
|
||||
U8 special[STR_LEN] format "$$DA-P,A=\"SerialNum:%s\"$$\n";
|
||||
I64 min format "$$DA,A=\"Width :%d\"$$\n";
|
||||
I64 sec format "$$DA,A=\"Height :%d\"$$\n";
|
||||
};
|
||||
|
||||
class CWikipediaForm
|
||||
{
|
||||
U8 tag[STR_LEN] fmtstr "$$DA-P,A=\"Tag Text:%s\"$$\n";
|
||||
U8 special[STR_LEN] fmtstr "$$DA-P,A=\"Index :%s\"$$\n";
|
||||
U8 tag[STR_LEN] format "$$DA-P,A=\"Tag Text:%s\"$$\n";
|
||||
U8 special[STR_LEN] format "$$DA-P,A=\"Index :%s\"$$\n";
|
||||
I64 min;
|
||||
I64 sec;
|
||||
};
|
||||
|
||||
class CWebBookMarkForm
|
||||
{
|
||||
U8 tag[STR_LEN] fmtstr "$$DA-P,A=\"Tag Text:%s\"$$\n";
|
||||
U8 tag[STR_LEN] format "$$DA-P,A=\"Tag Text:%s\"$$\n";
|
||||
U8 special[STR_LEN];
|
||||
I64 min;
|
||||
I64 sec;
|
||||
};
|
||||
|
||||
DefineLstLoad("ST_FAMLY_PHOTOS","Family1_58-78\0Family2_78-86\0"
|
||||
"Family3_86-99\0Family4_99\0");
|
||||
|
||||
class CFamilyPhotoForm
|
||||
{
|
||||
I64 volume format "$$LS,D=\"ST_FAMLY_PHOTOS\"$$\n";
|
||||
I64 part format "$$DA,A=\"Part :%d\"$$\n";
|
||||
U8 picture[STR_LEN] format "$$DA-P,A=\"Picture:%s\"$$\n";
|
||||
I64 width format "$$GREEN$$640x427 or 640x960$$FG$$\n"
|
||||
"$$DA,A=\"Width :%d\"$$\n";
|
||||
I64 height format "$$DA,A=\"Height :%d\"$$\n";
|
||||
};
|
||||
|
||||
class CBlogImgForm
|
||||
{
|
||||
U8 picture[STR_LEN] format "$$DA-P,A=\"Picture:%s\"$$\n";
|
||||
I64 width format "$$DA,A=\"Width :%d\"$$\n";
|
||||
I64 height format "$$DA,A=\"Height :%d\"$$\n";
|
||||
};
|
||||
|
||||
class CBlogVideoForm
|
||||
{
|
||||
U8 video[STR_LEN] format "$$DA-P,A=\"Video:%s\"$$\n";
|
||||
Bool big format "$$CB,\"Big\"$$\n";
|
||||
};
|
||||
|
||||
extern U0 FreshenBlog();
|
||||
extern U0 GodBooksPassageU32(U32 rand_u32,U8 *files_find_mask,
|
||||
U8 *file_mask="*",I64 len=512,I64 verbosity=GBP_MEDIUM);
|
||||
|
||||
@@ -1,701 +0,0 @@
|
||||
#help_index "Misc/TOS/God;God/TOS"
|
||||
|
||||
U8 *URLPercentSpaces(U8 *src)
|
||||
{
|
||||
U8 buf[2048],*dst=buf;
|
||||
while (*src) {
|
||||
if (*src==CH_SPACE) {
|
||||
*dst++='%';
|
||||
*dst++='2';
|
||||
*dst++='0';
|
||||
src++;
|
||||
} else
|
||||
*dst++=*src++;
|
||||
}
|
||||
*dst=0;
|
||||
return StrNew(buf);
|
||||
}
|
||||
|
||||
U8 *URLPlusSpaces(U8 *src)
|
||||
{
|
||||
U8 buf[2048],*dst=buf;
|
||||
while (*src) {
|
||||
if (*src==CH_SPACE) {
|
||||
*dst++='+';
|
||||
src++;
|
||||
} else
|
||||
*dst++=*src++;
|
||||
}
|
||||
*dst=0;
|
||||
return StrNew(buf);
|
||||
}
|
||||
|
||||
I64 ExtDecFromHex(U8 *st,I64 digits)
|
||||
{
|
||||
I64 res=0,ch;
|
||||
while (digits) {
|
||||
if (!(ch=*st++))
|
||||
break;
|
||||
if ('0'<=ch<='9') {
|
||||
res=10*res+ch-'0';
|
||||
digits--;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 TOSBookLines(U8 *book_filename,I64 book_lines,U8 *st,I64 num_lines,
|
||||
I64 radix,Bool modulo,Bool plus_one)
|
||||
{//Radix<0 means extract N dec digits from hex.
|
||||
CDoc *doc_out,*doc_in;
|
||||
CDocEntry *doc_e;
|
||||
I64 i,start;
|
||||
U8 *verse;
|
||||
if (*st && (doc_out=DocPut)) {
|
||||
if (radix<0)
|
||||
i=ExtDecFromHex(st,-radix);
|
||||
else
|
||||
i=Str2I64(st,radix);
|
||||
if (radix<0)
|
||||
DocPrint(doc_out,"'%s'-->(Taking first %d decimal digits)",st,-radix);
|
||||
else if (radix==16)
|
||||
DocPrint(doc_out,"0x%s-->",st);
|
||||
if (modulo) {
|
||||
DocPrint(doc_out,"(%d remainder when divided by %d)",
|
||||
i,book_lines-(num_lines-1));
|
||||
start=i%(book_lines-(num_lines-1));
|
||||
} else {
|
||||
if (radix>=0 || plus_one)
|
||||
DocPrint(doc_out,"%d",i);
|
||||
start=i;
|
||||
}
|
||||
if (plus_one) {
|
||||
start++;
|
||||
DocPrint(doc_out,"+1");
|
||||
}
|
||||
DocPrint(doc_out,"-->Line:%d\n",start);
|
||||
|
||||
if (StrMatch("NumBible",book_filename)) {
|
||||
verse=BibleLine2Verse(start);
|
||||
DocPrint(doc_out,"$TX,"KingJamesBible",HTML="http://www.templeos.org/Wb/Home/Sup1/Sup1Blog/NumBible.TXT"$ (%s)\n\nGod says...\n$$RED$$",verse);
|
||||
Free(verse);
|
||||
}
|
||||
|
||||
doc_in=DocNew;
|
||||
BookLines(doc_in,start,num_lines,book_filename);
|
||||
while (TRUE) {//Del leading blanks
|
||||
doc_e=doc_in->head.next;
|
||||
if (doc_e==doc_in)
|
||||
break;
|
||||
else {
|
||||
if (doc_e->type_u8==DOCT_NEW_LINE)
|
||||
DocEntryDel(doc_in,doc_e);
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (TRUE) {//Del trailing blanks
|
||||
doc_e=doc_in->cur_entry->last;
|
||||
if (doc_e==doc_in)
|
||||
break;
|
||||
else {
|
||||
if (doc_e->type_u8==DOCT_NEW_LINE)
|
||||
DocEntryDel(doc_in,doc_e);
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
DocPrint(doc_in,"$$FG$$\n");
|
||||
DocInsDoc(doc_out,doc_in);
|
||||
DocDel(doc_in);
|
||||
}
|
||||
}
|
||||
|
||||
public U0 GodBooksPassageU32(U32 rand_u32,U8 *files_find_mask,
|
||||
U8 *file_mask="*",I64 len=512,I64 verbosity=GBP_MEDIUM)
|
||||
{//Make God pick a book passage. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.DD"$
|
||||
CDirEntry *tmpde=FilesFind(files_find_mask,
|
||||
FUF_RECURSE|FUF_JUST_FILES|FUF_JUST_TXT),
|
||||
*tmpde1,*tmpde2,**tmpde3;
|
||||
I64 i=0;
|
||||
U8 *st,*st2=NULL;
|
||||
|
||||
tmpde3=&tmpde2;
|
||||
tmpde2=NULL;
|
||||
while (tmpde) {
|
||||
tmpde1=tmpde->next;
|
||||
if (WildMatch(tmpde->full_name,file_mask)) {
|
||||
*tmpde3=tmpde;
|
||||
tmpde3=&tmpde->next;
|
||||
} else
|
||||
DirEntryDel(tmpde);
|
||||
tmpde=tmpde1;
|
||||
}
|
||||
*tmpde3=NULL;
|
||||
|
||||
if (tmpde=tmpde2) {
|
||||
while (tmpde) {
|
||||
st=FileRead(tmpde->full_name);
|
||||
tmpde->user_data=StrLen(st);
|
||||
if (verbosity==GBP_LONG)
|
||||
"%08X-",i;
|
||||
if (tmpde->user_data>=len)
|
||||
i+=tmpde->user_data+1-len;
|
||||
if (verbosity==GBP_LONG)
|
||||
"%08X:$$LK,\"%s\",A=\"FI:%s\"$$\n",
|
||||
i-1,tmpde->full_name+2,tmpde->full_name;
|
||||
Free(st);
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
if (verbosity==GBP_LONG)
|
||||
'\n';
|
||||
if (verbosity>=GBP_MEDIUM)
|
||||
"%08X*%08X",rand_u32,i;
|
||||
i*=rand_u32;
|
||||
if (verbosity>=GBP_MEDIUM)
|
||||
"=%08X.%08X\n",i.u32[1],i.u32[0];
|
||||
i=i.u32[1];
|
||||
|
||||
tmpde=tmpde2;
|
||||
while (tmpde) {
|
||||
if (!st2 && tmpde->user_data>=len) {
|
||||
i-=tmpde->user_data+1-len;
|
||||
if (i<0) {
|
||||
st=FileRead(tmpde->full_name);
|
||||
st2=st+(tmpde->user_data+1-len)+i;
|
||||
st2[len]=0;
|
||||
"%s\nGod says...\n$$RED$$%s$$FG$$\n",tmpde->full_name,st2;
|
||||
Free(st);
|
||||
}
|
||||
}
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirTreeDel(tmpde2);
|
||||
}
|
||||
}
|
||||
|
||||
U0 GodVideoDigits(U8 *title,U8 *webpage,U8 *rnd,I64 digits,U8 *filename)
|
||||
{
|
||||
U8 *st,*st2;
|
||||
CGodVideoForm *gvf=CAlloc(sizeof(CGodVideoForm));
|
||||
I64 i=ExtDecFromHex(rnd,digits);
|
||||
if (!i) i=Round(10`digits);
|
||||
if (st=DocLineRead(filename,i*2+1)) {
|
||||
StrCpy(gvf->title,st);
|
||||
Free(st);
|
||||
if (!(st=DocLineRead(filename,i*2+2))||!*st) {
|
||||
Free(st);
|
||||
if (DocForm(gvf) && *gvf->serial) {
|
||||
if (gvf->min || gvf->sec)
|
||||
st=MStrPrint("%s&hl=enUS&start=%d",
|
||||
gvf->serial,gvf->min*60+gvf->sec);
|
||||
else
|
||||
st=StrNew(gvf->serial);
|
||||
DocLineWrite(filename,i*2+2,st);
|
||||
} else
|
||||
st=NULL;
|
||||
}
|
||||
"'%s'-->(Taking first %d decimal digits) #%02d\n",rnd,digits,i;
|
||||
if (StrIMatch("Metallica",filename)) {
|
||||
st2=URLPlusSpaces(gvf->title+3);
|
||||
"God's response:\n"
|
||||
"$$TX,\"%s\",HTML=\"%s\"$$\n"
|
||||
"$$TX,\"%s (Lyrics)\","
|
||||
"HTML=\"http://lmgtfy.com/?q=Metallica+lyrics+%s\"$$\n",
|
||||
title,webpage,gvf->title,st2;
|
||||
Free(st2);
|
||||
} else
|
||||
"God's response:\n"
|
||||
"$$TX,\"%s\",HTML=\"%s\"$$\n"
|
||||
"#%s\n",title,webpage,gvf->title;
|
||||
if (st) {
|
||||
"$$HC,\"<object width=\\\"640\\\" height=\\\"520\\\">"
|
||||
"<param name=\\\"movie\\\" "
|
||||
"value=\\\"http://www.youtube.com/v/%s\\\"></param><param "
|
||||
"name=\\\"allowscriptaccess\\\" "
|
||||
"value=\\\"always\\\"></param><embed "
|
||||
"src=\\\"http://www.youtube.com/v/%s\\\" "
|
||||
"type=\\\"application/x-shockwave-flash\\\" "
|
||||
"allowscriptaccess=\\\"always\\\" "
|
||||
"width=\\\"640\\\" height=\\\"520\\\">"
|
||||
"</embed></object>\"$$\n",st,st;
|
||||
Free(st);
|
||||
}
|
||||
}
|
||||
Free(gvf);
|
||||
}
|
||||
|
||||
U0 GodVideoU32(U32 rand_u32,U8 *filename)
|
||||
{
|
||||
U8 *st,*st2;
|
||||
I64 i,num;
|
||||
Bool old_silent=Silent;
|
||||
num=LineRep(filename,"-S")/2;
|
||||
Silent(old_silent);
|
||||
if (num) {
|
||||
i=rand_u32%num;
|
||||
if (st=DocLineRead(filename,i*2+1)) {
|
||||
st2=DocLineRead(filename,i*2+2);
|
||||
PutFileLink(filename);
|
||||
"\nGod's response:\n"
|
||||
"%08X-->#%d out of %d\n%s\n",rand_u32,i,num,st;
|
||||
"$$HC,\"<object width=\\\"640\\\" height=\\\"520\\\">"
|
||||
"<param name=\\\"movie\\\" "
|
||||
"value=\\\"http://www.youtube.com/v/%s\\\"></param><param "
|
||||
"name=\\\"allowscriptaccess\\\" "
|
||||
"value=\\\"always\\\"></param><embed "
|
||||
"src=\\\"http://www.youtube.com/v/%s\\\" "
|
||||
"type=\\\"application/x-shockwave-flash\\\" "
|
||||
"allowscriptaccess=\\\"always\\\" "
|
||||
"width=\\\"640\\\" height=\\\"520\\\">"
|
||||
"</embed></object>\"$$\n",st2,st2;
|
||||
Free(st2);
|
||||
Free(st);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
U0 GodWebIdx(U8 *title,U8 *webpage,U8 *rnd,I64 digits,U8 *filename)
|
||||
{
|
||||
U8 *st1,*st2;
|
||||
I64 i=ExtDecFromHex(rnd,digits);
|
||||
if (!i) i=Round(10`digits);
|
||||
"'%s'-->(Taking first %d decimal digits) #%02d\n",rnd,digits,i;
|
||||
st1=DocLineRead(filename,i*2+1);
|
||||
st2=DocLineRead(filename,i*2+2);
|
||||
"God's response:\n";
|
||||
"$$TX,\"%s\",HTML=\"%s\"$$\n",title,webpage;
|
||||
PutFileLink(filename);
|
||||
if (!st1)
|
||||
"\n$$RED$$God does not want to comment.$$FG$$\n";
|
||||
else
|
||||
"\n$$RED$$$$TX,\"%s\",HTML=\"%s\"$$$$FG$$\n",st1,st2;
|
||||
Free(st1);
|
||||
Free(st2);
|
||||
}
|
||||
|
||||
U0 GodWordBatch(CHexWordForm *gm,I64 radix,I64 digits)
|
||||
{//Insert batch of words from rand hex.
|
||||
I64 i=0,j,k,min;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
U8 *filename;
|
||||
|
||||
FifoU8Flush(god.fifo);
|
||||
GodHexIns(gm->rnd0);
|
||||
GodHexIns(gm->rnd1);
|
||||
GodHexIns(gm->rnd2);
|
||||
GodHexIns(gm->rnd3);
|
||||
GodHexIns(gm->rnd4);
|
||||
GodHexIns(gm->rnd5);
|
||||
GodHexIns(gm->rnd6);
|
||||
GodHexIns(gm->rnd7);
|
||||
GodHexIns(gm->rnd8);
|
||||
GodHexIns(gm->rnd9);
|
||||
GodHexIns(gm->rndA);
|
||||
GodHexIns(gm->rndB);
|
||||
|
||||
if (radix==16) {
|
||||
tmpde=tmpde1=FilesFind(god.word_file_mask,god.word_fuf_flags);
|
||||
while (tmpde) {
|
||||
PutFileLink(tmpde->full_name);
|
||||
'\n';
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirTreeDel(tmpde1);
|
||||
} else {
|
||||
if (digits==3)
|
||||
filename="::/Home/Sup1/Sup1Blog/NumWords1000.TXT";
|
||||
else
|
||||
filename="::/Home/Sup1/Sup1Blog/NumWords10k.TXT";
|
||||
PutFileLink(filename);
|
||||
'\n';
|
||||
}
|
||||
|
||||
"\n$$RED$$";
|
||||
if (*gm->rnd0)
|
||||
"%s\n",gm->rnd0;
|
||||
if (*gm->rnd1)
|
||||
"%s\n",gm->rnd1;
|
||||
if (*gm->rnd2)
|
||||
"%s\n",gm->rnd2;
|
||||
if (*gm->rnd3)
|
||||
"%s\n",gm->rnd3;
|
||||
if (*gm->rnd4)
|
||||
"%s\n",gm->rnd4;
|
||||
if (*gm->rnd5)
|
||||
"%s\n",gm->rnd5;
|
||||
if (*gm->rnd6)
|
||||
"%s\n",gm->rnd6;
|
||||
if (*gm->rnd7)
|
||||
"%s\n",gm->rnd7;
|
||||
if (*gm->rnd8)
|
||||
"%s\n",gm->rnd8;
|
||||
if (*gm->rnd9)
|
||||
"%s\n",gm->rnd9;
|
||||
if (*gm->rndA)
|
||||
"%s\n",gm->rndA;
|
||||
if (*gm->rndB)
|
||||
"%s\n",gm->rndB;
|
||||
'\n';
|
||||
if (radix==16)
|
||||
min=digits*4;
|
||||
else
|
||||
min=4;
|
||||
while (FifoU8Cnt(god.fifo)>=min) {
|
||||
if (radix==16) {
|
||||
j=GodBits(digits*4);
|
||||
if (god.num_words) {
|
||||
"%02d: %0*X Mod %0*X = %0*X (Line:%0*d):",i++,
|
||||
digits,j,digits,god.num_words,digits,j%god.num_words,
|
||||
ToI64(Log10(god.num_words)+1),j%god.num_words+1;
|
||||
"%s\n",god.words[j%god.num_words];
|
||||
}
|
||||
} else {
|
||||
i=digits;
|
||||
j=0;
|
||||
do {
|
||||
k=GodBits(4);
|
||||
if (k<=9) {
|
||||
j=j*10+k;
|
||||
if (!--i) {
|
||||
"%s\n",DocLineRead(filename,j+1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while (FifoU8Cnt(god.fifo)>=4);
|
||||
}
|
||||
}
|
||||
FifoU8Flush(god.fifo);
|
||||
"$$FG$$\n";
|
||||
}
|
||||
|
||||
U0 TOSGodDoodle(I64 god_src,CNISTBeaconHexWordForm *gm=NULL)
|
||||
{
|
||||
CDC *dc;
|
||||
Bool old_silent;
|
||||
U8 *elems,*hex=CAlloc(sizeof(CNISTBeaconHexWordForm.rnd0)*12);
|
||||
if (gm) {
|
||||
StrPrint(hex,"%s%s",gm->rnd0,gm->rnd1);
|
||||
if (god_src==GSRC_NIST_BEACON) {
|
||||
gm->timestamp=FloorI64(CDate2Unix(Now),60);
|
||||
if (DocForm(gm(CNISTBeaconHexWordForm *)))
|
||||
NISTBeaconURL(gm->timestamp);
|
||||
else
|
||||
goto gd_done;
|
||||
}
|
||||
CatPrint(hex,"%s%s",gm->rnd2,gm->rnd3);
|
||||
if (god_src==GSRC_NIST_BEACON) {
|
||||
gm->timestamp=FloorI64(CDate2Unix(Now),60);
|
||||
if (DocForm(gm(CNISTBeaconHexWordForm *)))
|
||||
NISTBeaconURL(gm->timestamp);
|
||||
else
|
||||
goto gd_done;
|
||||
}
|
||||
CatPrint(hex,"%s%s",gm->rnd4,gm->rnd5);
|
||||
if (god_src==GSRC_NIST_BEACON) {
|
||||
gm->timestamp=FloorI64(CDate2Unix(Now),60);
|
||||
if (DocForm(gm(CNISTBeaconHexWordForm *)))
|
||||
NISTBeaconURL(gm->timestamp);
|
||||
else
|
||||
goto gd_done;
|
||||
}
|
||||
CatPrint(hex,"%s%s",gm->rnd6,gm->rnd7);
|
||||
if (god_src==GSRC_NIST_BEACON) {
|
||||
gm->timestamp=FloorI64(CDate2Unix(Now),60);
|
||||
if (DocForm(gm(CNISTBeaconHexWordForm *)))
|
||||
NISTBeaconURL(gm->timestamp);
|
||||
else
|
||||
goto gd_done;
|
||||
}
|
||||
CatPrint(hex,"%s%s",gm->rnd8,gm->rnd9);
|
||||
if (god_src==GSRC_NIST_BEACON) {
|
||||
gm->timestamp=FloorI64(CDate2Unix(Now),60);
|
||||
if (DocForm(gm(CNISTBeaconHexWordForm *)))
|
||||
NISTBeaconURL(gm->timestamp);
|
||||
else
|
||||
goto gd_done;
|
||||
}
|
||||
CatPrint(hex,"%s%s",gm->rndA,gm->rndB);
|
||||
}
|
||||
if (elems=GodDoodleSprite(hex)) {
|
||||
dc=Sprite2DC(elems);
|
||||
BlogDCImgWrite(dc);
|
||||
DCDel(dc);
|
||||
Free(elems);
|
||||
old_silent=Silent;
|
||||
FreshenBlog;
|
||||
Silent(old_silent);
|
||||
}
|
||||
gd_done:
|
||||
Free(hex);
|
||||
}
|
||||
|
||||
I64 GodHeaderIns(U8 *type=NULL)
|
||||
{
|
||||
CDateStruct ds;
|
||||
I64 res;
|
||||
if (type) {//If NISTBeacon
|
||||
res=FloorI64(CDate2Unix(Now+1*60*CDATE_FREQ),60);
|
||||
Date2Struct(&ds,Unix2CDate(res)+local_time_offset+30*CDATE_FREQ);
|
||||
"Response of %s at %02d:%02d Timestamp:%d.\n\n",type,ds.hour,ds.min,res;
|
||||
In("%c//Response of %s at %02d:%02d Timestamp:%d.\n\n",
|
||||
CH_ESC,type,ds.hour,ds.min,res);
|
||||
}
|
||||
"$$TX,\"Guidelines for Talking with God.\","
|
||||
"HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n";
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 TimerGodIns()
|
||||
{
|
||||
U8 buf[STR_LEN];
|
||||
GodHeaderIns;
|
||||
FifoU8Flush(god.fifo);
|
||||
GodBitsIns(GOD_GOOD_BITS,KbdMsEvtTime>>GOD_BAD_BITS);
|
||||
switch (PopUpPickLst("Hex5Bible\0Hex8Books\0Doodle\0Movie100\0Painting100\0"
|
||||
"Painting1000\0Poems100\0Metallica\0")) {
|
||||
case:
|
||||
StrPrint(buf,"%05X",GodBits(5*4));
|
||||
"$$TX,\"How this random Bible passage was chosen.\","
|
||||
"HTML=\"http://www.templeos.org/Wb"
|
||||
"/Home/Web/TAD/Passage.html\"$$\n";
|
||||
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
|
||||
buf,20,16,TRUE,TRUE);
|
||||
break;
|
||||
case:
|
||||
GodBooksPassageU32(GodBits(32),"~/*","C:/Home/Books?/*",,GBP_SHORT);
|
||||
break;
|
||||
case:
|
||||
TOSGodDoodle(GSRC_TIMER);
|
||||
break;
|
||||
case:
|
||||
StrPrint(buf,"%05X",GodBits(2*5*4)); //Little bit risky if no dec.
|
||||
GodVideoDigits("Top 100 Movies",
|
||||
"http://www.afi.com/100years/movies10.aspx",
|
||||
buf,2,"~/Sup1/Sup1Blog/Movies100.DD.Z");
|
||||
break;
|
||||
case:
|
||||
StrPrint(buf,"%05X",GodBits(2*5*4)); //Little bit risky if no dec.
|
||||
GodWebIdx("Top 100 Paintings",
|
||||
"http://www.brushwiz.com/most-famous-paintings",
|
||||
buf,2,"~/Sup1/Sup1Blog/Paintings100.DD.Z");
|
||||
break;
|
||||
case:
|
||||
StrPrint(buf,"%05X",GodBits(2*5*4)); //Little bit risky if no dec.
|
||||
GodWebIdx("Top 1000 Paintings",
|
||||
"http://en.most-famous-paintings.com/MostFamousPaintings."
|
||||
"nsf/ListOfTop1000MostPopularPainting",
|
||||
buf,3,"~/Sup1/Sup1Blog/Paintings1000.DD.Z");
|
||||
break;
|
||||
case:
|
||||
StrPrint(buf,"%05X",GodBits(2*5*4)); //Little bit risky if no dec.
|
||||
GodWebIdx("Top 100 Poems",
|
||||
"http://100.best-poems.net/top-100-best-poems.html",
|
||||
buf,2,"~/Sup1/Sup1Blog/Poems100.DD.Z");
|
||||
break;
|
||||
case:
|
||||
StrPrint(buf,"%05X",GodBits(2*5*4)); //Little bit risky if no dec.
|
||||
GodVideoDigits("Metallica Song",
|
||||
"http://home.hccnet.nl/a.r.adams/lyrics/"
|
||||
"metallica/songindex.html",
|
||||
buf,2,"~/Sup1/Sup1Blog/Metallica.DD.Z");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public U0 GodIns()
|
||||
{//<ALT-F7> Insert misc rand God item into blog.
|
||||
U8 *st,*tag;
|
||||
CRandExtDec5Form *gm=CAlloc(sizeof(CRandExtDec5Form));
|
||||
I64 god_src=PopUpPickLst("NISTBeacon\0HotBits\0ANU_NIST\0Google\0Random.org\0"
|
||||
"RandomNumbers.info\0Password\0GenerateData\0VirtualNotary\0Timer\0");
|
||||
if (god_src>=GSRC_NIST_BEACON) {
|
||||
switch (god_src) {
|
||||
case GSRC_NIST_BEACON:
|
||||
NISTGodIns1;
|
||||
break;
|
||||
start:
|
||||
case GSRC_HOTBITS:
|
||||
tag="https://www.fourmilab.ch/hotbits/secure_generate.html";
|
||||
break;
|
||||
case GSRC_ANU_NIST:
|
||||
tag="http://qrng.anu.edu.au/NIST.php";
|
||||
break;
|
||||
end:
|
||||
GodHeaderIns;
|
||||
"$$TX,\"%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag;
|
||||
switch (PopUpPickLst("ExtDec5Bible\0LinuxWords\0HappyWords\0"
|
||||
"Words1000\0Words10k\0Hex5Bible\0Hex8Books\0Doodle\0Movie100\0"
|
||||
"Painting100\0Painting1000\0Poems100\0Metallica\0")) {
|
||||
case:
|
||||
if (DocForm(gm(CRandExtDec5Form *)))
|
||||
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
|
||||
gm->rnd0,20,-5,FALSE,FALSE);
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CHexWordForm *))) {
|
||||
Adam("GodInit(\"~/Sup1/Sup1Words/LinuxDict.TXT*\");");
|
||||
GodWordBatch(gm,16,5);
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CHexWordForm *))) {
|
||||
Adam("GodInit(\"~/Sup1/Sup1Words/HappyWords.TXT*\");");
|
||||
GodWordBatch(gm,16,5);
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CHexWordForm *)))
|
||||
GodWordBatch(gm,10,3);
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CHexWordForm *)))
|
||||
GodWordBatch(gm,10,4);
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CRandHex5Form *))) {
|
||||
"$$TX,\"How this random Bible passage was chosen.\","
|
||||
"HTML=\"http://www.templeos.org/Wb"
|
||||
"/Home/Web/TAD/Passage.html\"$$\n";
|
||||
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
|
||||
gm->rnd0,20,16,TRUE,TRUE);
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CRandHex8Form *))) {
|
||||
"$$TX,\"How this random book pick was chosen.\","
|
||||
"HTML=\"http://www.templeos.org/Wb"
|
||||
"/Home/Web/TAD/NISTPick002.html\"$$\n";
|
||||
GodBooksPassageU32(Str2I64(gm->rnd0,16),
|
||||
"~/*","C:/Home/Books?/*");
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CHexWordForm *)))
|
||||
TOSGodDoodle(god_src,gm);
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CMoviesForm *)))
|
||||
GodVideoDigits("Top 100 Movies",
|
||||
"http://www.afi.com/100years/movies10.aspx",
|
||||
gm->rnd0,2,"~/Sup1/Sup1Blog/Movies100.DD.Z");
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CPaintings100Form *))) {
|
||||
GodWebIdx("Top 100 Paintings",
|
||||
"http://www.brushwiz.com/most-famous-paintings",
|
||||
gm->rnd0,2,"~/Sup1/Sup1Blog/Paintings100.DD.Z");
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CPaintings1000Form *))) {
|
||||
GodWebIdx("Top 1000 Paintings",
|
||||
"http://en.most-famous-paintings.com/MostFamousPaintings."
|
||||
"nsf/ListOfTop1000MostPopularPainting",
|
||||
gm->rnd0,3,"~/Sup1/Sup1Blog/Paintings1000.DD.Z");
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CPoems100Form *))) {
|
||||
GodWebIdx("Top 100 Poems",
|
||||
"http://100.best-poems.net/top-100-best-poems.html",
|
||||
gm->rnd0,2,"~/Sup1/Sup1Blog/Poems100.DD.Z");
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CMetallicaForm *)))
|
||||
GodVideoDigits("Metallica Song",
|
||||
"http://home.hccnet.nl/a.r.adams/lyrics/"
|
||||
"metallica/songindex.html",
|
||||
gm->rnd0,2,"~/Sup1/Sup1Blog/Metallica.DD.Z");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
start:
|
||||
case GSRC_GOOGLE:
|
||||
tag="http://www.google.com";
|
||||
break;
|
||||
case GSRC_RANDOM_ORG:
|
||||
tag="http://www.random.org";
|
||||
break;
|
||||
case GSRC_RANDOM_NUMBERS_INFO:
|
||||
tag="http://www.randomnumbers.info";
|
||||
break;
|
||||
case GSRC_PASSWORD:
|
||||
tag="https://passed.pw";
|
||||
break;
|
||||
case GSRC_GENERATE_DATA:
|
||||
break;
|
||||
end:
|
||||
GodHeaderIns;
|
||||
"$$TX,\"%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag;
|
||||
switch (PopUpPickLst("ExtDec5Bible\0HexWordBatch\0"
|
||||
"Hex5Bible\0Hex8Books\0Movie100\0Metallica\0")) {
|
||||
case:
|
||||
if (DocForm(gm(CRandExtDec5Form *)))
|
||||
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
|
||||
gm->rnd0,20,-5,FALSE,FALSE);
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CHexWordForm *)))
|
||||
GodWordBatch(gm,16,5);
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CRandHex5Form *))) {
|
||||
"$$TX,\"How this random Bible passage was chosen.\","
|
||||
"HTML=\"http://www.templeos.org/Wb"
|
||||
"/Home/Web/TAD/Passage.html\"$$\n";
|
||||
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
|
||||
gm->rnd0,20,16,TRUE,TRUE);
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CRandHex8Form *))) {
|
||||
"$$TX,\"How this random book pick was chosen.\","
|
||||
"HTML=\"http://www.templeos.org/Wb"
|
||||
"/Home/Web/TAD/NISTPick002.html\"$$\n";
|
||||
GodBooksPassageU32(Str2I64(gm->rnd0,16),
|
||||
"~/*","C:/Home/Books?/*");
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CMoviesForm *)))
|
||||
GodVideoDigits("Top 100 Movies",
|
||||
"http://www.afi.com/100years/movies10.aspx",
|
||||
gm->rnd0,2,"~/Sup1/Sup1Blog/Movies100.DD.Z");
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CMetallicaForm *)))
|
||||
GodVideoDigits("Metallica Song",
|
||||
"http://home.hccnet.nl/a.r.adams/lyrics/"
|
||||
"metallica/songindex.html",
|
||||
gm->rnd0,2,"~/Sup1/Sup1Blog/Metallica.DD.Z");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case GSRC_VIRTUAL_NOTARY:
|
||||
GodHeaderIns;
|
||||
if (DocForm(gm(CCertRandDec5Form *))) {
|
||||
tag="http://virtual-notary.org";
|
||||
"$$TX,\"%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag;
|
||||
tag="Here is the certificate";
|
||||
st=MStrPrint("http://www.templeos.org/Certs/virtual-notary-cert"
|
||||
"-randomnum-%d.p12",gm->cert);
|
||||
"\n$$TX,\"%$$Q: %d\",HTML=\"%$$Q\"$$.\n",tag,gm->cert,st;
|
||||
Free(st);
|
||||
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
|
||||
gm->rnd0,20,-5,FALSE,FALSE);
|
||||
}
|
||||
break;
|
||||
case GSRC_TIMER:
|
||||
TimerGodIns;
|
||||
break;
|
||||
}
|
||||
}
|
||||
Free(gm);
|
||||
}
|
||||
|
||||
if (FileFind("~/Sup1/Sup1Words/LinuxDict.TXT"))
|
||||
GodInit("~/Sup1/Sup1Words/LinuxDict.TXT");
|
||||
//if (FileFind("~/Sup1/Sup1Words/HappyWords.TXT"))
|
||||
// GodInit("~/Sup1/Sup1Words/HappyWords.TXT");
|
||||
@@ -1,226 +0,0 @@
|
||||
#help_index "Misc/Blog"
|
||||
|
||||
U8 *YouTubeGet(U8 *filename="~/Sup1/Sup1Blog/YouTube.DD.Z",U8 *needle)
|
||||
{
|
||||
I64 i=0,line=I64_MIN;
|
||||
CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR),
|
||||
*doc2=DocNew;
|
||||
U8 *title,*code,*res;
|
||||
while (DocFind(doc,line,needle)) {
|
||||
if (!(doc->cur_entry->y&1)) {
|
||||
title=doc->cur_entry->tag;
|
||||
DocGoToLine(doc,doc->cur_entry->y+2);
|
||||
if (doc->cur_entry->type_u8==DOCT_TEXT) {
|
||||
code=doc->cur_entry->tag;
|
||||
DocPrint(doc2,"$$MU-UL,\"%s\",LE=0x%X$$\n",title,code);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
line=doc->cur_entry->y+2;
|
||||
}
|
||||
switch (i) {
|
||||
case 0:
|
||||
res=NULL;
|
||||
break;
|
||||
case 1:
|
||||
res=StrNew(code);
|
||||
break;
|
||||
default:
|
||||
res=PopUpMenu(doc2);
|
||||
if (res==DOCM_CANCEL)
|
||||
res=NULL;
|
||||
else
|
||||
res=StrNew(res);
|
||||
}
|
||||
DocDel(doc);
|
||||
DocDel(doc2);
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 YouTubeAdd(U8 *filename="~/Sup1/Sup1Blog/YouTube.DD.Z",
|
||||
U8 *title,U8 *code)
|
||||
{
|
||||
CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
|
||||
if (!DocFind(doc,,title)) {
|
||||
DocBottom(doc);
|
||||
DocPrint(doc,"%s\n%s\n",title,code);
|
||||
DocTop(doc);
|
||||
DocWrite(doc);
|
||||
Sort(filename,,2);
|
||||
}
|
||||
DocDel(doc);
|
||||
}
|
||||
|
||||
U8 *WebBookMarks(U8 *filename="~/Sup1/Sup1Blog/Bookmarks.html")
|
||||
{
|
||||
U8 *st;
|
||||
CDocEntry *doc_e;
|
||||
CDoc *doc=DocNew;
|
||||
CCmpCtrl *cc=CmpCtrlNew(MStrPrint("#include \"%s\"",filename));
|
||||
while (Lex(cc))
|
||||
if (cc->token==TK_STR && *cc->cur_str(U32 *)=='http') {
|
||||
DocPrint(doc,"$$MU-UL,\"%$$Q\",LE=0x%X$$\n",cc->cur_str,cc->cur_str);
|
||||
cc->cur_str=NULL;
|
||||
}
|
||||
CmpCtrlDel(cc);
|
||||
|
||||
if ((st=PopUpMenu(doc))!=DOCM_CANCEL)
|
||||
st=StrNew(st);
|
||||
else
|
||||
st=NULL;
|
||||
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_MENU_VAL)
|
||||
Free(doc_e->left_exp);
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
DocDel(doc);
|
||||
|
||||
return st;
|
||||
}
|
||||
|
||||
U0 TOSIns()
|
||||
{
|
||||
CWebBibleForm *url=CAlloc(sizeof(CWebBibleForm));
|
||||
U8 *tag,*st,*st2;
|
||||
|
||||
switch (PopUpPickLst("BiblePassage\0BibleVerse\0"
|
||||
"YouTube\0Imgur\0Wikipedia\0WebBookMark\0")) {
|
||||
case:
|
||||
if (DocForm(url(CWebBibleForm *))) {
|
||||
tag=url->special;
|
||||
st2=URLPercentSpaces(url->special);
|
||||
st=MStrPrint("http://www.biblegateway.com/passage/"
|
||||
"?search=%s&version=NIV",st2);
|
||||
Free(st2);
|
||||
if (*url->tag)
|
||||
tag=url->tag;
|
||||
"$$TX,\"%$$Q\",HTML=\"%$$Q\"$$",tag,st;
|
||||
Free(st);
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(url(CWebBibleForm *))) {
|
||||
tag=url->special;
|
||||
st2=URLPercentSpaces(url->special);
|
||||
st=MStrPrint(
|
||||
"http://www.biblegateway.com/verse/en/%s",st2);
|
||||
Free(st2);
|
||||
if (*url->tag)
|
||||
tag=url->tag;
|
||||
"$$TX,\"%$$Q\",HTML=\"%$$Q\"$$",tag,st;
|
||||
Free(st);
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(url(CYouTubeForm *))) {
|
||||
if (*url->special==CH_SPACE)
|
||||
st2=YouTubeGet(,url->tag);
|
||||
else
|
||||
st2=StrNew(url->special);
|
||||
if (st2 && *st2!=CH_SPACE) {
|
||||
if (url->min || url->sec)
|
||||
st=MStrPrint("%s&hl=enUS&start=%d",st2,url->min*60+url->sec);
|
||||
else
|
||||
st=StrNew(st2);
|
||||
if (*url->special!=CH_SPACE && *url->tag)
|
||||
YouTubeAdd(,url->tag,st);
|
||||
"$$HC,\"<object width=\\\"640\\\" "
|
||||
"height=\\\"520\\\"><param name=\\\"movie\\\" "
|
||||
"value=\\\"http://www.youtube.com/v/%s\\\"></param><param "
|
||||
"name=\\\"allowscriptaccess\\\" "
|
||||
"value=\\\"always\\\"></param><embed "
|
||||
"src=\\\"http://www.youtube.com/v/%s\\\" "
|
||||
"type=\\\"application/x-shockwave-flash\\\" "
|
||||
"allowscriptaccess=\\\"always\\\" "
|
||||
"width=\\\"640\\\" height=\\\"520\\\">"
|
||||
"</embed></object>\"$$\n",st,st;
|
||||
Free(st);
|
||||
Free(st2);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(url(CImgurForm *))) {
|
||||
"$$HC,\"<center><img src=\\\"http://i.imgur.com/%s\\\" "
|
||||
"width=\\\"%d\\\" height=\\\"%d\\\" "
|
||||
"alt=\\\"\\\"></center>\"$$\n",
|
||||
url->special,url->min,url->sec;
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(url(CWikipediaForm *))) {
|
||||
tag=url->special;
|
||||
st=MStrPrint("http://en.wikipedia.org/wiki/%s",url->special);
|
||||
if (*url->tag)
|
||||
tag=url->tag;
|
||||
"$$TX,\"%$$Q\",HTML=\"%$$Q\"$$",tag,st;
|
||||
Free(st);
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(url(CWebBookMarkForm *))) {
|
||||
tag=st=WebBookMarks;
|
||||
if (*url->tag)
|
||||
tag=url->tag;
|
||||
"$$TX,\"%$$Q\",HTML=\"%$$Q\"$$",tag,st;
|
||||
Free(st);
|
||||
}
|
||||
break;
|
||||
}
|
||||
Free(url);
|
||||
}
|
||||
|
||||
#help_index "Misc/TOS/God;God/TOS"
|
||||
|
||||
public U0 GodCodeJmp()
|
||||
{//Jump to rand code in OS. See $LK,"::/Adam/God/HSNotes.DD"$.
|
||||
CDirEntry *tmpde1=FilesFind("/*",
|
||||
FUF_JUST_FILES|FUF_RECURSE|FUF_JUST_SRC|FUF_CLUS_ORDER),
|
||||
*tmpde=tmpde1;
|
||||
I64 cnt=0,num;
|
||||
CDoc *doc;
|
||||
U8 *st;
|
||||
while (tmpde) {
|
||||
doc=DocRead(tmpde->full_name);
|
||||
tmpde->user_data=doc->head.y;
|
||||
cnt+=doc->head.y;
|
||||
DocDel(doc);
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
|
||||
FifoU8Flush(god.fifo);
|
||||
GodBitsIns(GOD_GOOD_BITS,KbdMsEvtTime>>GOD_BAD_BITS);
|
||||
num=GodBits(GOD_GOOD_BITS)%cnt;
|
||||
|
||||
tmpde=tmpde1;
|
||||
while (tmpde) {
|
||||
num-=tmpde->user_data;
|
||||
if (num<0) {
|
||||
st=MStrPrint("FL:%s,%d",tmpde->full_name,-num);
|
||||
break;
|
||||
}
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirTreeDel(tmpde1);
|
||||
Ed(st);
|
||||
Free(st);
|
||||
}
|
||||
|
||||
U0 GodOffer()
|
||||
{
|
||||
switch (PopUpPickLst("MosesComic\0Fiction\0")) {
|
||||
case:
|
||||
"---- Moses Comic ---- "
|
||||
"(Set in the $TX,"Numbers 11",HTML="http://www.biblegateway.com/passage/?search=Numbers%%%%2011&version=NIV"$ "
|
||||
"part of the story.)\n"
|
||||
"Moses says, \"\"\n"
|
||||
"God says, \"\"\n";
|
||||
break;
|
||||
case:
|
||||
"---- $TX,"Collaborative Fiction",HTML="http://en.wikipedia.org/wiki/Collaborative_fiction"$ ----\n"
|
||||
"Once upon a time ";
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1,63 +1,42 @@
|
||||
#help_index "Misc/TOS"
|
||||
|
||||
#define VIDEO_FRAME_RATE 29.97
|
||||
|
||||
#define FG_JUST_AUDIO 0
|
||||
#define FG_BOOT_DRV 1
|
||||
#define FG_RAM_DRV 2
|
||||
I64 fg_mode=FG_RAM_DRV;
|
||||
Bool fg_on =FALSE;
|
||||
|
||||
U0 FrameGrabberTask(I64)
|
||||
{//#!/bin/bash
|
||||
//for f in ./ScrnShots/*.Z; do ./Bin/TOSZ $$f; done
|
||||
//ffmpeg -r 8 -i VID%05d.BMP -y Movie.avi
|
||||
I64 frame_num=0;
|
||||
U8 buf[STR_LEN],buf2[STR_LEN],*st_dir;
|
||||
F64 end_time=tS;
|
||||
Silent; //no output to scrn
|
||||
if (fg_mode==FG_RAM_DRV)
|
||||
st_dir="B:/Tmp/ScrnShots";
|
||||
else
|
||||
st_dir="::/Tmp/ScrnShots";
|
||||
DirMk(st_dir);
|
||||
while (fg_on) {
|
||||
StrPrint(buf,"%s/VID%05d.BMP.Z",st_dir,frame_num++);
|
||||
StrCpy(buf2,buf);
|
||||
BMPScrnCapture(buf);
|
||||
while (TRUE) {
|
||||
end_time+=1.0/VIDEO_FRAME_RATE;
|
||||
if (end_time<tS) {
|
||||
StrPrint(buf,"%s/VID%05d.BMP.Z",st_dir,frame_num++);
|
||||
Copy(buf2,buf);
|
||||
} else
|
||||
break;
|
||||
}
|
||||
SleepUntil(cnts.jiffies+(end_time-tS)*JIFFY_FREQ);
|
||||
}
|
||||
}
|
||||
|
||||
I64 CopyVideo()
|
||||
I64 CopyVideo(Bool reverb)
|
||||
{
|
||||
I64 res=0;
|
||||
Del("D:/Tmp/*.SND");
|
||||
if (fg_mode==FG_JUST_AUDIO)
|
||||
SndFileCreate("D:/Tmp/Audio",0.115,0.0,WF_SQUARE,0.45,0.35,2.5);
|
||||
else {
|
||||
SndFileCreate("D:/Tmp/Audio",0.115,0.0,WF_SQUARE,0.45,0.35);
|
||||
DelTree("D:/Tmp/ScrnShots");
|
||||
if (fg_mode==FG_RAM_DRV) {
|
||||
res=CopyTree("B:/Tmp/ScrnShots","D:/Tmp/ScrnShots");
|
||||
"Unused Space: %12.6fMeg\n",DrvUnused('B')/1024.0/1024.0;
|
||||
} else
|
||||
res=CopyTree("::/Tmp/ScrnShots","D:/Tmp/ScrnShots");
|
||||
"$$BK,1$$Files Copied:%d$$BK,0$$ Time:%8.3fm\n",
|
||||
res,res/60.0/VIDEO_FRAME_RATE;
|
||||
F64 delay=0,intensity=0;
|
||||
Bool old_silent=Silent;
|
||||
if (reverb) {
|
||||
delay=0.45;
|
||||
intensity=0.35;
|
||||
}
|
||||
Del("D:/Tmp/*.SND");
|
||||
DelTree("D:/Tmp/ScrnShots");
|
||||
DirMk("D:/Tmp/ScrnShots");
|
||||
Silent(old_silent);
|
||||
SndFileCreate("D:/Tmp/Audio",0.115,0.0,WF_SQUARE,delay,intensity);
|
||||
GR2BMPLst("B:/Tmp","+d","D:/Tmp/ScrnShots/VID%05d.BMP.Z");
|
||||
return res;
|
||||
}
|
||||
|
||||
public U0 FrameGrabberToggle()
|
||||
#help_index "Misc/TOS"
|
||||
U0 DelScrnShots()
|
||||
{
|
||||
Bool old_silent=Silent;
|
||||
DelTree("B:/Tmp");
|
||||
DirMk("B:/Tmp");
|
||||
Del("D:/Tmp/*.SND");
|
||||
DelTree("D:/Tmp/ScrnShots");
|
||||
DirMk("D:/Tmp/ScrnShots");
|
||||
Del("C:/Tmp/*.SND");
|
||||
DelTree("C:/Tmp/ScrnShots");
|
||||
DirMk("C:/Tmp/ScrnShots");
|
||||
Silent(old_silent);
|
||||
}
|
||||
|
||||
public U0 FrameGrabberToggle(Bool sync_tone,Bool tos_theme,
|
||||
Bool reverb,Bool just_audio=FALSE)
|
||||
{//The frame grabber saves BMP files to D:/Tmp/ScrnShots.
|
||||
static F64 last_time=0;
|
||||
if (tS-last_time>3.0) {
|
||||
@@ -66,34 +45,42 @@ public U0 FrameGrabberToggle()
|
||||
fg_on=FALSE;
|
||||
Snd;
|
||||
wall->record=snd.record=FALSE;
|
||||
Sleep(1000);
|
||||
User("CopyVideo;Exit;\n");
|
||||
ScrnCast(OFF);
|
||||
User("CopyVideo(%d);Exit;\n",reverb);
|
||||
} else {
|
||||
DelScrnShots;
|
||||
fg_on=TRUE;
|
||||
if (fg_mode!=FG_JUST_AUDIO)
|
||||
Spawn(&FrameGrabberTask,NULL,"Frame Grabber");
|
||||
if (!just_audio)
|
||||
ScrnCast(ON);
|
||||
wall->record=snd.record=TRUE;
|
||||
Snd;
|
||||
if (sync_tone) {Beep;}
|
||||
if (tos_theme) {User("ExeFile(\"~/TOS/TOSTheme\");Exit;\n");}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public U0 JukeSong(I64 num)
|
||||
public U0 JukeSong(I64 num,I64 passes=2)
|
||||
{//Make movie of one song.
|
||||
if (!fg_on)
|
||||
FrameGrabberToggle;
|
||||
JukeSongsPuppet("~/Sup1/Sup1Hymns",,num,num+1);
|
||||
FrameGrabberToggle(FALSE,FALSE,FALSE);
|
||||
JukeSongsPuppet("~/Sup1/Sup1Hymns",passes,num,num+1);
|
||||
if (fg_on)
|
||||
FrameGrabberToggle;
|
||||
FrameGrabberToggle(FALSE,FALSE,TRUE);
|
||||
}
|
||||
|
||||
public U0 JukeLines(I64 start_line,I64 end_line)
|
||||
{//Make movie of many lines of songs.
|
||||
{//Make movie of many lines of songs, starting at 0.
|
||||
if (!fg_on)
|
||||
FrameGrabberToggle;
|
||||
JukeSongsPuppet("~/Sup1/Sup1Hymns",,start_line*5,end_line*5);
|
||||
FrameGrabberToggle(FALSE,FALSE,FALSE);
|
||||
JukeSongsPuppet("~/Sup1/Sup1Hymns",,start_line*5,end_line*5,1.5);
|
||||
if (fg_on)
|
||||
FrameGrabberToggle;
|
||||
FrameGrabberToggle(FALSE,FALSE,TRUE);
|
||||
}
|
||||
|
||||
public U0 TADHymn(I64 num)
|
||||
{//Make 2-lines of songs movie starting at 1.
|
||||
JukeLines((num-1)*2,num*2);
|
||||
}
|
||||
|
||||
public U0 DskChkAll()
|
||||
@@ -177,14 +164,6 @@ public U0 BMP2Doc(U8 *_in_name,U8 *_out_name=NULL)
|
||||
Free(out_name);
|
||||
}
|
||||
|
||||
U0 TOSTheme()
|
||||
{
|
||||
if (!fg_on)
|
||||
PopUp("Sleep(50);FrameGrabberToggle;");
|
||||
ExeFile("~/Sup1/Sup1Graphics/TOS/TOSTheme.HC");
|
||||
DocClear;
|
||||
}
|
||||
|
||||
#define MEM_TEST_SIZE 1024*1024
|
||||
U0 MemTest()
|
||||
{
|
||||
@@ -202,38 +181,3 @@ U0 MemTest()
|
||||
Yield;
|
||||
}
|
||||
}
|
||||
|
||||
public I64 Profanity(
|
||||
U8 *needle_filename="~/Sup1/Sup1Blog/Profanity.DD.Z",
|
||||
U8 *files_find_mask="/*",U8 *fu_flags=NULL)
|
||||
{//Scan for profanity.
|
||||
CCmpCtrl *cc;
|
||||
I64 res=0;
|
||||
if (FileFind(needle_filename)) {
|
||||
cc=CmpCtrlNew(MStrPrint("#include \"%s\"",needle_filename));
|
||||
while (Lex(cc))
|
||||
if (cc->token==TK_IDENT)
|
||||
res+=Find(cc->cur_str,files_find_mask,fu_flags);
|
||||
CmpCtrlDel(cc);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 TOSChgLog2()
|
||||
{
|
||||
InStr("\"Ed(\\\"::/Doc/ChgLog.DD.Z\\\");\n\";
|
||||
Msg(MSG_KEY_DOWN_UP,0,SC_CURSOR_UP|SCF_CTRL);
|
||||
Msg(MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN);
|
||||
Msg(MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN);
|
||||
Msg(MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN);
|
||||
Msg(MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN);
|
||||
Msg(MSG_KEY_DOWN_UP,CH_CTRLY,0);
|
||||
Msg(MSG_KEY_DOWN_UP,0,SC_F6|SCF_ALT);
|
||||
Msg(MSG_KEY_DOWN_UP,CH_ESC,0);"
|
||||
"\"Exit;\n\";");
|
||||
}
|
||||
|
||||
public U0 TOSChgLog()
|
||||
{//Opdate ChgLog file.
|
||||
User("TOSChgLog2;\n");
|
||||
}
|
||||
@@ -1,181 +0,0 @@
|
||||
#help_index "Misc/TOS/God;God/TOS"
|
||||
|
||||
I64 tos_timestamp=0,tos_type=0;
|
||||
|
||||
RegDft("TempleOS/TOSNIST","I64 tos_nist_offset=-8049;\n");
|
||||
RegExe("TempleOS/TOSNIST");
|
||||
|
||||
public I64 CDate2Unix(CDate dt)
|
||||
{//TempleOS datetime to Unix timestamp.
|
||||
return ToI64((dt-Str2Date("1/1/1970"))/CDATE_FREQ+NIST_TIME_OFFSET);
|
||||
}
|
||||
|
||||
public CDate Unix2CDate(I64 timestamp)
|
||||
{//Unix timestamp to TempleOS datetime.
|
||||
return (timestamp-NIST_TIME_OFFSET)*CDATE_FREQ+Str2Date("1/1/1970");
|
||||
}
|
||||
|
||||
public U0 NISTBeaconSync()
|
||||
{//Help get local clk in sync with NIST clk.
|
||||
I64 i,j;
|
||||
CDate dt;
|
||||
CDateStruct ds;
|
||||
while (!ScanChar) {
|
||||
dt=Now;
|
||||
Date2Struct(&ds,dt);
|
||||
i=CDate2Unix(dt);
|
||||
j=FloorI64(i,60);
|
||||
"%d %d %02d %02d\n",i,j,ds.sec,(60+ds.sec-(i-j))%60;
|
||||
Sleep(100);
|
||||
}
|
||||
tos_nist_offset=GetI64("tos_nist_offset (%d):",tos_nist_offset);
|
||||
RegWrite("TempleOS/TOSNIST","I64 tos_nist_offset=%d;\n",tos_nist_offset);
|
||||
}
|
||||
|
||||
U0 NISTBeaconURL(I64 timestamp)
|
||||
{//Insert NIST Beacon header into blog.
|
||||
U8 *tag;
|
||||
CDateStruct ds;
|
||||
CDate dt=Unix2CDate(timestamp);
|
||||
Date2Struct(&ds,dt+local_time_offset+30*CDATE_FREQ);
|
||||
"$$TX,\"NIST Beacon Date:%D Time:%02d:%02d Unix TimeStamp:%u\","
|
||||
"HTML=\"https://beacon.nist.gov/home\"$$\n",dt,ds.hour,ds.min,timestamp;
|
||||
tag=MStrPrint("https://beacon.nist.gov/rest/record/%d",timestamp);
|
||||
"$$TX,\"NIST Beacon Record:%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag;
|
||||
Free(tag);
|
||||
}
|
||||
|
||||
U0 NISTGodIns1()
|
||||
{
|
||||
tos_type=PopUpPickLst("ExtDec5Bible\0LinuxWords\0HappyWords\0Words1000\0"
|
||||
"Words10k\0Hex5Bible\0Hex8Books\0Doodle\0Movie100\0Painting100\0"
|
||||
"Painting1000\0Poems100\0Metallica\0");
|
||||
switch (tos_type) {
|
||||
case: tos_timestamp=GodHeaderIns("Bible"); break;
|
||||
case: tos_timestamp=GodHeaderIns("LinuxWords"); break;
|
||||
case: tos_timestamp=GodHeaderIns("HappyWords"); break;
|
||||
case: tos_timestamp=GodHeaderIns("Words1000"); break;
|
||||
case: tos_timestamp=GodHeaderIns("Words10k"); break;
|
||||
case: tos_timestamp=GodHeaderIns("Bible"); break;
|
||||
case: tos_timestamp=GodHeaderIns("BookPick"); break;
|
||||
case: tos_timestamp=GodHeaderIns("Doodle"); break;
|
||||
case: tos_timestamp=GodHeaderIns("Movie100"); break;
|
||||
case: tos_timestamp=GodHeaderIns("Painting100"); break;
|
||||
case: tos_timestamp=GodHeaderIns("Painting1000"); break;
|
||||
case: tos_timestamp=GodHeaderIns("Poems100"); break;
|
||||
case: tos_timestamp=GodHeaderIns("Metallica"); break;
|
||||
}
|
||||
Once("tos_timestamp=%d;\ntos_type=%d;\n"
|
||||
"In(\"Blog(TRUE);\n\");",tos_timestamp,tos_type);
|
||||
}
|
||||
|
||||
U0 NISTGodIns2()
|
||||
{
|
||||
CRandExtDec5Form *gm=CAlloc(sizeof(CRandExtDec5Form));
|
||||
|
||||
gm->timestamp=tos_timestamp;
|
||||
switch (tos_type) {
|
||||
case:
|
||||
if (DocForm(gm(CRandExtDec5Form *))) {
|
||||
NISTBeaconURL(gm->timestamp);
|
||||
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
|
||||
gm->rnd0,20,-5,FALSE,FALSE);
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CHexWordForm *))) {
|
||||
NISTBeaconURL(gm->timestamp);
|
||||
Adam("GodInit(\"~/Sup1/Sup1Words/LinuxDict.TXT*\");");
|
||||
GodWordBatch(gm,16,5);
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CHexWordForm *))) {
|
||||
NISTBeaconURL(gm->timestamp);
|
||||
Adam("GodInit(\"~/Sup1/Sup1Words/HappyWords.TXT*\");");
|
||||
GodWordBatch(gm,16,5);
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CHexWordForm *))) {
|
||||
NISTBeaconURL(gm->timestamp);
|
||||
GodWordBatch(gm,10,3);
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CHexWordForm *))) {
|
||||
NISTBeaconURL(gm->timestamp);
|
||||
GodWordBatch(gm,10,4);
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CRandHex5Form *))) {
|
||||
"$$TX,\"How this random Bible passage was chosen.\","
|
||||
"HTML=\"http://www.templeos.org/Wb"
|
||||
"/Home/Web/TAD/NISTPassage.html\"$$\n";
|
||||
NISTBeaconURL(gm->timestamp);
|
||||
TOSBookLines("~/Sup1/Sup1Blog/NumBible.TXT",ST_BIBLE_LINES,
|
||||
gm->rnd0,20,16,TRUE,TRUE);
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CRandHex8Form *))) {
|
||||
"$$TX,\"How this random book pick was chosen.\","
|
||||
"HTML=\"http://www.templeos.org/Wb"
|
||||
"/Home/Web/TAD/NISTPick002.html\"$$\n";
|
||||
NISTBeaconURL(gm->timestamp);
|
||||
GodBooksPassageU32(Str2I64(gm->rnd0,16),
|
||||
"~/*","C:/Home/Books?/*");
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CHexWordForm *))) {
|
||||
NISTBeaconURL(gm->timestamp);
|
||||
TOSGodDoodle(GSRC_NIST_BEACON,gm);
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CMoviesForm *))) {
|
||||
NISTBeaconURL(gm->timestamp);
|
||||
GodVideoDigits("Top 100 Movies",
|
||||
"http://www.afi.com/100years/movies10.aspx",
|
||||
gm->rnd0,2,"~/Sup1/Sup1Blog/Movies100.DD.Z");
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CPaintings100Form *))) {
|
||||
NISTBeaconURL(gm->timestamp);
|
||||
GodWebIdx("Top 100 Paintings",
|
||||
"http://www.brushwiz.com/most-famous-paintings",
|
||||
gm->rnd0,2,"~/Sup1/Sup1Blog/Paintings100.DD.Z");
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CPaintings1000Form *))) {
|
||||
NISTBeaconURL(gm->timestamp);
|
||||
GodWebIdx("Top 1000 Paintings",
|
||||
"http://en.most-famous-paintings.com/MostFamousPaintings."
|
||||
"nsf/ListOfTop1000MostPopularPainting",
|
||||
gm->rnd0,3,"~/Sup1/Sup1Blog/Paintings1000.DD.Z");
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CPoems100Form *))) {
|
||||
NISTBeaconURL(gm->timestamp);
|
||||
GodWebIdx("Top 100 Poems",
|
||||
"http://100.best-poems.net/top-100-best-poems.html",
|
||||
gm->rnd0,2,"~/Sup1/Sup1Blog/Poems100.DD.Z");
|
||||
}
|
||||
break;
|
||||
case:
|
||||
if (DocForm(gm(CMetallicaForm *))) {
|
||||
NISTBeaconURL(gm->timestamp);
|
||||
GodVideoDigits("Metallica Song",
|
||||
"http://home.hccnet.nl/a.r.adams/lyrics/"
|
||||
"metallica/songindex.html",
|
||||
gm->rnd0,2,"~/Sup1/Sup1Blog/Metallica.DD.Z");
|
||||
}
|
||||
break;
|
||||
}
|
||||
Free(gm);
|
||||
}
|
||||
@@ -1,184 +0,0 @@
|
||||
$WW,1$$FG,5$$TX+CX,"TOS Staff Policies"$$FG$
|
||||
|
||||
* Motto: Run toward bugs, not away from bugs.
|
||||
|
||||
* Be Metallica. Use short, sharp, powerful words, as though a song.
|
||||
|
||||
* Be careful $FG,2$/Demo/AcctExample$FG$ doesn't get extra files. When you run TOSRegen(), it will copy home files to $FG,2$/Demo/AcctExample$FG$.
|
||||
|
||||
* Be careful $FG,2$remote/Wb$FG$ site doesn't get extra files. If you delete or rename a file, also delete the $FG,2$remote/Wb$FG$ file from the site.
|
||||
|
||||
$TR,"PreRegen()"$
|
||||
$ID,2$
|
||||
Linux: Export Bookmarks to ~/TAD/Home/Sup1/Sup1Blog/Bookmarks.html
|
||||
Linux: >vm_in
|
||||
Linux: VMware Machine: "TOS"
|
||||
{
|
||||
TempleOS: >TOSPreRegen;
|
||||
TempleOS: Update Budget
|
||||
}
|
||||
$ID,-2$
|
||||
$TR,"NewRelease(Bool full=FALSE)"$
|
||||
$ID,2$
|
||||
if ($FG,2$full$FG$)
|
||||
]PreRegen()
|
||||
|
||||
Linux: VMware Machine:"TOS"
|
||||
{
|
||||
TempleOS: >TOSRegen($FG,2$full$FG$);
|
||||
}
|
||||
Linux: >vm_out
|
||||
|
||||
if ($FG,2$full$FG$) {
|
||||
Linux: Burn ~/TAD to memory stick.
|
||||
|
||||
On other machine {
|
||||
Linux: Copy ~/TAD from memory stick.
|
||||
|
||||
VMware: VMware NewMachine:"TOS", Install TempleOSStaff.ISO
|
||||
{ //2048 Meg RAM or 57344 Meg RAM
|
||||
TempleOS: $LK,"TOSStaffIns",A="MN:TOSStaffIns"$(); in VMware.
|
||||
TempleOS: >TOSRegen;
|
||||
TempleOS: >#include "::/Misc/OSTestSuite"
|
||||
TempleOS: >Del("~/Demo*");
|
||||
}
|
||||
|
||||
Linux: >emu_staff_new
|
||||
Linux: >emu8core or >emu24core
|
||||
{
|
||||
TempleOS: $LK,"TOSStaffIns",A="MN:TOSStaffIns"$(); in QEMU.
|
||||
TempleOS: >TOSRegen;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Linux: CrossFTP sync ~/TAD/Site1/Wb to remote/Wb
|
||||
|
||||
if ($FG,2$full$FG$) {
|
||||
FileZilla
|
||||
Upload ~/TAD/Site1/index.html to remote/index.html
|
||||
Upload ~/TAD/Site1/TempleOS.html to remote/TempleOS.html
|
||||
}
|
||||
|
||||
In WebHost FileMgr {
|
||||
Del {
|
||||
remote/TempleOSCD.ISO
|
||||
remote/TempleOSSup1.ISO.C
|
||||
remote/TempleOSWeb.ISO.C
|
||||
remote/TempleOSUltra.ISO
|
||||
}
|
||||
Copy up one level to remote root {
|
||||
remote/Wb/TempleOSCD.ISO
|
||||
remote/Wb/TempleOSSup1.ISO.C
|
||||
remote/Wb/TempleOSWeb.ISO.C
|
||||
remote/Wb/TempleOSUltra.ISO
|
||||
}
|
||||
}
|
||||
$ID,-2$
|
||||
$TR,"NewVersion(Bool full=FALSE)"$
|
||||
$ID,2$
|
||||
Increment minor version number.
|
||||
>$LK,"R",A="MN:R"$("3.12","3.13","-i-l"); //Approve by hand.
|
||||
|
||||
Add version release notice in $LK,"::/Doc/ChgLog.DD"$.
|
||||
|
||||
]NewRelease(TRUE);
|
||||
|
||||
Submit to www.betanews.com.
|
||||
Send email to MajorGeeks.
|
||||
if ($FG,2$full$FG$) {
|
||||
Submit to www.upload.com.
|
||||
Upload to SourceForge.
|
||||
}
|
||||
$ID,-2$
|
||||
$TR,"NewYearlyVersion()"$
|
||||
$ID,2$
|
||||
Increment major version number.
|
||||
>$LK,"R",A="MN:R"$("3.13","4.00","-i-l"); //Approve by hand.
|
||||
|
||||
Add version release notice in $LK,"::/Doc/ChgLog.DD"$.
|
||||
|
||||
$LK,"Update ::/Misc/PCIDevices.DD",A="FF:::/Adam/DevInfo.HC,PCIDevFileGen"$
|
||||
|
||||
Remove 6 months from bottom of $LK,"::/Doc/ChgLog.DD"$.
|
||||
|
||||
]NewVersion(TRUE);
|
||||
$ID,-2$
|
||||
* If you change the compiler language syntax, immediately make a ]NewRelease(TRUE).
|
||||
|
||||
|
||||
$FG,5$$TX+CX,"TOS Staff Indoctrination"$$FG$
|
||||
|
||||
Make a list of all the ways you make a project scalable. With TempleOS, we scale down, not up, so do we do the opposite of all of them.
|
||||
|
||||
How would you improve this $LK,"LZW Compression",A="FI:::/Kernel/Compress.HC"$? We have a 100,000 line of code limit, so it's a trick, thought provoking, question introducing you to our way of thinking.
|
||||
|
||||
We hope to define objective metrics so we can simply ask the world to reduce the lines of code and be perfectly objective.
|
||||
|
||||
We hope for an objective metric for the compiler, such as how fast it compiles itself (having been compiled by itself). It's a little less elegant, but we actually compile kernel and compiler together all the time with $LK,"TOSBootHDIns",A="FF:::/Demo/AcctExample/TOS/TOSDistro.HC,TOSBootHDIns"$('C'). We have the freedom to change the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ language, like how I made type-casting post-fix. We need some more limitations on the problem because we don't want a ridiculous language.
|
||||
|
||||
Consider these games as the basis of the vector space we wish to span:
|
||||
|
||||
$LK,"/Demo/Games/BattleLines.HC",A="FI:::/Demo/Games/BattleLines.HC"$
|
||||
$LK,"/Demo/Games/BigGuns.HC",A="FI:::/Demo/Games/BigGuns.HC"$
|
||||
$LK,"/Demo/Games/BlackDiamond.HC",A="FI:::/Demo/Games/BlackDiamond.HC"$
|
||||
$LK,"/Demo/Games/BomberGolf.HC",A="FI:::/Demo/Games/BomberGolf.HC"$
|
||||
$LK,"/Demo/Games/CastleFrankenstein.HC",A="FI:::/Demo/Games/CastleFrankenstein.HC"$
|
||||
$LK,"/Demo/Games/CharDemo.HC",A="FI:::/Demo/Games/CharDemo.HC"$
|
||||
$LK,"/Demo/Games/CircleTrace.HC",A="FI:::/Demo/Games/CircleTrace.HC"$
|
||||
$LK,"/Demo/Games/Collision.HC",A="FI:::/Demo/Games/Collision.HC"$
|
||||
$LK,"/Demo/Games/Digits.HC",A="FI:::/Demo/Games/Digits.HC"$
|
||||
$LK,"/Demo/Games/DunGen.HC",A="FI:::/Demo/Games/DunGen.HC"$
|
||||
$LK,"/Demo/Games/ElephantWalk.HC",A="FI:::/Demo/Games/ElephantWalk.HC"$
|
||||
$LK,"/Demo/Games/FlapBat.HC",A="FI:::/Demo/Games/FlapBat.HC"$
|
||||
$LK,"/Demo/Games/FlatTops.HC",A="FI:::/Demo/Games/FlatTops.HC"$
|
||||
$LK,"/Demo/Games/Halogen.HC",A="FI:::/Demo/Games/Halogen.HC"$
|
||||
$LK,"/Demo/Games/MassSpring.HC",A="FI:::/Demo/Games/MassSpring.HC"$
|
||||
$LK,"/Demo/Games/Maze.HC",A="FI:::/Demo/Games/Maze.HC"$
|
||||
$LK,"/Demo/Games/RainDrops.HC",A="FI:::/Demo/Games/RainDrops.HC"$
|
||||
$LK,"/Demo/Games/RawHide.HC",A="FI:::/Demo/Games/RawHide.HC"$
|
||||
$LK,"/Demo/Games/Rocket.HC",A="FI:::/Demo/Games/Rocket.HC"$
|
||||
$LK,"/Demo/Games/RocketScience.HC",A="FI:::/Demo/Games/RocketScience.HC"$
|
||||
$LK,"/Demo/Games/Squirt.HC",A="FI:::/Demo/Games/Squirt.HC"$
|
||||
$LK,"/Demo/Games/Talons.HC",A="FI:::/Demo/Games/Talons.HC"$
|
||||
$LK,"/Demo/Games/TheDead.HC",A="FI:::/Demo/Games/TheDead.HC"$
|
||||
$LK,"/Demo/Games/TicTacToe.HC",A="FI:::/Demo/Games/TicTacToe.HC"$
|
||||
$LK,"/Demo/Games/TreeCheckers.HC",A="FI:::/Demo/Games/TreeCheckers.HC"$
|
||||
$LK,"/Demo/Games/Varoom.HC",A="FI:::/Demo/Games/Varoom.HC"$
|
||||
$LK,"/Demo/Games/Wenceslas.HC",A="FI:::/Demo/Games/Wenceslas.HC"$
|
||||
$LK,"/Demo/Games/Whap.HC",A="FI:::/Demo/Games/Whap.HC"$
|
||||
$LK,"/Demo/Games/Zing.HC",A="FI:::/Demo/Games/Zing.HC"$
|
||||
$LK,"/Demo/Games/ZoneOut.HC",A="FI:::/Demo/Games/ZoneOut.HC"$
|
||||
|
||||
Unlike Linux and Windows, we do not want to handle all usage models. On the contrary, we want to cherry-pick the hell out of our target usage so we maximize the elegance and simple beauty while delivering something good for $FG,4$$TX,"Hymns",HTML="http://www.templeos.org/Wb/Home/Web/TAD/HymnVideos.html"$$FG$.
|
||||
|
||||
If we can define the vector space we hope to span, precisely, then we can leave the operating system on autopilot for future generations. They simply make the best possible solution to the vector space.
|
||||
|
||||
Knuth other literate coding homos are wrong -- if you have a well define way of doing things, it usually doesn't matter as long as it is consistent and easy to remember, so you don't vasillate. Try to do things in the way the computer naturally wants to do them. Don't be an arrogant French buffoon. Top-down is ridiculous because you have to make headers for every function. Bottom-up is how a computer wants to do it. In the past, there was a big-endian/little-endian battle. Little endian is obviously the way the computer naturally wants to operate.
|
||||
|
||||
Do not bloat a compiler with theoretical optimizations that bad programmers might require. We would rather teach them. As a matter of fact, there is a very straight forward way to convert the C language to machine code.
|
||||
|
||||
When I solicit line-of-code reducing optimizations, I plan to make it 100% objective, if possible, and chuckle at the fun, hard-to-understand hacks.
|
||||
|
||||
If you have ideas on how to make TempleOS more like Linux, I'm not interested. However, if you have ideas to make it more like the 8-bit computer generation operating systems or like DOS, I am interested. We want the creative spirit of the 8-bit generation of computers.
|
||||
|
||||
|
||||
$FG,5$$TX+CX,"TOS Linux SetUp"$$FG$
|
||||
|
||||
My Linux home directory is /home/tad
|
||||
I place all my files in /home/tad/TAD
|
||||
I place my scripts in /home/tad/TAD/Bin
|
||||
/home/tad/TAD/Bin is in my path.
|
||||
I place my icons in /home/tad/TAD/Desktop
|
||||
I copy D:/Home in and out of /home/tad/TAD/Home
|
||||
|
||||
When I make a back-up, I copy /home/tad/TAD to /home/tad/Archives/TAD170131
|
||||
|
||||
http://www.templeos.org /home/tad/TAD/Site1
|
||||
/home/tad/TAD/Site1Stale
|
||||
|
||||
Every month, I transfer my blog directory from Site1 to Site1Stale and remove it from TempleOS.
|
||||
|
||||
$FG,8$
|
||||
* "Linux" is a trademark owned by Linus Torvalds.
|
||||
* "Windows" is a trademark owned by MicroSoft Corp.
|
||||
Binary file not shown.
@@ -1,497 +0,0 @@
|
||||
//This is a customized version of $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$.
|
||||
//$MA-X+PU,"Diff",LM="WinMax;WinBorder;S2T(\"/*\",\"+r+S\");Diff(\"/Demo/ToHtmlToTXTDemo/ToHtml.HC.Z\",\"~/TOS/TOSToHtml.HC.Z\");View;"$
|
||||
|
||||
#help_index "DolDoc/Conversion"
|
||||
//See $LK,"::/Doc/Credits.DD"$.
|
||||
|
||||
#define DOCET_UNDEF_COLOR 0x100000000
|
||||
#define DOCET_LINK_UNDERLINE 0x200000000
|
||||
U0 HtmlPutS(CDoc *doc,I64 u32_attr,I64 *_old_u32_attr,Bool underline_update,
|
||||
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 (underline_update &&
|
||||
!(u32_attr&DOCET_UNDERLINE) && *_old_u32_attr&DOCET_UNDERLINE) {
|
||||
if (!(*_old_u32_attr&DOCET_LINK_UNDERLINE))
|
||||
DocPrint(doc,"</u>");
|
||||
*_old_u32_attr&=~DOCET_LINK_UNDERLINE;
|
||||
}
|
||||
if (!(u32_attr&DOCET_BLINK) && *_old_u32_attr&DOCET_BLINK)
|
||||
DocPrint(doc,"</blink>");
|
||||
|
||||
if (u32_attr&0xFF00!=*_old_u32_attr&0xFF00) {
|
||||
if (!(*_old_u32_attr&DOCET_UNDEF_COLOR))
|
||||
DocPrint(doc,"</span>");
|
||||
DocPrint(doc,"<span class=c%02X>",u32_attr.u8[1]);
|
||||
if (style_bitmap)
|
||||
LBts(style_bitmap,u32_attr.u8[1]);
|
||||
}
|
||||
if (u32_attr&DOCET_BLINK && !(*_old_u32_attr&DOCET_BLINK))
|
||||
DocPrint(doc,"<blink>");
|
||||
if (underline_update) {
|
||||
if (u32_attr&DOCET_UNDERLINE && !(*_old_u32_attr&DOCET_UNDERLINE))
|
||||
DocPrint(doc,"<u>");
|
||||
} else //Keep same underline status.
|
||||
u32_attr=u32_attr&~DOCET_UNDERLINE | *_old_u32_attr&DOCET_UNDERLINE;
|
||||
|
||||
*_old_u32_attr=u32_attr | *_old_u32_attr&DOCET_LINK_UNDERLINE;
|
||||
|
||||
while (ch=*st++) {
|
||||
switch (ch) {
|
||||
case '\t':
|
||||
do {
|
||||
DocPutKey(doc,CH_SPACE,0);
|
||||
*_col=*_col+1;
|
||||
} while (*_col&7);
|
||||
break;
|
||||
|
||||
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;
|
||||
end:
|
||||
DocPrint(doc,ptr);
|
||||
*_col=*_col+StrLen(ptr);
|
||||
break;
|
||||
|
||||
start:
|
||||
case CH_SHIFT_SPACE: ptr=" "; break;
|
||||
case '&': ptr="&"; break;
|
||||
case '<': ptr="<"; break;
|
||||
case '>': ptr=">"; break;
|
||||
case '"': ptr="""; break;
|
||||
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 *res=NULL,*st;
|
||||
if (filename) {
|
||||
st=ExtChg(filename,"html");
|
||||
if (st && StrLen(st)>3 && !StrNCmp(st+1,":/",2))
|
||||
res=MStrPrint(PERSONAL_WEB "/%s#l%d",st+3,line_num);
|
||||
Free(st);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
U8 *URLBibleGateway(U8 *src)
|
||||
{
|
||||
U8 buf[STR_LEN],*dst=buf;
|
||||
if (!MemCmp(src,"BF:",3))
|
||||
src+=3;
|
||||
while (*src) {
|
||||
if (*src==CH_SPACE || *src==',')
|
||||
*dst++='+';
|
||||
else
|
||||
*dst++=*src;
|
||||
src++;
|
||||
}
|
||||
*dst=0;
|
||||
if (StrOcc(buf,'-'))
|
||||
return MStrPrint(
|
||||
"http://www.biblegateway.com/passage/?search=%s&version=NIV",buf);
|
||||
else
|
||||
return MStrPrint(
|
||||
"http://www.biblegateway.com/verse/en/%s",buf);
|
||||
}
|
||||
|
||||
U8 *TOSLinkCvt1(U8 *link_st)
|
||||
{
|
||||
static CDoc *bible=NULL;
|
||||
static I64 locks=0;
|
||||
U8 *res=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:
|
||||
res=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))
|
||||
res=URLBibleGateway(link_st);
|
||||
LBtr(&locks,0);
|
||||
break;
|
||||
default:
|
||||
if (DocFileEd(i,filename,needle,&num,EDF_UNCOLLAPSE|EDF_BAIL))
|
||||
res=TOSLinkCvt2(filename,num);
|
||||
}
|
||||
Free(filename);
|
||||
Free(needle);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
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,Bool line_nums=FALSE)
|
||||
{//Cvt $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$doc to HTML file.
|
||||
CDocEntry *doc_e,*style,*doc_e2;
|
||||
I64 i,y,old_y=I64_MIN,col,old_u32_attr=DOCET_UNDEF_COLOR,old_attr,digits;
|
||||
U32 *hl,*src;
|
||||
U8 *st,st_2[2],*link_st,*style_bitmap=CAlloc(256/8);
|
||||
CBGR48 p[COLORS_NUM];
|
||||
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);
|
||||
digits=Log10(doc_in->head.last->y+1)+1;
|
||||
|
||||
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 V5.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->head.next;
|
||||
col=doc_e->x;
|
||||
y=doc_e->y;
|
||||
while (doc_e!=doc_in) {
|
||||
if (!(doc_e->de_flags&DOCEF_SKIP)) {
|
||||
if (y!=old_y) {
|
||||
if (line_anchors)
|
||||
DocPrint(doc_out,"<a name=\"l%d\"></a>",y+1);
|
||||
if (line_nums)
|
||||
DocPrint(doc_out,"%0*d ",digits,y+1);
|
||||
old_y=y;
|
||||
}
|
||||
while (y<doc_e->y) {
|
||||
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,&old_u32_attr,FALSE,
|
||||
"\n",&col,style_bitmap);
|
||||
if (++y!=old_y) {
|
||||
if (line_anchors)
|
||||
DocPrint(doc_out,"<a name=\"l%d\"></a>",y+1);
|
||||
if (line_nums)
|
||||
DocPrint(doc_out,"%0*d ",digits,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&~DOCET_UNDERLINE,
|
||||
&old_u32_attr,TRUE," ",&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&DOCET_UNDERLINE &&!(old_u32_attr&DOCET_LINK_UNDERLINE))
|
||||
DocPrint(doc_out,"</u>");
|
||||
if (old_u32_attr&DOCET_BLINK)
|
||||
DocPrint(doc_out,"</blink>");
|
||||
if (!(old_u32_attr&DOCET_UNDEF_COLOR))
|
||||
DocPrint(doc_out,"</span>");
|
||||
old_u32_attr=DOCET_UNDEF_COLOR|DOCET_UNDERLINE|DOCET_LINK_UNDERLINE;
|
||||
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_head,
|
||||
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,TRUE,
|
||||
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,TRUE,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,TRUE,
|
||||
"\t",&col,style_bitmap);
|
||||
break;
|
||||
case DOCT_HTML_CODE:
|
||||
if (old_u32_attr&DOCET_UNDERLINE &&
|
||||
!(old_u32_attr&DOCET_LINK_UNDERLINE))
|
||||
DocPrint(doc_out,"</u>");
|
||||
if (old_u32_attr&DOCET_BLINK)
|
||||
DocPrint(doc_out,"</blink>");
|
||||
if (!(old_u32_attr&DOCET_UNDEF_COLOR))
|
||||
DocPrint(doc_out,"</span>");
|
||||
old_u32_attr=DOCET_UNDEF_COLOR;
|
||||
DocPrint(doc_out,"%s",doc_e->tag);
|
||||
break;
|
||||
case DOCT_SPRITE:
|
||||
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
|
||||
&old_u32_attr,TRUE,doc_e->tag,&col,style_bitmap);
|
||||
HtmlPutS(doc_out,doc_e->settings.final_u32_attr,
|
||||
&old_u32_attr,TRUE,"/* 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,TRUE,doc_e->tag,&col,style_bitmap);
|
||||
}
|
||||
if (link_st) {
|
||||
if (old_u32_attr&DOCET_UNDERLINE &&!(old_u32_attr&DOCET_LINK_UNDERLINE))
|
||||
DocPrint(doc_out,"</u>");
|
||||
if (old_u32_attr&DOCET_BLINK)
|
||||
DocPrint(doc_out,"</blink>");
|
||||
if (!(old_u32_attr&DOCET_UNDEF_COLOR))
|
||||
DocPrint(doc_out,"</span>");
|
||||
DocPrint(doc_out,"</a>");
|
||||
old_u32_attr=DOCET_UNDEF_COLOR|DOCET_UNDERLINE|DOCET_LINK_UNDERLINE;
|
||||
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,TRUE,"\n",&col,style_bitmap);
|
||||
col=0;
|
||||
}
|
||||
if (old_u32_attr&DOCET_UNDERLINE && !(old_u32_attr&DOCET_LINK_UNDERLINE))
|
||||
DocPrint(doc_out,"</u>");
|
||||
if (old_u32_attr&DOCET_BLINK)
|
||||
DocPrint(doc_out,"</blink>");
|
||||
if (!(old_u32_attr&DOCET_UNDEF_COLOR))
|
||||
DocPrint(doc_out,"</span>");
|
||||
old_u32_attr=DOCET_UNDEF_COLOR;
|
||||
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->head;
|
||||
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,Bool line_nums=FALSE)
|
||||
{//Convert $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$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=ExtDft(_in_name,"HC.Z");
|
||||
if (_out_name)
|
||||
out_name=ExtDft(_out_name,"html");
|
||||
else
|
||||
out_name=ExtChg(_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,line_nums);
|
||||
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 "Misc/TOS"
|
||||
U0 TOSWebFile(U8 *name,Bool line_nums=FALSE)
|
||||
{
|
||||
U8 *name2;
|
||||
CDirEntry de;
|
||||
Bool line_anchors;
|
||||
if (FileFind(name,&de)) {
|
||||
Free(de.full_name);
|
||||
"File:%s\n",name;
|
||||
Collapse(name,FALSE);
|
||||
Touch(name,"",,de.datetime);
|
||||
name2=ExtChg(name,"html");
|
||||
|
||||
if (StrMatch(BLOG_BASE,name) || StrMatch(DAILY_BASE,name))
|
||||
line_anchors=FALSE;
|
||||
else
|
||||
line_anchors=TRUE;
|
||||
|
||||
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 V5.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",,line_anchors,,line_nums);
|
||||
Touch(name2,"",,de.datetime);
|
||||
Free(name2);
|
||||
}
|
||||
}
|
||||
|
||||
U0 FreshenWebDir(U8 *dirname,Bool line_nums=FALSE)
|
||||
{//No recurse
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
U8 *src,*dst;
|
||||
|
||||
src=MStrPrint("D:/Wb%s",dirname);
|
||||
DirMk(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);
|
||||
tmpde=tmpde1=FilesFind(src,FUF_JUST_FILES|FUF_JUST_TXT|FUF_CLUS_ORDER);
|
||||
while (tmpde) {
|
||||
TOSWebFile(tmpde->full_name,line_nums);
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirTreeDel(tmpde1);
|
||||
}
|
||||
|
||||
public U0 FreshenSite()
|
||||
{//Regen html files in D:/Wb
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
DocClear;
|
||||
Cd("D:/Wb");
|
||||
DelTree("D:/Wb/Home/Books1");
|
||||
DelTree("D:/Wb/Home/Books2");
|
||||
DelTree("D:/Wb/Home/Private");
|
||||
Del("D:/Wb/Home/*");
|
||||
Touch("D:/Wb/Home/Web/index.DD.Z","");
|
||||
Touch("D:/Wb/Home/Web/DownloadOS.DD.Z","");
|
||||
Touch("D:/Wb/Home/Web/TempleOS.DD.Z","");
|
||||
tmpde=tmpde1=FilesFind("*",
|
||||
FUF_RECURSE|FUF_JUST_FILES|FUF_JUST_TXT|FUF_CLUS_ORDER);
|
||||
while (tmpde) {
|
||||
TOSWebFile(tmpde->full_name);
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirTreeDel(tmpde1);
|
||||
FreshenWebDir("/Home/Sup1/Sup1Words",TRUE);
|
||||
Drv('C');
|
||||
}
|
||||
Reference in new issue
Block a user