lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev a note on different lynx.cfg/commandline args syntax


From: Leonid Pauzner
Subject: lynx-dev a note on different lynx.cfg/commandline args syntax
Date: Sun, 4 Apr 1999 14:43:39 +0400 (MSD)

I found out that -partial_thres=xx command line argument is not working:
it force lynx/dev21 to resolve www.xx.com  as a host...!

(apparently all partial_thres lynx.cfg staff is not working for me either:
when I save .lynxrc from the options menu it always set partial_thres=-1
even when there was no .lynxrc file before. Something with PARSE_INT() ?)

Also the arguments tables in LYMain.c and LYReadCFG.c
have the different signature that may be a misguiding when adding new options:


LYMain.c:
^^^^^^^^^
struct parse_args_type;
typedef int (*ParseFunc) PARAMS((struct parse_args_type *, char **, char *));

typedef union {
        BOOLEAN * set_value;
        int *     int_value;
        char **   str_value;
        ParseFunc fun_value;
} ParseUnion;

#undef  PARSE_DEBUG

/*
 * Storing the four types of data in separate fields costs about 1K of data.
 * However, this provides usable type-checking.  The initial version of the
 * parse_args_type used 'long' for all types, and dumped core when processing
 * "lynx -help".  (The compiler was unable to detect some minor errors).
 */
#ifdef  PARSE_DEBUG
#define ParseData BOOLEAN *set_value; int *int_value; char **str_value; 
ParseFunc fun_value
#define PARSE_SET(n,t,v,h) {n,t,    v,  0,  0,  0,    h}
#define PARSE_INT(n,t,v,h) {n,t,    0, &v,  0,  0,    h}
#define PARSE_STR(n,t,v,h) {n,t,    0,  0,  v,  0,    h}
#define PARSE_FUN(n,t,v,h) {n,t,    0,  0,  0,  v,    h}
#else
#define ParseData long value
#define PARSE_SET(n,t,v,h) {n,t,   (long) (v),        h}
#define PARSE_INT(n,t,v,h) {n,t,   (long)&(v),        h}
#define PARSE_STR(n,t,v,h) {n,t,   (long) (v),        h}
#define PARSE_FUN(n,t,v,h) {n,t,   (long) (v),        h}
#endif


LYReadCFG.c:
^^^^^^^^^^^^
typedef int (*ParseFunc) PARAMS((char *));

typedef union {
        lynx_html_item_type ** add_value;
        BOOLEAN * set_value;
        int *     int_value;
        char **   str_value;
        ParseFunc fun_value;
        long      def_value;
} ConfigUnion;

#undef  PARSE_DEBUG
#ifdef  PARSE_DEBUG
#define ParseData \
        lynx_html_item_type** add_value; \
        BOOLEAN *set_value; \
        int *int_value; \
        char **str_value; \
        ParseFunc fun_value; \
        long def_value
#define PARSE_ADD(n,t,v) {n,t,   &v,  0,  0,  0,  0,  0}
#define PARSE_SET(n,t,v) {n,t,    0, &v,  0,  0,  0,  0}
#define PARSE_INT(n,t,v) {n,t,    0,  0, &v,  0,  0,  0}
#define PARSE_STR(n,t,v) {n,t,    0,  0,  0, &v,  0,  0}
#define PARSE_ENV(n,t,v) {n,t,    0,  0,  0,  v,  0,  0}
#define PARSE_FUN(n,t,v) {n,t,    0,  0,  0,  0,  v,  0}
#define PARSE_DEF(n,t,v) {n,t,    0,  0,  0,  0,  0,  v}
#else
#define ParseData long value
#define PARSE_ADD(n,t,v) {n,t,   (long)&(v)}
#define PARSE_SET(n,t,v) {n,t,   (long)&(v)}
#define PARSE_INT(n,t,v) {n,t,   (long)&(v)}
#define PARSE_STR(n,t,v) {n,t,   (long)&(v)}
#define PARSE_ENV(n,t,v) {n,t,   (long) (v)}
#define PARSE_FUN(n,t,v) {n,t,   (long) (v)}
#define PARSE_DEF(n,t,v) {n,t,   (long) (v)}
#endif




reply via email to

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