[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lynx-dev a note on different lynx.cfg/commandline args syntax
From: |
dickey |
Subject: |
Re: lynx-dev a note on different lynx.cfg/commandline args syntax |
Date: |
Sun, 4 Apr 1999 10:55:03 -0400 (EDT) |
>
> 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() ?)
I don't think so - the only problem I remember in this area was fixing someone's
patch where they'd confused the items for int versus a function-pointer
(but since all of the data are stored in the same location, except when
debugging, then nothing was lost, just mistyped)
> Also the arguments tables in LYMain.c and LYReadCFG.c
> have the different signature that may be a misguiding when adding new
> options:
well - by making these things table-driven, we can indeed go a step further and
make the tables compatible (is that what you are asking about?)
>
>
> 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
>
>
>
--
Thomas E. Dickey
address@hidden
http://www.clark.net/pub/dickey