[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Lynx-dev] Getting color output to work...
From: |
L A Walsh |
Subject: |
[Lynx-dev] Getting color output to work... |
Date: |
Sat, 31 Dec 2016 16:51:46 -0800 |
User-agent: |
Thunderbird |
Hi, I'm having a problem using lynx to display a local
html-ized file that hilights syntax w/color.
Specifically, its the output of Vim's convert file to
html script which dumps the file's highlighting to
a buffer which one can then write to disk.
The manpage indicates that it should work using the
terminal's color settings if it has a curses entry, but
I'm not getting it to work.
I added show_color=always to my ~/.lynxrc, but no difference.
I wanted it sent to a file so I could display the htmtext
with 'less', but that and direct-to-screen both do not
work.
I'm attaching an html output file from a smallish
C file, as well as a screen-dump of what it looks like.
What am I doing wrong?
My terminal emulator is xterm & linux console compatible.
Thanks much,
-linda

#include <unistd.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
static const char * help []= {"Real UID/GID access (not Effective) test.",
" access <filename> [<type>]",
" type = <mode>[<mode>...]",
" mode = <R|W|X>",
" no mode tests existence",
0,
};
;
void msg (const char *msg[]) {
const char **p;
for (p=msg; p; ++p) {
fprintf(stderr, "%s\n", p);
}
}
void errmsg(int status, const char * msgtxt[]) {
msg(msgtxt);
exit(status);
}
int main (int argc, char **argv) {
char * file;
int mode;
int status;
int err;
if (argc<2 || argc>3) errmsg(1, help);
file=argv[1];
mode=F_OK;
if (argc>2) {
char *modes=argv[2];
int len = strlen(modes);
printf ("len=%d, s=%s\n", len, modes);
int i;
const char * invms[] = {"Invalid mode string",0};
const char * invmis[] = {"Invalid mode in mode string",0};
if (len>3) {
errmsg(EINVAL, invms);
}
while (*modes) {
switch(toupper(*modes)) {
case('R'):
mode |= R_OK;
case('W'):
mode |= W_OK;
case('X'):
mode |= X_OK;
default:
errmsg(EINVAL, invmis);
}
++modes;
}
}
status=access(file,mode);
err=errno;
if (status<0) {
perror(file);
}
exit (err);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Lynx-dev] Getting color output to work...,
L A Walsh <=