lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev [2.8.2dev.8] Env var data for PRINTER: pgms (w/man page entries


From: Kim DeVaughn
Subject: lynx-dev [2.8.2dev.8] Env var data for PRINTER: pgms (w/man page entries)
Date: Sat, 5 Dec 1998 20:15:19 -0800

Picking up on a suggestion by Klaus in a previous thread, I've added
the setting of a few (3) more environment variables to LYPrint.c, for
use by external PRINTER: defined programs.

In addition to the Title string (aka: Linkname) already being passed
out with an env var, I'm now passing out the URL, Date, and Last Mod
strings (as seen in a document's "Information about" [=] page).


I've also made a first attempt at adding an ENVIRONMENT section to the
man page. and in addition to the variables for the above, included the
more common (and some not-so-common) lynx-specific env vars, and a few
general ones, as well.

I punted on the normal (for UNIX) env vars, like HOME, PATH, TERM, etc,
though if someone thinks they need to be in there for other platforms,
please feel free to add them.

Someone else will need to add entries for the NLS oriented vars, as I
know little about that whole subject.  In particular, from the lists
that Larry and Jim posted (thanks, guys), these probably need to have
entries:

 LANG
 LANGUAGE
 LC_ALL
 LC_MESSAGES
 NLSPATH

And, of course, there may be other vars lurking somewhere or another ...

Please check over my descriptions (several lifted from the INSTALLATION
doc), and correct any blunders I may have made :-) .

It's also been suggested that a description of the various environment
variables should go into the User Guide.  I personally don't like have
something technical documented in two places, since they will seldom
agree exactly, and are just that much more to maintain, but if someone
wants to adapt and expand these descriptions to fit that format, please
feel free.

Happy Holidays to all ...!

/kim


Against 2.8.2dev.8:

diff -uNr lynx-2.8.2-dev.8.orig/src/LYPrint.c lynx-2.8.2-dev.8+kd/src/LYPrint.c
--- lynx-2.8.2-dev.8.orig/src/LYPrint.c Thu Dec  3 10:28:20 1998
+++ lynx-2.8.2-dev.8+kd/src/LYPrint.c   Thu Dec  3 16:52:25 1998
@@ -1160,31 +1160,75 @@
                printf(PRINTING_FILE);
 #ifdef VMS
                /*
-                *  Set document's title as a VMS logical. -  FM
+                *  Set various bits of document information as VMS logicals,
+                *  for external PRINTER: cmd use. - KED
                 */
                StrAllocCopy(envbuffer, HText_getTitle());
                if (!(envbuffer && *envbuffer))
                    StrAllocCopy(envbuffer, "No Title");
                Define_VMSLogical("LYNX_PRINT_TITLE", envbuffer);
+
+               StrAllocCopy(envbuffer, newdoc->address);
+               if (!(envbuffer && *envbuffer))
+                   StrAllocCopy(envbuffer, "No URL");
+               Define_VMSLogical("LYNX_PRINT_URL", envbuffer);
+
+               StrAllocCopy(envbuffer, HText_getDate());
+               if (!(envbuffer && *envbuffer))
+                   StrAllocCopy(envbuffer, "No Date");
+               Define_VMSLogical("LYNX_PRINT_DATE", envbuffer);
+
+               StrAllocCopy(envbuffer, HText_getLastModified());
+               if (!(envbuffer && *envbuffer))
+                   StrAllocCopy(envbuffer, "No LastMod");
+               Define_VMSLogical("LYNX_PRINT_LASTMOD", envbuffer);
 #else
                /*
-                *  Set document's title as an environment variable. - JKT
+                *  Set various bits of document information as environment
+                *  variables, for use by external print scripts/etc.  We
+                *  assume there are values, and leave NULL value checking
+                *  up to the external PRINTER: cmd/script. - KED
                 */
                StrAllocCopy(envbuffer, "LYNX_PRINT_TITLE=");
                StrAllocCat(envbuffer, HText_getTitle());
                putenv(envbuffer);
+
+               StrAllocCopy(envbuffer, "LYNX_PRINT_URL=");
+               StrAllocCat(envbuffer, newdoc->address);
+               putenv(envbuffer);
+
+               StrAllocCopy(envbuffer, "LYNX_PRINT_DATE=");
+               StrAllocCat(envbuffer, HText_getDate());
+               putenv(envbuffer);
+
+               StrAllocCopy(envbuffer, "LYNX_PRINT_LASTMOD=");
+               StrAllocCat(envbuffer, HText_getLastModified());
+               putenv(envbuffer);
 #endif /* VMS */
                LYSystem(buffer);
 #ifdef VMS
                /*
-                *  Remove LYNX_PRINT_TITLE logical. - FM
+                *  Remove the various LYNX_PRINT_xxxx logicals. - KED
                 */
                Define_VMSLogical("LYNX_PRINT_TITLE", "");
+               Define_VMSLogical("LYNX_PRINT_URL", "");
+               Define_VMSLogical("LYNX_PRINT_DATE", "");
+               Define_VMSLogical("LYNX_PRINT_LASTMOD", "");
 #else
                /*
-                *  Remove LYNX_PRINT_TITLE value from environment. - KW
+                *  Remove the LYNX_PRINT_xxxx values from environment. - KED
+                *  [could use unsetenv(), but don't know if it's portable]
                 */
-               envbuffer[17] = '\0'; /* truncate after '=' */
+               StrAllocCopy(envbuffer, "LYNX_PRINT_TITLE=");
+               putenv(envbuffer);
+
+               StrAllocCopy(envbuffer, "LYNX_PRINT_URL=");
+               putenv(envbuffer);
+
+               StrAllocCopy(envbuffer, "LYNX_PRINT_DATE=");
+               putenv(envbuffer);
+
+               StrAllocCopy(envbuffer, "LYNX_PRINT_LASTMOD=");
                putenv(envbuffer);
 #endif /* VMS */
                FREE(envbuffer);
diff -uNr lynx-2.8.2-dev.8.orig/lynx.man lynx-2.8.2-dev.8+kd/lynx.man
--- lynx-2.8.2-dev.8.orig/lynx.man      Tue Oct 27 18:08:12 1998
+++ lynx-2.8.2-dev.8+kd/lynx.man        Sat Dec  5 19:01:31 1998
@@ -548,6 +548,118 @@
 .br
 o Type \fB"K"\fR for a complete list of the current key-stroke
 command mappings.
+.SH ENVIRONMENT
+In addition to various "standard" environment variables such as
+\fBHOME\fR, \fBPATH\fR, \fBDISPLAY\fR, \fBTERM\fR, \fBLINES\fR,
+\fBCOLUMNS\fR, \fBTMPDIR\fR, \fBetc\fR,
+\fILynx\fR utilizes the following environment variables, if they exist
+(some may be created by \fILynx\fR to pass data to an external program):
+.TP 20
+.B COLORTERM
+If set, color capability for the terminal is inferred at startup time.
+[Usage of this variable is dependent on the screen handling library used
+to build \fILynx\fR (curses, ncurses, or slang).]
+.TP 20
+.B LYNX_CFG
+This variable, if set, will override the default location and name of
+the global configuration file (normally, \fBlynx.cfg\fR) that was defined
+by the LYNX_CFG_FILE constant in the userdefs.h file, during installation.
+See the userdefs.h file for more information.
+.TP 20
+.B LYNX_LSS
+This variable, if set, specifies the location of the default \fILynx\fR
+character style sheet file.
+.TP 20
+.B LYNX_PRINT_DATE
+This variable is \fBset\fR by the \fILynx\fR p(rint) function, to the
+Date:
+string seen in the document's "\fBInformation about\fR" page (= cmd),
+if any.
+It is created for use by an external program, as defined in a
+\fBlynx.cfg PRINTER:\fR definition statement.
+If the field does not exist for the document, the variable is set to a
+null string under \fBUNIX\fR, or "No Date" under \fBVMS\fR.
+.TP 20
+.B LYNX_PRINT_LASTMOD
+This variable is \fBset\fR by the \fILynx\fR p(rint) function, to the
+Last Mod:
+string seen in the document's "\fBInformation about\fR" page (= cmd),
+if any.
+It is created for use by an external program, as defined in a
+\fBlynx.cfg PRINTER:\fR definition statement.
+If the field does not exist for the document, the variable is set to a
+null string under \fBUNIX\fR, or "No LastMod" under \fBVMS\fR.
+.TP 20
+.B LYNX_PRINT_TITLE
+This variable is \fBset\fR by the \fILynx\fR p(rint) function, to the
+Linkname:
+string seen in the document's "\fBInformation about\fR" page (= cmd),
+if any.
+It is created for use by an external program, as defined in a
+\fBlynx.cfg PRINTER:\fR definition statement.
+If the field does not exist for the document, the variable is set to a
+null string under \fBUNIX\fR, or "No Title" under \fBVMS\fR.
+.TP 20
+.B LYNX_PRINT_URL
+This variable is \fBset\fR by the \fILynx\fR p(rint) function, to the
+URL:
+string seen in the document's "\fBInformation about\fR" page (= cmd),
+if any.
+It is created for use by an external program, as defined in a
+\fBlynx.cfg PRINTER:\fR definition statement.
+If the field does not exist for the document, the variable is set to a
+null string under \fBUNIX\fR, or "No URL" under \fBVMS\fR.
+.TP 20
+.B LYNX_SAVE_SPACE
+This variable, if set, will override the default path prefix for files
+saved to disk that is defined in the \fBlynx.cfg SAVE_SPACE:\fR statement.
+See the \fBlynx.cfg\fR file for more information.
+.TP 20
+.B LYNX_TEMP_SPACE
+This variable, if set, will override the default path prefix for temporary
+files that is defined in the \fBlynx.cfg TEMP_SPACE:\fR statement.
+See the \fBlynx.cfg\fR file for more information.
+.TP 20
+.B MAIL
+This variable specifies the default inbox \fILynx\fR will check for new
+mail, if such checking is enabled in the \fBlynx.cfg\fR file.
+.TP 20
+.B NEWS_ORGANIZATION
+This variable, if set, provides the string used in the \fBOrganization:\fR
+header of \fBUSENET\fR news postings.  It will override the setting of the
+ORGANIZATION environment variable, if it is also set (and, on \fBUNIX\fR,
+the contents of an /etc/organization file, if present).
+.TP 20
+.B NNTPSERVER
+If set, this variable specifies the default NNTP server that will be used
+for \fBUSENET\fR news reading and posting with \fILynx\fR, via news: URL's.
+.TP 20
+.B ORGANIZATION
+This variable, if set, provides the string used in the \fBOrganization:\fR
+header of \fBUSENET\fR news postings.  On \fBUNIX\fR, it will override the
+contents of an /etc/organization file, if present.
+.TP 20
+.B PROTOCOL_proxy
+\fILynx\fR supports the use of proxy servers that can act as firewall
+gateways and caching servers.  They are preferable to the older gateway
+servers (see WWW_access_GATEWAY, below).  Each protocol used by \fILynx\fR
+can be mapped separately using PROTOCOL_proxy environment variables of
+the form: 'http_proxy "http://some.server.dom:port/";'.
+See the \fBINSTALLATION\fR file in the \fILynx\fR distribution for details,
+and examples.
+.TP 20
+.B WWW_access_GATEWAY
+\fILynx\fR still supports use of gateway servers, with the servers specified
+via "WWW_access_GATEWAY" variables, where "access" is lower case and can be
+"http", "ftp", "gopher" or "wais".  Most gateway servers have been
+discontinued, but "http://www.w3.org:8001"; is available for wais searches
+(note that you do not include a terminal '/' for gateways, but do for proxies
+specified by PROTOCOL_proxy environment variables.
+See the \fBINSTALLATION\fR file in the \fILynx\fR distribution for details.
+.TP 20
+.B WWW_HOME
+This variable, if set, will override the default startup URL specified
+in any of the \fILynx\fR configuration files.
 .SH NOTES
 This is the Lynx v2.8.1 Release
 .PP
##--eof--#

reply via email to

[Prev in Thread] Current Thread [Next in Thread]