about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2007-07-02 00:15:38 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2007-07-02 00:15:38 -0400
commit387b9cbf38dddc3adbb811e03345576e35df3725 (patch)
tree90940c6cde94dc67ef37e97561580435b9469b9e /src
parentfa5da88cfe856e4c69d3dfb12e68bb56d0c69c9e (diff)
downloadlynx-snapshots-387b9cbf38dddc3adbb811e03345576e35df3725.tar.gz
snapshot of project "lynx", label v2-8-7dev_5b
Diffstat (limited to 'src')
-rw-r--r--src/LYCurses.c15
-rw-r--r--src/LYCurses.h3
-rw-r--r--src/LYDownload.c9
-rw-r--r--src/LYMain.c30
-rw-r--r--src/LYMainLoop.c14
-rw-r--r--src/LYOptions.c14
-rw-r--r--src/LYPrint.c9
-rw-r--r--src/LYStrings.c4
-rw-r--r--src/UCdomap.c4
-rw-r--r--src/chrtrans/def7_uni.tbl3
-rw-r--r--src/chrtrans/make-msc.bat50
-rw-r--r--src/chrtrans/makehdrs.bat50
-rw-r--r--src/chrtrans/makew32.bat49
-rw-r--r--src/tcpipolb.opt1
-rw-r--r--src/tcpipshr.opt1
15 files changed, 115 insertions, 141 deletions
diff --git a/src/LYCurses.c b/src/LYCurses.c
index dd0f1d24..a25a20d0 100644
--- a/src/LYCurses.c
+++ b/src/LYCurses.c
@@ -1,3 +1,4 @@
+/* $LynxId: LYCurses.c,v 1.129 2007/07/02 00:11:35 tom Exp $ */
 #include <HTUtils.h>
 #include <HTAlert.h>
 
@@ -2776,6 +2777,20 @@ void lynx_stop_underline(void)
     stop_underline();
 }
 
+void LYSetDisplayLines(void)
+{
+    if (!no_title) {
+	if (user_mode == NOVICE_MODE)
+	    display_lines = LYlines - 4;
+	else
+	    display_lines = LYlines - 2;
+    } else if (user_mode == NOVICE_MODE) {
+	display_lines = LYlines - 3;
+    } else {
+	display_lines = LYlines - 1;
+    }
+}
+
 /*
  * If LYShowCursor is ON, move the cursor to the left of the current option, so
  * that blind users, who are most likely to have LYShowCursor ON, will have
diff --git a/src/LYCurses.h b/src/LYCurses.h
index 956033d1..41dbf648 100644
--- a/src/LYCurses.h
+++ b/src/LYCurses.h
@@ -1,4 +1,4 @@
-/* $LynxId: LYCurses.h,v 1.76 2007/05/06 20:46:34 tom Exp $ */
+/* $LynxId: LYCurses.h,v 1.77 2007/07/02 00:09:00 tom Exp $ */
 #ifndef LYCURSES_H
 #define LYCURSES_H
 
@@ -806,6 +806,7 @@ FANCY_CURSES.  Check your config.log to see why the FANCY_CURSES test failed.
 #endif
 
     extern void LYstowCursor(WINDOW * win, int row, int col);
+    extern void LYSetDisplayLines(void);
 
 #ifdef __cplusplus
 }
diff --git a/src/LYDownload.c b/src/LYDownload.c
index 3025f586..adf4cf47 100644
--- a/src/LYDownload.c
+++ b/src/LYDownload.c
@@ -1,3 +1,4 @@
+/* $LynxId: LYDownload.c,v 1.58 2007/07/01 23:39:32 Andrew.Belov Exp $ */
 #include <HTUtils.h>
 #include <HTParse.h>
 #include <HTList.h>
@@ -155,7 +156,7 @@ void LYDownload(char *line)
 		}
 		if (FnameNum >= FnameTotal) {
 		    /*
-		     * Reset the FirstRecall flag, and use sug_file or a blank. 
+		     * Reset the FirstRecall flag, and use sug_file or a blank.
 		     * - FM
 		     */
 		    FirstRecall = TRUE;
@@ -187,7 +188,7 @@ void LYDownload(char *line)
 		}
 		if (FnameNum < 0) {
 		    /*
-		     * Set the FirstRecall flag, and use sug_file or a blank. 
+		     * Set the FirstRecall flag, and use sug_file or a blank.
 		     * - FM
 		     */
 		    FirstRecall = TRUE;
@@ -467,7 +468,7 @@ static int SuffixIs(char *filename, const char *suffix)
 /*
  * LYdownload_options writes out the current download choices to a file so that
  * the user can select downloaders in the same way that they select all other
- * links.  Download links look like: 
+ * links.  Download links look like:
  * LYNXDOWNLOAD://Method=<#>/File=<STRING>/SugFile=<STRING>
  */
 int LYdownload_options(char **newfile, char *data_file)
@@ -513,7 +514,7 @@ int LYdownload_options(char **newfile, char *data_file)
 	    ? gettext("Standard download options:")
 	    : gettext("Download options:"));
 
-    if (!no_disk_save && !child_lynx) {
+    if (!no_disk_save) {
 #if defined(DIRED_SUPPORT)
 	/*
 	 * Disable save to disk option for local files.
diff --git a/src/LYMain.c b/src/LYMain.c
index 53d2fbd4..90020c92 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYMain.c,v 1.171 2007/05/13 22:45:47 Chuck.Houpt Exp $ */
+/* $LynxId: LYMain.c,v 1.174 2007/07/02 00:07:27 tom Exp $ */
 #include <HTUtils.h>
 #include <HTTP.h>
 #include <HTParse.h>
@@ -1292,7 +1292,7 @@ int main(int argc,
      * feature is to allow for the potentially very long command line that can
      * be associated with post or get data.  The original implementation
      * required that the lone "-" be the only command line argument, but that
-     * precluded its use when the lynx command is aliased with other arguments. 
+     * precluded its use when the lynx command is aliased with other arguments.
      * When interactive, the stdin input is terminated by by Control-D on Unix
      * or Control-Z on VMS, and each argument is terminated by a RETURN.  When
      * the argument is -get_data or -post_data, the data are terminated by a
@@ -2143,7 +2143,7 @@ int main(int argc,
 #endif
 #ifdef USE_PERSISTENT_COOKIES
 	/*
-	 * We want to save cookies picked up when in immediate dump mode. 
+	 * We want to save cookies picked up when in immediate dump mode.
 	 * Instead of calling cleanup() here, let's only call this one.  - BJP
 	 */
 	if (persistent_cookies)
@@ -2173,7 +2173,6 @@ int main(int argc,
 	status = mainloop();
 	LYCloseCloset(RECALL_URL);
 	LYCloseCloset(RECALL_MAIL);
-	cleanup();
 #if defined(PDCURSES) && defined(PDC_BUILD) && PDC_BUILD >= 2401
 	if (!isendwin()) {
 	    if ((saved_scrsize_x != 0) && (saved_scrsize_y != 0)) {
@@ -2181,6 +2180,7 @@ int main(int argc,
 	    }
 	}
 #endif
+	cleanup();
 	exit_immediately(status);
     }
 
@@ -2188,7 +2188,7 @@ int main(int argc,
 }
 
 /*
- * Called by HTAccessInit to register any protocols supported by lynx. 
+ * Called by HTAccessInit to register any protocols supported by lynx.
  * Protocols added by lynx:
  *    LYNXKEYMAP, lynxcgi, LYNXIMGMAP, LYNXCOOKIE, LYNXMESSAGES
  */
@@ -2328,11 +2328,7 @@ void reload_read_cfg(void)
 	/*
 	 * Initialize other things based on the configuration read.
 	 */
-	if (user_mode == NOVICE_MODE) {
-	    display_lines = LYlines - 4;
-	} else {
-	    display_lines = LYlines - 2;
-	}
+	LYSetDisplayLines();
 	/* Not implemented yet here,
 	 * a major problem: file paths
 	 * like lynx_save_space, LYCookieFile etc.
@@ -2534,6 +2530,14 @@ static int child_fun(char *next_arg GCC_UNUSED)
 {
     child_lynx = TRUE;
     no_disk_save = TRUE;
+    no_mail = TRUE;
+    return 0;
+}
+
+/* -child_relaxed */
+static int child_relaxed_fun(char *next_arg GCC_UNUSED)
+{
+    child_lynx = TRUE;
     return 0;
 }
 
@@ -2679,7 +2683,7 @@ static int get_data_fun(char *next_arg GCC_UNUSED)
     char *buf = NULL;
 
     /*
-     * On Unix, conflicts with curses when interactive so let's force a dump. 
+     * On Unix, conflicts with curses when interactive so let's force a dump.
      * -CL
      *
      * On VMS, mods have been made in LYCurses.c to deal with potential
@@ -3323,6 +3327,10 @@ static Config_Type Arg_Table [] =
       "child",		4|FUNCTION_ARG,		child_fun,
       "exit on left-arrow in startfile, and disable save to disk"
    ),
+   PARSE_FUN(
+      "child_relaxed",	4|FUNCTION_ARG,		child_relaxed_fun,
+      "exit on left-arrow in startfile (allows save to disk)"
+   ),
 #ifdef EXP_CMD_LOGGING
    PARSE_STR(
        "cmd_log",	2|NEED_LYSTRING_ARG,	lynx_cmd_logfile,
diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c
index 95e16bdd..f3327629 100644
--- a/src/LYMainLoop.c
+++ b/src/LYMainLoop.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYMainLoop.c,v 1.146 2007/05/13 16:16:30 tom Exp $ */
+/* $LynxId: LYMainLoop.c,v 1.148 2007/07/02 00:09:22 tom Exp $ */
 #include <HTUtils.h>
 #include <HTAccess.h>
 #include <HTParse.h>
@@ -5330,10 +5330,7 @@ int mainloop(void)
     FREE(form_post_data);
     FREE(form_get_data);
 
-    if (user_mode == NOVICE_MODE)
-	display_lines = LYlines - 4;
-    else
-	display_lines = LYlines - 2;
+    LYSetDisplayLines();
 
     while (TRUE) {
 #ifdef USE_COLOR_STYLE
@@ -6075,11 +6072,8 @@ int mainloop(void)
 	    if (HTMainText)	/* to REALLY force it... - kw */
 		HText_setStale(HTMainText);
 	    recent_sizechange = FALSE;
-	    if (user_mode == NOVICE_MODE) {
-		display_lines = LYlines - 4;
-	    } else {
-		display_lines = LYlines - 2;
-	    }
+
+	    LYSetDisplayLines();
 	}
 
 	if (www_search_result != -1) {
diff --git a/src/LYOptions.c b/src/LYOptions.c
index 36609348..c9e57226 100644
--- a/src/LYOptions.c
+++ b/src/LYOptions.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYOptions.c,v 1.120 2007/05/06 19:08:41 tom Exp $ */
+/* $LynxId: LYOptions.c,v 1.121 2007/07/02 00:09:49 tom Exp $ */
 #include <HTUtils.h>
 #include <HTFTP.h>
 #include <HTTP.h>		/* 'reloading' flag */
@@ -1411,11 +1411,7 @@ void LYoptions(void)
 		}
 #endif /* VMS || USE_SLANG */
 	    }
-	    if (user_mode == NOVICE_MODE) {
-		display_lines = (LYlines - 4);
-	    } else {
-		display_lines = LYlines - 2;
-	    }
+	    LYSetDisplayLines();
 	    response = ' ';
 	    if (LYSelectPopups) {
 		HANDLE_LYOPTIONS;
@@ -2886,11 +2882,7 @@ int postoptions(DocInfo *newdoc)
 	/* User Mode: SELECT */
 	if (!strcmp(data[i].tag, user_mode_string)
 	    && GetOptValues(user_mode_values, data[i].value, &user_mode)) {
-	    if (user_mode == NOVICE_MODE) {
-		display_lines = (LYlines - 4);
-	    } else {
-		display_lines = LYlines - 2;
-	    }
+	    LYSetDisplayLines();
 	}
 
 	/* Type of visited pages page: SELECT */
diff --git a/src/LYPrint.c b/src/LYPrint.c
index 8e6df0de..bd881f79 100644
--- a/src/LYPrint.c
+++ b/src/LYPrint.c
@@ -1,3 +1,4 @@
+/* $LynxId: LYPrint.c,v 1.84 2007/07/01 23:39:36 Andrew.Belov Exp $ */
 #include <HTUtils.h>
 #include <HTAccess.h>
 #include <HTList.h>
@@ -1182,7 +1183,7 @@ static int remove_quotes(char *string)
 #endif /* USE_VMS_MAILER */
 
 /*
- * Mail subject may have 8-bit characters and they are in display charset. 
+ * Mail subject may have 8-bit characters and they are in display charset.
  * There is no stable practice for 8-bit subject encodings:  MIME defines
  * "quoted-printable" which holds charset info but most mailers still don't
  * support it.  On the other hand many mailers send open 8-bit subjects without
@@ -1266,7 +1267,7 @@ int print_options(char **newfile,
     fputs(buffer, fp0);
     FREE(buffer);
 
-    if (no_print || no_disk_save || child_lynx || no_mail)
+    if (no_print || no_disk_save || no_mail)
 	fprintf(fp0,
 		"   <em>%s</em>\n",
 		gettext("Some print functions have been disabled!"));
@@ -1276,7 +1277,7 @@ int print_options(char **newfile,
 	    ? gettext("Standard print options:")
 	    : gettext("Print options:"));
 
-    if (child_lynx == FALSE && no_disk_save == FALSE && no_print == FALSE) {
+    if (no_disk_save == FALSE && no_print == FALSE) {
 	fprintf(fp0,
 		"   <a href=\"%s//LOCAL_FILE/lines=%d\">%s</a>\n",
 		STR_LYNXPRINT,
@@ -1285,7 +1286,7 @@ int print_options(char **newfile,
     } else {
 	fprintf(fp0, "   <em>%s</em>\n", gettext("Save to disk disabled"));
     }
-    if (child_lynx == FALSE && no_mail == FALSE && local_host_only == FALSE)
+    if (no_mail == FALSE && local_host_only == FALSE)
 	fprintf(fp0,
 		"   <a href=\"%s//MAIL_FILE/lines=%d\">%s</a>\n",
 		STR_LYNXPRINT,
diff --git a/src/LYStrings.c b/src/LYStrings.c
index d7c5acef..92f386f8 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYStrings.c,v 1.126 2007/05/23 00:30:24 tom Exp $ */
+/* $LynxId: LYStrings.c,v 1.127 2007/07/01 23:16:31 Daniel.Dickman Exp $ */
 #include <HTUtils.h>
 #include <HTCJK.h>
 #include <UCAux.h>
@@ -5729,7 +5729,7 @@ char *LYSafeGets(char **src,
     if (result != 0)
 	*result = 0;
 
-    while (fgets(buffer, sizeof(buffer), fp) != 0) {
+    while (fgets(buffer, sizeof(buffer), fp) != NULL) {
 	if (*buffer)
 	    result = StrAllocCat(result, buffer);
 	if (strchr(buffer, '\n') != 0)
diff --git a/src/UCdomap.c b/src/UCdomap.c
index 20a47059..61452112 100644
--- a/src/UCdomap.c
+++ b/src/UCdomap.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: UCdomap.c,v 1.65 2007/05/13 16:09:19 Thorsten.Glaser Exp $
+ * $LynxId: UCdomap.c,v 1.66 2007/07/01 22:02:38 Thorsten.Glaser Exp $
  *
  *  UCdomap.c
  *  =========
@@ -954,7 +954,7 @@ int UCTransUniCharStr(char *outbuf,
 	    HTSprintf0(&tocode, "%s//TRANSLIT", LYCharSet_UC[charset_out].MIMEname);
 	    cd = iconv_open(tocode, "UTF-16BE");
 	    FREE(tocode);
-	    if (cd == (iconv_t) - 1)
+	    if (cd == (iconv_t) (-1))
 		cd = iconv_open(LYCharSet_UC[charset_out].MIMEname, "UTF-16BE");
 	    rc = iconv(cd, &pin, &inleft, &pout, &outleft);
 	    iconv_close(cd);
diff --git a/src/chrtrans/def7_uni.tbl b/src/chrtrans/def7_uni.tbl
index 73731c25..0c6cac2b 100644
--- a/src/chrtrans/def7_uni.tbl
+++ b/src/chrtrans/def7_uni.tbl
@@ -1,3 +1,4 @@
+# $LynxId: def7_uni.tbl,v 1.26 2007/06/24 23:47:14 tom Exp $
 # Default 7bit replacements.
 #
 # This table is very important and should not be excluded from the distribution
@@ -1551,7 +1552,7 @@ U+220d:-)
 U+220e " qed"
 U+220f:\prod
 U+2211:\sum
-U+2212: -
+U+2212:-
 U+2213:-/+
 U+2214:.+
 0x2f	U+2215
diff --git a/src/chrtrans/make-msc.bat b/src/chrtrans/make-msc.bat
index 58e00cee..e9fbacf7 100644
--- a/src/chrtrans/make-msc.bat
+++ b/src/chrtrans/make-msc.bat
@@ -1,52 +1,6 @@
-@echo If .tbl files are added or removed you will need to hand edit

-@echo this batch file.

-@echo .

+@rem $LynxId: make-msc.bat,v 1.5 2007/06/28 21:07:24 tom Exp $

 @echo off

 

 nmake -f makefile.msc

 

-makeuctb cp1250_uni.tbl

-makeuctb cp1251_uni.tbl

-makeuctb cp1252_uni.tbl

-makeuctb cp1253_uni.tbl

-makeuctb cp1255_uni.tbl

-makeuctb cp1256_uni.tbl

-makeuctb cp1257_uni.tbl

-makeuctb cp437_uni.tbl

-makeuctb cp737_uni.tbl

-makeuctb cp775_uni.tbl

-makeuctb cp850_uni.tbl

-makeuctb cp852_uni.tbl

-makeuctb cp857_uni.tbl

-makeuctb cp862_uni.tbl

-makeuctb cp864_uni.tbl

-makeuctb cp866_uni.tbl

-makeuctb cp866u_uni.tbl

-makeuctb cp869_uni.tbl

-makeuctb def7_uni.tbl

-makeuctb dmcs_uni.tbl

-makeuctb hp_uni.tbl

-makeuctb iso01_uni.tbl

-makeuctb iso02_uni.tbl

-makeuctb iso03_uni.tbl

-makeuctb iso04_uni.tbl

-makeuctb iso05_uni.tbl

-makeuctb iso06_uni.tbl

-makeuctb iso07_uni.tbl

-makeuctb iso08_uni.tbl

-makeuctb iso09_uni.tbl

-makeuctb iso10_uni.tbl

-makeuctb iso13_uni.tbl

-makeuctb iso14_uni.tbl

-makeuctb iso15_uni.tbl

-makeuctb koi8r_uni.tbl

-makeuctb koi8u_uni.tbl

-makeuctb mac_uni.tbl

-makeuctb mnem_suni.tbl

-makeuctb mnem2_suni.tbl

-makeuctb mnem_suni.tbl

-makeuctb next_uni.tbl

-makeuctb pt154_uni.tbl

-makeuctb rfc_suni.tbl

-makeuctb utf8_uni.tbl

-makeuctb viscii_uni.tbl

+call makehdrs

diff --git a/src/chrtrans/makehdrs.bat b/src/chrtrans/makehdrs.bat
new file mode 100644
index 00000000..2edbef7c
--- /dev/null
+++ b/src/chrtrans/makehdrs.bat
@@ -0,0 +1,50 @@
+@rem $LynxId: makehdrs.bat,v 1.1 2007/06/28 21:50:29 tom Exp $

+@echo If .tbl files are added or removed you will need to hand edit

+@echo this batch file.

+@echo .

+@echo off

+

+makeuctb cp1250_uni.tbl

+makeuctb cp1251_uni.tbl

+makeuctb cp1252_uni.tbl

+makeuctb cp1253_uni.tbl

+makeuctb cp1255_uni.tbl

+makeuctb cp1256_uni.tbl

+makeuctb cp1257_uni.tbl

+makeuctb cp437_uni.tbl

+makeuctb cp737_uni.tbl

+makeuctb cp775_uni.tbl

+makeuctb cp850_uni.tbl

+makeuctb cp852_uni.tbl

+makeuctb cp857_uni.tbl

+makeuctb cp862_uni.tbl

+makeuctb cp864_uni.tbl

+makeuctb cp866_uni.tbl

+makeuctb cp866u_uni.tbl

+makeuctb cp869_uni.tbl

+makeuctb def7_uni.tbl

+makeuctb dmcs_uni.tbl

+makeuctb hp_uni.tbl

+makeuctb iso01_uni.tbl

+makeuctb iso02_uni.tbl

+makeuctb iso03_uni.tbl

+makeuctb iso04_uni.tbl

+makeuctb iso05_uni.tbl

+makeuctb iso06_uni.tbl

+makeuctb iso07_uni.tbl

+makeuctb iso08_uni.tbl

+makeuctb iso09_uni.tbl

+makeuctb iso10_uni.tbl

+makeuctb iso13_uni.tbl

+makeuctb iso14_uni.tbl

+makeuctb iso15_uni.tbl

+makeuctb koi8r_uni.tbl

+makeuctb koi8u_uni.tbl

+makeuctb mac_uni.tbl

+makeuctb mnem2_suni.tbl

+makeuctb mnem_suni.tbl

+makeuctb next_uni.tbl

+makeuctb pt154_uni.tbl

+makeuctb rfc_suni.tbl

+makeuctb utf8_uni.tbl

+makeuctb viscii_uni.tbl

diff --git a/src/chrtrans/makew32.bat b/src/chrtrans/makew32.bat
index d80663a1..da476010 100644
--- a/src/chrtrans/makew32.bat
+++ b/src/chrtrans/makew32.bat
@@ -1,6 +1,4 @@
-@echo If .tbl files are added or removed you will need to hand edit

-@echo this batch file.

-@echo .

+@rem $LynxId: makew32.bat,v 1.6 2007/06/28 21:07:24 tom Exp $

 @echo off

 

 if "%1"=="" goto normal

@@ -10,49 +8,6 @@ goto done
 :normal

 make -l -f makefile.bcb

 

-makeuctb cp1250_uni.tbl

-makeuctb cp1251_uni.tbl

-makeuctb cp1252_uni.tbl

-makeuctb cp1253_uni.tbl

-makeuctb cp1255_uni.tbl

-makeuctb cp1256_uni.tbl

-makeuctb cp1257_uni.tbl

-makeuctb cp437_uni.tbl

-makeuctb cp737_uni.tbl

-makeuctb cp775_uni.tbl

-makeuctb cp850_uni.tbl

-makeuctb cp852_uni.tbl

-makeuctb cp857_uni.tbl

-makeuctb cp862_uni.tbl

-makeuctb cp864_uni.tbl

-makeuctb cp866_uni.tbl

-makeuctb cp866u_uni.tbl

-makeuctb cp869_uni.tbl

-makeuctb def7_uni.tbl

-makeuctb dmcs_uni.tbl

-makeuctb hp_uni.tbl

-makeuctb iso01_uni.tbl

-makeuctb iso02_uni.tbl

-makeuctb iso03_uni.tbl

-makeuctb iso04_uni.tbl

-makeuctb iso05_uni.tbl

-makeuctb iso06_uni.tbl

-makeuctb iso07_uni.tbl

-makeuctb iso08_uni.tbl

-makeuctb iso09_uni.tbl

-makeuctb iso10_uni.tbl

-makeuctb iso13_uni.tbl

-makeuctb iso14_uni.tbl

-makeuctb iso15_uni.tbl

-makeuctb koi8r_uni.tbl

-makeuctb koi8u_uni.tbl

-makeuctb mac_uni.tbl

-makeuctb mnem2_suni.tbl

-makeuctb mnem_suni.tbl

-makeuctb next_uni.tbl

-makeuctb pt154_uni.tbl

-makeuctb rfc_suni.tbl

-makeuctb utf8_uni.tbl

-makeuctb viscii_uni.tbl

+call makehdrs

 

 :done

diff --git a/src/tcpipolb.opt b/src/tcpipolb.opt
new file mode 100644
index 00000000..9c87cc8d
--- /dev/null
+++ b/src/tcpipolb.opt
@@ -0,0 +1 @@
+tcpip$library:tcpip$lib/library
diff --git a/src/tcpipshr.opt b/src/tcpipshr.opt
new file mode 100644
index 00000000..1b55c34c
--- /dev/null
+++ b/src/tcpipshr.opt
@@ -0,0 +1 @@
+sys$library:tcpip$ipc_shr/share
0/mod/indirect 3/rm32/EBX . . . 0/r32/AL . . # copy byte at AL to *EBX # ++out->write 41/increment-ECX # Look = get-char(in) # . . push args 56/push-ESI # . . call e8/call get-char/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP $get-num:loop-end: # persist necessary variables from registers 89/copy 0/mod/indirect 7/rm32/EDI . . . 1/r32/ECX . . # copy ECX to *EDI $get-num:end: # . restore registers 5f/pop-to-EDI 5e/pop-to-ESI 5b/pop-to-EBX 5a/pop-to-EDX 59/pop-to-ECX 58/pop-to-EAX # . epilog 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP 5d/pop-to-EBP c3/return test-get-num-reads-single-digit: # - check that get-num returns first character if it's a digit # This test uses exit-descriptors. Use EBP for setting up local variables. 55/push-EBP 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP # clear all streams # . clear-stream(_test-stream) # . . push args 68/push _test-stream/imm32 # . . call e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # . clear-stream(_test-buffered-file+4) # . . push args b8/copy-to-EAX _test-buffered-file/imm32 05/add-to-EAX 4/imm32 50/push-EAX # . . call e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # . clear-stream(_test-output-stream) # . . push args 68/push _test-output-stream/imm32 # . . call e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # . clear-stream(_test-error-stream) # . . push args 68/push _test-error-stream/imm32 # . . call e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # initialize 'in' # . write(_test-stream, "3") # . . push args 68/push "3"/imm32 68/push _test-stream/imm32 # . . call e8/call write/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # initialize exit-descriptor 'ed' for the call to 'get-num' below # . var ed/EAX : exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # subtract from ESP 89/copy 3/mod/direct 0/rm32/EAX . . . 4/r32/ESP . . # copy ESP to EAX # . tailor-exit-descriptor(ed, 16) # . . push args 68/push 0x10/imm32/nbytes-of-args-for-get-num 50/push-EAX/ed # . . call e8/call tailor-exit-descriptor/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # prime the pump # . get-char(_test-buffered-file) # . . push args 68/push _test-buffered-file/imm32 # . . call e8/call get-char/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # get-num(in, out, err, ed) # . . push args 50/push-EAX/ed 68/push _test-error-stream/imm32 68/push _test-output-stream/imm32 68/push _test-buffered-file/imm32 # . . call e8/call get-num/disp32 # registers except ESP may be clobbered at this point # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32 # add to ESP # check-ints-equal(*_test-output-stream->data, '3', msg) # . . push args 68/push "F - test-get-num-reads-single-digit"/imm32 68/push 0x33/imm32 b8/copy-to-EAX _test-output-stream/imm32 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 . # push *(EAX+12) # . . call e8/call check-ints-equal/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP # . reclaim locals 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 5d/pop-to-EBP c3/return test-get-num-aborts-on-non-digit-in-Look: # - check that get-num returns first character if it's a digit # This test uses exit-descriptors. Use EBP for setting up local variables. 55/push-EBP 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP # clear all streams # . clear-stream(_test-stream) # . . push args 68/push _test-stream/imm32 # . . call e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # . clear-stream(_test-buffered-file+4) # . . push args b8/copy-to-EAX _test-buffered-file/imm32 05/add-to-EAX 4/imm32 50/push-EAX # . . call e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # . clear-stream(_test-output-stream) # . . push args 68/push _test-output-stream/imm32 # . . call e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # . clear-stream(_test-error-stream) # . . push args 68/push _test-error-stream/imm32 # . . call e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # initialize 'in' # . write(_test-stream, "3") # . . push args 68/push "3"/imm32 68/push _test-stream/imm32 # . . call e8/call write/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # initialize exit-descriptor 'ed' for the call to 'get-num' below # . var ed/EAX : (address exit-descriptor) 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # subtract from ESP 89/copy 3/mod/direct 0/rm32/EAX . . . 4/r32/ESP . . # copy ESP to EAX # . tailor-exit-descriptor(ed, 16) # . . push args 68/push 0x10/imm32/nbytes-of-args-for-get-num 50/push-EAX/ed # . . call e8/call tailor-exit-descriptor/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # *don't* prime the pump # get-num(in, out, err, ed) # . . push args 50/push-EAX/ed 68/push _test-error-stream/imm32 68/push _test-output-stream/imm32 68/push _test-buffered-file/imm32 # . . call e8/call get-num/disp32 # registers except ESP may be clobbered at this point # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32 # add to ESP # check that get-num tried to call exit(1) # . check-ints-equal(ed->value, 2, msg) # i.e. stop was called with value 1 # . . push args 68/push "F - test-get-num-aborts-on-non-digit-in-Look"/imm32 68/push 2/imm32 # . . push ed->value ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 4/disp8 . # push *(EAX+4) # . . call e8/call check-ints-equal/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP # . reclaim locals 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP 5d/pop-to-EBP c3/return ## helpers # write(f, "Error: "+s+" expected\n") then stop(ed, 1) expected: # ed : (address exit-descriptor), f : fd or (address stream), s : (address array byte) -> <void> # . prolog 55/push-EBP 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP # write(f, "Error: ") # . . push args 68/push "Error: "/imm32 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 . # push *(EBP+12) # . . call e8/call write/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # write(f, s) # . . push args ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 . # push *(EBP+16) ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 . # push *(EBP+12) # . . call e8/call write/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # write(f, " expected") # . . push args 68/push " expected"/imm32 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 . # push *(EBP+12) # . . call e8/call write/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # write(f, Newline) # . . push args 68/push Newline/imm32 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 . # push *(EBP+12) # . . call e8/call write/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP # stop(ed, 1) # . . push args 68/push 1/imm32 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 . # push *(EBP+8) # . . call e8/call stop/disp32 # should never get past this point $expected:dead-end: # . epilog 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP 5d/pop-to-EBP c3/return # read a byte from 'f', and save it in 'Look' get-char: # f : (address buffered-file) -> <void> # . prolog 55/push-EBP 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP # . save registers 50/push-EAX # read-byte(f) # . . push args ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 . # push *(EBP+8) # . . call e8/call read-byte/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # save EAX to Look 89/copy 0/mod/indirect 5/rm32/.disp32 . . 0/r32/EAX Look/disp32 . # copy EAX to *Look $get-char:end: # . restore registers 58/pop-to-EAX # . epilog 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP 5d/pop-to-EBP c3/return is-digit?: # c : int -> EAX : boolean # . prolog 55/push-EBP 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP # EAX = false b8/copy-to-EAX 0/imm32 # if (c < '0') return false 81 7/subop/compare 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 0x30/imm32 # compare *(EBP+8) 7c/jump-if-lesser $is-digit?:end/disp8 # if (c > '9') return false 81 7/subop/compare 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 0x39/imm32 # compare *(EBP+8) 7f/jump-if-greater $is-digit?:end/disp8 # otherwise return true b8/copy-to-EAX 1/imm32 $is-digit?:end: # . epilog 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP 5d/pop-to-EBP c3/return == data Look: # (char with some extra padding) 0/imm32 _test-output-stream: # current write index 0/imm32 # current read index 0/imm32 # length 8/imm32 # data 00 00 00 00 00 00 00 00 # 8 bytes _test-error-stream: # current write index 0/imm32 # current read index 0/imm32 # length 8/imm32 # data 00 00 00 00 00 00 00 00 # 8 bytes # . . vim:nowrap:textwidth=0