aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1998-04-18 20:30:00 -0400
committerThomas E. Dickey <dickey@invisible-island.net>1998-04-18 20:30:00 -0400
commit84271e583d80f546251ea914a33f8c537fddbac7 (patch)
treec819869cda13abc7b46a47aa7e860f2dbf0c7626 /src
parentaf9be28bc2701ea448898282942bd5b957439f18 (diff)
downloadlynx-snapshots-84271e583d80f546251ea914a33f8c537fddbac7.tar.gz
snapshot of project "lynx", label v2-8-1dev_6
Diffstat (limited to 'src')
-rw-r--r--src/GridText.c6
-rw-r--r--src/HTML.c24
-rw-r--r--src/LYCurses.c16
-rw-r--r--src/LYMail.c18
-rw-r--r--src/LYMain.c23
-rw-r--r--src/LYPrint.c54
6 files changed, 101 insertions, 40 deletions
diff --git a/src/GridText.c b/src/GridText.c
index 0e489dbb..fcbe065e 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -755,7 +755,7 @@ PRIVATE int display_line ARGS2(
while (current_style < line->numstyles &&
i >= CStyle.horizpos + line->offset + 1)
{
- (void) LynxChangeStyle (CStyle.style,CStyle.direction,CStyle.previous);
+ LynxChangeStyle (CStyle.style,CStyle.direction,CStyle.previous);
current_style++;
}
#endif
@@ -884,7 +884,7 @@ PRIVATE int display_line ARGS2(
#else
while (current_style < line->numstyles)
{
- (void) LynxChangeStyle (CStyle.style, CStyle.direction, CStyle.previous);
+ LynxChangeStyle (CStyle.style, CStyle.direction, CStyle.previous);
current_style++;
}
#undef CStyle
@@ -2189,7 +2189,7 @@ PUBLIC void HText_appendCharacter ARGS2(
text->kanji_buf = '\0';
return;
} else {
- text->kanji_buf = '\x8E';
+ text->kanji_buf = '\216';
ch |= 0200;
}
break;
diff --git a/src/HTML.c b/src/HTML.c
index c456d6e5..29eb130a 100644
--- a/src/HTML.c
+++ b/src/HTML.c
@@ -11,6 +11,8 @@
** Being Overidden
**
*/
+#define DICKEY_TEST
+
#include <HTUtils.h>
#include <tcp.h>
@@ -64,6 +66,8 @@ char Style_className[16384];
#define FREE(x) if (x) {free(x); x = NULL;}
+#define STACKLEVEL(me) ((me->stack + MAX_NESTING - 1) - me->sp)
+
extern BOOL HTPassEightBitRaw;
extern HTCJKlang HTCJK;
@@ -5223,7 +5227,10 @@ PRIVATE void HTML_start_element ARGS6(
} /* end switch */
- if (HTML_dtd.tags[ElementNumber].contents != SGML_EMPTY) {
+#if defined(DICKEY_TEST)
+ if (HTML_dtd.tags[ElementNumber].contents != SGML_EMPTY)
+#endif
+ {
if (me->skip_stack > 0) {
if (TRACE)
fprintf(stderr,
@@ -5247,16 +5254,16 @@ PRIVATE void HTML_start_element ARGS6(
return;
}
+ if (TRACE)
+ fprintf(stderr,"HTML:begin_element[%d]: adding style to stack - %s\n",
+ STACKLEVEL(me),
+ me->new_style->name);
(me->sp)--;
me->sp[0].style = me->new_style; /* Stack new style */
me->sp[0].tag_number = ElementNumber;
-
- if (TRACE)
- fprintf(stderr,"HTML:begin_element: adding style to stack - %s\n",
- me->new_style->name);
}
-#if defined(USE_COLOR_STYLE)
+#if defined(DICKEY_TEST) && defined(USE_COLOR_STYLE)
/* end empty tags straight away */
if (HTML_dtd.tags[ElementNumber].contents == SGML_EMPTY)
{
@@ -5421,7 +5428,8 @@ PRIVATE void HTML_end_element ARGS3(
(me->sp)++;
if (TRACE)
fprintf(stderr,
- "HTML:end_element: Popped style off stack - %s\n",
+ "HTML:end_element[%d]: Popped style off stack - %s\n",
+ STACKLEVEL(me),
me->sp->style->name);
} else {
if (TRACE)
@@ -6689,7 +6697,9 @@ End_Object:
fprintf(stderr, "CSS:%s (trimmed %s, END_ELEMENT)\n", Style_className, tmp);
}
+#if defined(DICKEY_TEST)
if (HTML_dtd.tags[element_number].contents != SGML_EMPTY)
+#endif
{
if (TRACE)
fprintf(stderr, "STYLE:end_element: ending non-EMPTY style\n");
diff --git a/src/LYCurses.c b/src/LYCurses.c
index 00458ff9..1fba3f69 100644
--- a/src/LYCurses.c
+++ b/src/LYCurses.c
@@ -300,7 +300,7 @@ PUBLIC void setHashStyle ARGS5(int,style,int,color,int,cattr,int,mono,char*,elem
PRIVATE int LYAttrset ARGS3(WINDOW*,win,int,color,int,mono)
{
if (TRACE)
- fprintf(stderr, "CSS:LYAttrset (%d, %d)\n", color, mono);
+ fprintf(stderr, "CSS:LYAttrset (%#x, %#x)\n", color, mono);
if (lynx_has_color && LYShowColor >= SHOW_COLOR_ON && color > -1)
{
wattrset(win,color);
@@ -475,7 +475,7 @@ PRIVATE void LYsetWAttr ARGS1(WINDOW *, win)
int attr = A_NORMAL;
int offs = 1;
static int have_underline = -1;
- static int no_color_video = -1;
+ static int NoColorVideo = -1;
if (have_underline < 0) {
#ifndef DOSPATH
@@ -486,11 +486,11 @@ PRIVATE void LYsetWAttr ARGS1(WINDOW *, win)
}
#if ( !defined(__DJGPP__) && !defined(_WINDOWS) )
- if (no_color_video < 0) {
- no_color_video = tigetnum("ncv");
+ if (NoColorVideo < 0) {
+ NoColorVideo = tigetnum("ncv");
}
- if (no_color_video < 0)
- no_color_video = 0;
+ if (NoColorVideo < 0)
+ NoColorVideo = 0;
#endif /* !__DJGPP__ and !_WINDOWS */
if (Current_Attr & A_BOLD)
@@ -505,11 +505,11 @@ PRIVATE void LYsetWAttr ARGS1(WINDOW *, win)
* FIXME: no_color_video isn't implemented (97/4/14) in ncurses 4.x,
* but may be in SVr4 (which would make this redundant for the latter).
*/
- if ((Current_Attr & A_BOLD) && !(no_color_video & 33)) {
+ if ((Current_Attr & A_BOLD) && !(NoColorVideo & 33)) {
attr |= A_BOLD;
}
- if ((Current_Attr == A_UNDERLINE) && !(no_color_video & 2)) {
+ if ((Current_Attr == A_UNDERLINE) && !(NoColorVideo & 2)) {
attr |= A_UNDERLINE;
}
diff --git a/src/LYMail.c b/src/LYMail.c
index f3a69290..1b49c2aa 100644
--- a/src/LYMail.c
+++ b/src/LYMail.c
@@ -575,6 +575,12 @@ PUBLIC void mailmsg ARGS4(
char hdrfile[256];
FILE *hfd;
+ if(TRACE)
+ fprintf(stderr,"mailmsg(%d, \"%s\", \"%s\", \"%s\")\n",cur,
+ cur, owner_address?owner_address:"<nil>",
+ filename?filename:"<nil>",
+ linkname?linkname:"<nil>");
+
if (!strncasecomp(system_mail, "PMDF SEND", 9)) {
isPMDF = TRUE;
}
@@ -870,6 +876,12 @@ PUBLIC void reply_by_mail ARGS3(
char hdrfile[256];
FILE *hfd;
+ if(TRACE)
+ fprintf(stderr,"reply_by_mail(\"%s\", \"%s\", \"%s\")\n",
+ mail_address?mail_address:"<nil>",
+ filename?filename:"<nil>",
+ title?tilde:"<nil>");
+
if (!strncasecomp(system_mail, "PMDF SEND", 9)) {
isPMDF = TRUE;
}
@@ -1466,7 +1478,7 @@ PUBLIC void reply_by_mail ARGS3(
addstr("\n");
}
remove_tildes(user_input);
-#if defined (VMS) || defined (DOSPATH)
+
if (*user_input) {
cp = user_input;
while (*cp == ',' || isspace((unsigned char)*cp))
@@ -1480,7 +1492,7 @@ PUBLIC void reply_by_mail ARGS3(
}
}
}
-#endif
+
#ifdef DOSPATH
if (*address) {
sprintf(buf, "To: %s\n", address);
@@ -1514,6 +1526,8 @@ PUBLIC void reply_by_mail ARGS3(
StrAllocCat(header, buf);
#endif /* !VMS */
+ if(TRACE)
+ fprintf(stderr,"**header==\n%s",header);
if (!no_editor && editor && *editor != '\0') {
/*
* Use an external editor for the message.
diff --git a/src/LYMain.c b/src/LYMain.c
index f34be98d..9f39c5db 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -1786,6 +1786,7 @@ PRIVATE void parse_arg ARGS3(
int *, i,
int, argc)
{
+ static int ignored;
char *cp;
#ifndef VMS
static char display_putenv_command[142];
@@ -1884,10 +1885,8 @@ PRIVATE void parse_arg ARGS3(
if (auth_info != NULL) {
if ((cp = strchr(auth_info, ':')) != NULL) { /* Pw */
*cp++ = '\0'; /* Terminate ID */
- if (*cp) {
- HTUnEscape(cp);
- StrAllocCopy(authentication_info[1], cp);
- }
+ HTUnEscape(cp);
+ StrAllocCopy(authentication_info[1], cp);
}
if (*auth_info) { /* Id */
HTUnEscape(auth_info);
@@ -1960,7 +1959,7 @@ PRIVATE void parse_arg ARGS3(
* so just check whether we need to increment i
*/
if (nextarg)
- ; /* do nothing */
+ ignored++; /* do nothing */
} else if (strncmp(argv[0], "-child", 6) == 0) {
child_lynx = TRUE;
@@ -2227,7 +2226,7 @@ PRIVATE void parse_arg ARGS3(
* so just check whether we need to increment i
*/
if (nextarg)
- ; /* do nothing */
+ ignored++; /* do nothing */
#endif
} else {
@@ -2356,10 +2355,8 @@ PRIVATE void parse_arg ARGS3(
if (pauth_info != NULL) {
if ((cp = strchr(pauth_info, ':')) != NULL) { /* Pw */
*cp++ = '\0'; /* Terminate ID */
- if (*cp) {
- HTUnEscape(cp);
- StrAllocCopy(proxyauth_info[1], cp);
- }
+ HTUnEscape(cp);
+ StrAllocCopy(proxyauth_info[1], cp);
}
if (*pauth_info) { /* Id */
HTUnEscape(pauth_info);
@@ -2574,7 +2571,10 @@ PRIVATE void parse_arg ARGS3(
break;
case 't':
- if (strncmp(argv[0], "-telnet", 7) == 0) {
+ if (strncmp(argv[0], "-tagsoup", 8) == 0) {
+ HTSwitchDTD(New_DTD = NO);
+
+ } else if (strncmp(argv[0], "-telnet", 7) == 0) {
telnet_ok = FALSE;
} else if (strncmp(argv[0], "-term", 5) == 0) {
@@ -2800,6 +2800,7 @@ Output_Help_List:
," -syslog=text information for syslog call"
#endif /* SYSLOG_REQUESTED_URLS */
#endif /* !VMS */
+," -tagsoup use TagSoup rather than SortaSGML parser"
," -telnet disable telnets"
," -term=TERM set terminal type to TERM"
," -tlog toggles use of a Lynx Trace Log for the current session"
diff --git a/src/LYPrint.c b/src/LYPrint.c
index 2ad75810..76018a56 100644
--- a/src/LYPrint.c
+++ b/src/LYPrint.c
@@ -38,13 +38,30 @@
* LYNXPRINT://LOCAL_FILE/lines=##
* LYNXPRINT://MAIL_FILE/lines=##
* LYNXPRINT://TO_SCREEN/lines=##
+ * LYNXPRINT://LPANSI/lines=##
* LYNXPRINT://PRINTER/lines=##/number=#
*/
#define TO_FILE 1
#define TO_SCREEN 2
-#define MAIL 3
-#define PRINTER 4
+/*
+ * "lpansi.c"
+ * Original author: Gary Day (gday@comp.uark.edu), 11/30/93
+ * Current version: 2.1 by Noel Hunter (noel@wfu.edu), 10/20/94
+ *
+ * Basic structure based on print -- format files for printing from
+ * _Practical_C_Programming by Steve Oualline, O'Reilly & Associates
+ *
+ * adapted from the README for lpansi.c v2.1, dated 10/20/1994:
+ * Print to ANSI printer on local terminal
+ * The VT100 standard defines printer on and off escape sequences,
+ * esc[5i is printer on, and esc[4i is printer off.
+ *
+ * incorporate the idea of "lpansi" directly into LYPrint.c - HN
+ */
+#define LPANSI 3
+#define MAIL 4
+#define PRINTER 5
#ifdef VMS
PRIVATE int remove_quotes PARAMS((char *string));
@@ -62,6 +79,7 @@ PUBLIC int printfile ARGS1(
int printer_number = 0;
int pages = 0;
int type = 0, c, len;
+ BOOLEAN Lpansi = FALSE;
FILE *outfile_fp;
char *cp = NULL;
lynx_printer_item_type *cur_printer;
@@ -196,6 +214,9 @@ PUBLIC int printfile ARGS1(
type = TO_FILE;
} else if (strstr(link_info, "TO_SCREEN")) {
type = TO_SCREEN;
+ } else if (strstr(link_info, "LPANSI")) {
+ Lpansi = TRUE;
+ type = TO_SCREEN;
} else if (strstr(link_info, "MAIL_FILE")) {
type = MAIL;
} else if (strstr(link_info, "PRINTER")) {
@@ -882,7 +903,7 @@ PUBLIC int printfile ARGS1(
if (pages > 4) {
sprintf(filename, CONFIRM_LONG_SCREEN_PRINT, pages);
_statusline(filename);
- c=LYgetch();
+ c = LYgetch();
#ifdef VMS
if (HadVMSInterrupt) {
HadVMSInterrupt = FALSE;
@@ -901,7 +922,11 @@ PUBLIC int printfile ARGS1(
}
}
- _statusline(PRESS_RETURN_TO_BEGIN);
+ if (Lpansi) {
+ _statusline(CHECK_PRINTER);
+ } else {
+ _statusline(PRESS_RETURN_TO_BEGIN);
+ }
*filename = '\0';
if (LYgetstr(filename, VISIBLE,
sizeof(filename), NORECALL) < 0) {
@@ -930,6 +955,8 @@ PUBLIC int printfile ARGS1(
"<!-- X-URL: %s -->\n<BASE HREF=\"%s\">\n\n",
newdoc->address, content_base);
}
+ if (Lpansi)
+ printf("\033[5i");
print_wwwfile_to_fd(outfile_fp, 0);
if (keypad_mode)
printlist(outfile_fp, FALSE);
@@ -941,13 +968,18 @@ PUBLIC int printfile ARGS1(
break;
}
#endif /* VMS */
- fprintf(stdout,"\n\n%s", PRESS_RETURN_TO_FINISH);
-
- fflush(stdout); /* refresh to screen */
- LYgetch(); /* grab some user input to pause */
+ if (Lpansi) {
+ printf("\n\014"); /* Form feed */
+ printf("\033[4i");
+ Lpansi = FALSE;
+ } else {
+ fprintf(stdout,"\n\n%s", PRESS_RETURN_TO_FINISH);
+ LYgetch(); /* grab some user input to pause */
#ifdef VMS
- HadVMSInterrupt = FALSE;
+ HadVMSInterrupt = FALSE;
#endif /* VMS */
+ }
+ fflush(stdout); /* refresh to screen */
start_curses();
break;
@@ -1275,6 +1307,7 @@ PRIVATE int remove_quotes ARGS1(
* printer links look like
* LYNXPRINT://LOCAL_FILE/lines=# print to a local file
* LYNXPRINT://TO_SCREEN/lines=# print to the screen
+ * LYNXPRINT://LPANSI/lines=# print to the local terminal
* LYNXPRINT://MAIL_FILE/lines=# mail the file
* LYNXPRINT://PRINTER/lines=#/number=# print to printer number #
*/
@@ -1346,6 +1379,9 @@ PUBLIC int print_options ARGS2(
fprintf(fp0,
" <a href=\"LYNXPRINT://TO_SCREEN/lines=%d\">Print to the screen</a>\n",
lines_in_file);
+ fprintf(fp0,
+ " <a href=\"LYNXPRINT://LPANSI/lines=%d\">Print out on a printer attached to your vt100 terminal</a>\n",
+ lines_in_file);
for (count = 0, cur_printer = printers; cur_printer != NULL;
cur_printer = cur_printer->next, count++)