diff --git a/docs/Demo/AcctExample/HomeSys.CC.html b/docs/Demo/AcctExample/HomeSys.CC.html
index 7f9dfba3..d91090c5 100755
--- a/docs/Demo/AcctExample/HomeSys.CC.html
+++ b/docs/Demo/AcctExample/HomeSys.CC.html
@@ -36,7 +36,7 @@ body {background-color:#1f1f1f;}
WinToTop;
WinZBufUpdate;
Dir;
- "\n95,264 LOC, ";
+ "\n95,267 LOC, ";
"%d MB RAM, ", MemBIOSTotal / 1024 / 1024;
CPURep;
"\n";
diff --git a/docs/Doc/Charter.DD.html b/docs/Doc/Charter.DD.html
index 072cfc42..bbf8d0fd 100755
--- a/docs/Doc/Charter.DD.html
+++ b/docs/Doc/Charter.DD.html
@@ -38,7 +38,7 @@ body {background-color:#1f1f1f;}
* Low line count and code complexity is the highest good, so it is easy to learn the whole thing. Users should see the light
at the end of the tunnel. One file system, for example, is better than many file systems.
-* There is a limit of 100,000 lines of code for all time, not including applications and demos. Currently, there are 95,264
+* There is a limit of 100,000 lines of code for all time, not including applications and demos. Currently, there are 95,267
lines of code. 3rd party libraries are banned because they circumvent the intent of this limit. The vision is a Commodore 64
ROM -- a fixed core API that is the only dependency of applications. Dependency on components and libraries creates a hell
that is no longer blissful.
diff --git a/docs/Doc/MemoryOverview.DD.html b/docs/Doc/MemoryOverview.DD.html
index 9e97013c..cc99481e 100755
--- a/docs/Doc/MemoryOverview.DD.html
+++ b/docs/Doc/MemoryOverview.DD.html
@@ -39,8 +39,8 @@ body {background-color:#1f1f1f;}
You can create new, independent heaps using HeapCtrlInit(). Then, use the CHeapCtrl as the 2nd arg to MAlloc(). See HeapLog()
for an example.
-Memory alloced by a task will be freed when the task is killed. The System Task is a task that never dies. His memory is like
-kernel memory in other operating systems. See SysCAlloc(), SysMAlloc(), SysMAllocIdent() and SysStrNew().
+Memory alloced by a task will be freed when the task is killed. The System Task is a task that never dies. It's memory is
+like kernel memory in other operating systems. See SysCAlloc(), SysMAlloc(), SysMAllocIdent() and SysStrNew().
All of the regular page tables are marked, "cached". When accessing hardware, however, you need uncached page table. The
lowest 4Gig addresses have an alias to access hardware located toward the top of mapped space, 0x01D7800000. See
diff --git a/docs/Doc/Welcome.DD.html b/docs/Doc/Welcome.DD.html
index 362dad37..a03def81 100755
--- a/docs/Doc/Welcome.DD.html
+++ b/docs/Doc/Welcome.DD.html
@@ -37,7 +37,7 @@ body {background-color:#1f1f1f;}
Simplicity is a goal to keep the line count down, so it's easy to tinker with. As it turns-out, simplicity makes it faster in
some ways, too. It never switches privilege levels, never changes address maps, tends to load whole contiguous files and
-other, similar things which boost speed. It's only 95,264 lines of code including the kernel, the 64-bit compiler, the
+other, similar things which boost speed. It's only 95,267 lines of code including the kernel, the 64-bit compiler, the
graphics library and all the tools. More importantly, it's designed to keep the user's line count down -- you can do a
Hello World application in one line of code and can put graphics on the screen with a three line program!
diff --git a/docs/Home/Net/Programs/Gopher.CC.html b/docs/Home/Net/Programs/Gopher.CC.html
index e4be1f56..6597ce85 100755
--- a/docs/Home/Net/Programs/Gopher.CC.html
+++ b/docs/Home/Net/Programs/Gopher.CC.html
@@ -64,7 +64,7 @@ body {background-color:#1f1f1f;}
line = StrPrint(NULL, "%s\t%s\r\n", selector, query);
}
- sock(CTCPSocket *)->timeout = TCP_TIMEOUT * 5;
+ sock(CTCPSocket *)->timeout = TCP_TIMEOUT;
// sendString(sock, line, 0);
TCPSocketSendString(sock, line);
@@ -107,260 +107,262 @@ body {background-color:#1f1f1f;}
}
f->de.size = total_len;
FClose(f);
- return got;
- }
- data_len += got;
- total_len += got;
- progress4 += got;
- if (data_len == BLK_SIZE)
- {
- if (!FBlkWrite(f, buf))
- {
- break;
- }
- data_len = 0;
- }
- }
-
- PrintErr("Write failed, %s may be corrupted\n", dest);
- FClose(f);
- return -1;
-
-}
+ TCPSocketClose(sock);
+ return got;
+ }
+ data_len += got;
+ total_len += got;
+ progress4 += got;
+ if (data_len == BLK_SIZE)
+ {
+ if (!FBlkWrite(f, buf))
+ {
+ break;
+ }
+ data_len = 0;
+ }
+ }
+
+ TCPSocketClose(sock);
+ PrintErr("Write failed, %s may be corrupted\n", dest);
+ FClose(f);
+ return -1;
-U0 PrintEscaped(U8 *txt, U8 *backslashes = "")
-{
- U8 *cur;
- U64 offending;
-
- while (cur = StrFirstOcc(txt, "$\\\""))
- {
- offending = *cur;
- *cur = 0;
- if (offending == '$')
- {
- "%s$$", txt;
- }
- else
- {
- "%s%s%c", txt, backslashes, offending;
- }
- txt = cur + 1;
- }
-
- "%s", txt;
-}
-
-U8 *GopherBasename(U8 *selector)
-{
- U8 *lastslash = StrLastOcc(selector, "/"), *result;
-
- if (lastslash == NULL)
- {
- result = selector;
- }
- else
- {
- result = lastslash + 1;
- }
-
- //BAD FOR FILENAMES: ? / | = % : ; * + " < > space
- result = StrReplace(result, "?", "");
- result = StrReplace(result, "/", "",, TRUE);
- result = StrReplace(result, "|", "",, TRUE);
- result = StrReplace(result, "=", "",, TRUE);
- result = StrReplace(result, "%", "",, TRUE);
- result = StrReplace(result, ":", "",, TRUE);
- result = StrReplace(result, ";", "",, TRUE);
- result = StrReplace(result, "*", "",, TRUE);
- result = StrReplace(result, "+", "",, TRUE);
- result = StrReplace(result, "\"", "",, TRUE);
- result = StrReplace(result, "<", "",, TRUE);
- result = StrReplace(result, ">", "",, TRUE);
- result = StrReplace(result, " ", "",, TRUE);
-
- SysLog("%s\n", result);
+}
+
+U0 PrintEscaped(U8 *txt, U8 *backslashes = "")
+{
+ U8 *cur;
+ U64 offending;
+
+ while (cur = StrFirstOcc(txt, "$\\\""))
+ {
+ offending = *cur;
+ *cur = 0;
+ if (offending == '$')
+ {
+ "%s$$", txt;
+ }
+ else
+ {
+ "%s%s%c", txt, backslashes, offending;
+ }
+ txt = cur + 1;
+ }
+
+ "%s", txt;
+}
+
+U8 *GopherBasename(U8 *selector)
+{
+ U8 *lastslash = StrLastOcc(selector, "/"), *result;
+
+ if (lastslash == NULL)
+ {
+ result = selector;
+ }
+ else
+ {
+ result = lastslash + 1;
+ }
+
+ //BAD FOR FILENAMES: ? / | = % : ; * + " < > space
+ result = StrReplace(result, "?", "");
+ result = StrReplace(result, "/", "",, TRUE);
+ result = StrReplace(result, "|", "",, TRUE);
+ result = StrReplace(result, "=", "",, TRUE);
+ result = StrReplace(result, "%", "",, TRUE);
+ result = StrReplace(result, ":", "",, TRUE);
+ result = StrReplace(result, ";", "",, TRUE);
+ result = StrReplace(result, "*", "",, TRUE);
+ result = StrReplace(result, "+", "",, TRUE);
+ result = StrReplace(result, "\"", "",, TRUE);
+ result = StrReplace(result, "<", "",, TRUE);
+ result = StrReplace(result, ">", "",, TRUE);
+ result = StrReplace(result, " ", "",, TRUE);
- return result;
-}
-
-U0 GopherTextView(U8 *host, U16 port, U8 *selector)
-{
- U8 *basename;
- U8 *tmpname;
-
- DirMake("::/Tmp/Gopher");
+ SysLog("%s\n", result);
+
+ return result;
+}
+
+U0 GopherTextView(U8 *host, U16 port, U8 *selector)
+{
+ U8 *basename;
+ U8 *tmpname;
- tmpname = StrNew(selector);
- if (StrLen(tmpname) > 22)
- tmpname[21] = 0; // too long, terminate it early
- basename = ExtChange(GopherBasename(tmpname), "TXT");
- Free(tmpname);
- tmpname = StrPrint(NULL, "::/Tmp/Gopher/%s", basename);
- Free(basename);
-
- if (GopherDl(host, port, selector,, tmpname) == 0)
- {
- SysLog("%s\n", tmpname);
- Plain(tmpname);
- }
- else
- {
- PrintErr("Failed to download %s from %s:%d\n",
- selector, host, port);
- }
- Free(tmpname);
-}
-
-U0 GopherLine(U8 *line)
-{
- U64 type;
- U8 *display;
- U8 *selector;
- U8 *host = NULL;
- U16 port = 0;
-
- if (*line == 0)
- {
- "\n";
- return;
- }
- type = *line++;
- display = line;
-
- line = StrFind("\t", line);
- if (line)
- {
- *line = 0;
- line++;
- }
- selector = line;
-
- if (line)
- {
- line = StrFind("\t", line);
- }
- if (line)
- {
- *line = 0;
- line++;
- }
- host = line;
-
- if (line)
- {
- line = StrFind("\t", line);
- }
- if (line)
- {
- *line = 0;
- line++;
- port = Str2I64(line);
- }
-
- if (!*host)
- return;
-
- switch (type)
- {
- case '3':
- PrintErr("");
- case 'i':
- PrintEscaped(display);
- break;
- default:
- "$MA,\"";
- PrintEscaped(display, "\\");
- "\",LM=\"%s(\\\"", gopher_associations[type];
- PrintEscaped(host, "\\\\\\");
- "\\\",%d,\\\"", port;
- PrintEscaped(selector, "\\\\\\");
- "\\\");\\n\"$";
- }
- "\n";
-}
-
-public I64 GopherMenu(U8 *host, U16 port = 70, U8 *selector = "/", U8 *query = NULL)
-{
- I64 sock, n;
- U8 buf[256];
-
- sock = GopherOpen(host, port, selector, query);
- if (sock <= 0)
- {
- return sock;
- }
-
- do
- {
-// n = recvLine(sock, buf, sizeof(buf), 0);
- n = TCPSocketReceiveLine(sock, buf, sizeof(buf));
- if (StrCompare(buf, ".") == 0)
- {
- break;
- }
- GopherLine(buf);
- }
- while (n > 0);
-
-// close(sock);
- TCPSocketClose(sock);
- return 0;
-}
-
-class CQueryForm
-{
- U8 query[65] format "$DA-P,A=\"Query:%s\"$";
-};
-U0 GopherQueryPrompt(U8 *host, U16 port, U8 *selector)
-{
- CQueryForm form;
-
- form.query[0] = 0;
- if (PopUpForm(&form))
- {
- GopherMenu(host, port, selector, form.query);
- }
-}
-
-class CDlForm
-{
- U8 name[256] format "$DA-P,LEN=255,A=\"FileName:%s\"$";
-};
-U0 GopherDlPrompt(U8 *host, U16 port, U8 *selector)
-{
- CDlForm form;
- U8 *basename;
-
- basename = GopherBasename(selector);
- MemSet(form.name, 0, 256);
- MemCopy(form.name, basename,
- MinI64(StrLen(basename), sizeof(form.name) - 1));
- form.name[255] = 0;
- if (PopUpForm(&form))
- {
- if (StrLen(form.name) >= 26)
- form.name[25] = 0;
- GopherDl(host, port, selector,, form.name);
- }
-}
-
-public I64 Gopher(U8 *hostname)
-{
- return GopherMenu(hostname);
-}
-
-MemSetI64(gopher_associations, "GopherDlPrompt", 256);
-gopher_associations['0'] = "GopherTextView";
-gopher_associations['1'] = "GopherMenu";
-gopher_associations['7'] = "GopherQueryPrompt";
-/* Include this file from your Net/Load.CC, then add more associations */
-
-
-DocMax;
-"\n\nTry using Gopher to connect to a gopher server, for example:"
-"\n\n Gopher(\"gopher.floodgap.com\");"
-"\n\n GopherMenu(\"eyeblea.ch\",70,\"/~zealos\");"
-"\n\n Gopher(\"codevoid.de\");"
-"\n\n";