Updates from 0.2.1 into 0.2.1-inu-1.5

This commit is contained in:
Akinori Ito
2001-11-09 04:59:17 +00:00
parent 68a07bf03b
commit 6c63633545
246 changed files with 32763 additions and 21814 deletions

141
rc.c
View File

@@ -60,9 +60,11 @@ static int rc_initialized = 0;
#define CMT_SAVEHIST "URL<52><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¸"
#define CMT_KANJICODE "ɽ<><C9BD><EFBFBD>Ѵ<EFBFBD><D1B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#define CMT_FRAME "<22>ե졼<D5A5><ECA1BC><EFBFBD>μ<EFBFBD>ưɽ<C6B0><C9BD>"
#define CMT_ARGV_IS_URL "scheme <20>Τʤ<CEA4><CAA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> URL <20>Ȥߤʤ<DFA4>"
#define CMT_TSELF "target<65><74>̤<EFBFBD><CCA4><EFBFBD><EFBFBD><EFBFBD>ξ<EFBFBD><CEBE><EFBFBD><EFBFBD><EFBFBD>_self<6C><66><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4><EFBFBD>"
#define CMT_DISPLINK "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>μ<EFBFBD>ưɽ<C6B0><C9BD>"
#define CMT_MULTICOL "<22>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD>̾<EFBFBD>Υޥ<CEA5><DEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD>"
#define CMT_ALT_ENTITY "<22><><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5>ƥ<EFBFBD><C6A5><EFBFBD> ASCII <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD>"
#define CMT_COLOR "<22><><EFBFBD>顼ɽ<E9A1BC><C9BD>"
#define CMT_B_COLOR "ʸ<><CAB8><EFBFBD>ο<EFBFBD>"
#define CMT_A_COLOR "<22><><EFBFBD>󥫡<EFBFBD><F3A5ABA1>ο<EFBFBD>"
@@ -80,6 +82,7 @@ static int rc_initialized = 0;
#define CMT_FTP_PROXY "FTP<54>ץ<EFBFBD><D7A5><EFBFBD><EFBFBD><EFBFBD>(URL<52><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)"
#define CMT_NO_PROXY "<22>ץ<EFBFBD><D7A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥᥤ<C9A5><E1A5A4>"
#define CMT_NOPROXY_NETADDR "<22>ͥåȥ<C8A5><EFA1BC><EFBFBD><EFBFBD><EFBFBD>ɥ쥹<C9A5>ǥץ<C7A5><D7A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD>å<EFBFBD>"
#define CMT_NO_CACHE "Cache <20><><EFBFBD>Ȥ<EFBFBD><C8A4>ʤ<EFBFBD>"
#define CMT_DNS_ORDER "̾<><CCBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ν<EFBFBD><CEBD><EFBFBD>"
#define CMT_DROOT "/ <20><>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǥ<EFBFBD><C7A5><EFBFBD>ȥ<EFBFBD>(document root)"
#define CMT_PDROOT "/~user <20><>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǥ<EFBFBD><C7A5><EFBFBD>ȥ<EFBFBD>"
@@ -97,6 +100,7 @@ static int rc_initialized = 0;
#define CMT_USERAGENT "User-Agent"
#define CMT_ACCEPTLANG "<22><><EFBFBD><EFBFBD><EFBFBD>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(Accept-Language:)"
#define CMT_DOCUMENTCODE "ʸ<><CAB8><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#define CMT_SYSTEMCODE "<22><><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#define CMT_WRAP "<22>ޤ<EFBFBD><DEA4>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD>"
#define CMT_VIEW_UNSEENOBJECTS "<22>طʲ<D8B7><CAB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؤΥ<D8A4><CEA5>󥯤<EFBFBD><F3A5AFA4><EFBFBD><EFBFBD><EFBFBD>"
#ifdef __EMX__
@@ -109,6 +113,7 @@ static int rc_initialized = 0;
#define CMT_IGNORE_NULL_IMG_ALT "<22><><EFBFBD><EFBFBD>IMG ALT°<54><C2B0><EFBFBD>λ<EFBFBD><CEBB>˥<EFBFBD><CBA5><EFBFBD><EFBFBD><EFBFBD>̾<EFBFBD><CCBE>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
#define CMT_IFILE "<22>ƥǥ<C6A5><C7A5><EFBFBD>ȥ<EFBFBD><C8A5>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD>ǥå<C7A5><C3A5><EFBFBD><EFBFBD>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD>"
#define CMT_RETRY_HTTP "URL<52>˼<EFBFBD>ưŪ<C6B0><C5AA> http:// <20><><EFBFBD>䤦"
#define CMT_DECODE_CTE "<22><>¸<EFBFBD><C2B8><EFBFBD><EFBFBD> Content-Transfer-Encoding <20><><EFBFBD>ǥ<EFBFBD><C7A5><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4><EFBFBD>"
#ifdef MOUSE
#define CMT_MOUSE "<22>ޥ<EFBFBD><DEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD>"
#define CMT_REVERSE_MOUSE "<22>ޥ<EFBFBD><DEA5><EFBFBD><EFBFBD>Υɥ<CEA5><C9A5>å<EFBFBD>ư<EFBFBD><C6B0><EFBFBD><EFBFBD><EFBFBD>դˤ<D5A4><CBA4><EFBFBD>"
@@ -136,6 +141,7 @@ static int rc_initialized = 0;
#define CMT_COOKIE_ACCEPT_DOMAINS "<22><><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>դ<EFBFBD><D5A4><EFBFBD><EFBFBD>ɥᥤ<C9A5><E1A5A4>"
#endif
#define CMT_FOLLOW_REDIRECTION "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥβ<C8A4><CEB2><EFBFBD>"
#else /* LANG != JA */
@@ -148,9 +154,11 @@ static int rc_initialized = 0;
#define CMT_SAVEHIST "Save URL history"
/* #define CMT_KANJICODE "Display Kanji Code" */
#define CMT_FRAME "Automatic rendering of frame"
#define CMT_ARGV_IS_URL "Force argument without scheme to URL"
#define CMT_TSELF "use _self as default target"
#define CMT_DISPLINK "Automatic display of link URL"
#define CMT_MULTICOL "Multi-column output of file names"
#define CMT_ALT_ENTITY "Use alternate expression with ASCII for entity"
#define CMT_COLOR "Display with color"
#define CMT_B_COLOR "Color of normal character"
#define CMT_A_COLOR "Color of anchor"
@@ -168,6 +176,7 @@ static int rc_initialized = 0;
#define CMT_FTP_PROXY "URL of FTP proxy host"
#define CMT_NO_PROXY "Domains for direct access (no proxy)"
#define CMT_NOPROXY_NETADDR "Check noproxy by network address"
#define CMT_NO_CACHE "Don't use cache"
#define CMT_DNS_ORDER "Order of name resolution"
#define CMT_DROOT "Directory corresponds to / (document root)"
#define CMT_PDROOT "Directory corresponds to /~user"
@@ -185,6 +194,7 @@ static int rc_initialized = 0;
#define CMT_USERAGENT "User-Agent"
#define CMT_ACCEPTLANG "Accept-Language"
/* #define CMT_DOCUMENTCODE "Document Charset" */
/* #define CMT_SYSTEMCODE "System Kanji Code" */
#define CMT_WRAP "Wrap search"
#define CMT_VIEW_UNSEENOBJECTS "Display unseenobjects (e.g. bgimage) tag"
#ifdef __EMX__
@@ -197,6 +207,7 @@ static int rc_initialized = 0;
#define CMT_IGNORE_NULL_IMG_ALT "Ignore IMG ALT=\"\" (display link name)"
#define CMT_IFILE "Index file for the directory"
#define CMT_RETRY_HTTP "Prepend http:// to URL automatically"
#define CMT_DECODE_CTE "Decode Content-Transfer-Encoding when saving"
#ifdef MOUSE
#define CMT_MOUSE "Use mouse"
#define CMT_REVERSE_MOUSE "Reverse mouse dragging action"
@@ -223,6 +234,7 @@ static int rc_initialized = 0;
#define CMT_COOKIE_REJECT_DOMAINS "Domains from which should reject cookies"
#define CMT_COOKIE_ACCEPT_DOMAINS "Domains from which should accept cookies"
#endif
#define CMT_FOLLOW_REDIRECTION "Follow this number of redirections"
#endif /* LANG != JA */
#define PI_TEXT 0
@@ -255,6 +267,13 @@ static struct sel_c dcodestr[] =
{CODE_INNER_EUC, "I", STR_INNER_EUC},
{0, NULL, NULL}
};
static struct sel_c scodestr[] =
{
{CODE_EUC, "E", STR_EUC},
{CODE_SJIS, "S", STR_SJIS},
{0, NULL, NULL}
};
#endif /* JP_CHARSET */
#ifdef COLOR
@@ -313,14 +332,21 @@ struct param_ptr params1[] =
{"pixel_per_char", P_PIXELS, PI_TEXT, (void *) &pixel_per_char, CMT_PIXEL_PER_CHAR, NULL},
#ifdef JP_CHARSET
{"kanjicode", P_CODE, PI_SEL_C, (void *) &DisplayCode, CMT_KANJICODE, kcodestr},
{"document_code", P_CODE, PI_SEL_C, (void *) &DocumentCode, CMT_DOCUMENTCODE, dcodestr},
{"system_code", P_CODE, PI_SEL_C, (void *) &SystemCode, CMT_SYSTEMCODE, scodestr},
#endif /* JP_CHARSET */
{"frame", P_CHARINT, PI_ONOFF, (void *) &RenderFrame, CMT_FRAME, NULL},
{"frame", P_CHARINT, PI_ONOFF, (void *) &RenderFrame, CMT_FRAME, NULL},
{"target_self", P_CHARINT, PI_ONOFF, (void *) &TargetSelf, CMT_TSELF, NULL},
{"display_link", P_INT, PI_ONOFF, (void *) &displayLink, CMT_DISPLINK, NULL},
{"ext_dirlist", P_INT, PI_ONOFF, (void *) &UseExternalDirBuffer, CMT_EXT_DIRLIST, NULL},
{"dirlist_cmd", P_STRING, PI_TEXT, (void *) &DirBufferCommand, CMT_DIRLIST_CMD, NULL},
{"multicol", P_INT, PI_ONOFF, (void *) &multicolList, CMT_MULTICOL, NULL},
{"multicol", P_INT, PI_ONOFF, (void *) &multicolList, CMT_MULTICOL, NULL},
{"alt_entity", P_CHARINT, PI_ONOFF, (void *) &UseAltEntity, CMT_ALT_ENTITY, NULL},
{"ignore_null_img_alt", P_INT, PI_ONOFF, (void *) &ignore_null_img_alt, CMT_IGNORE_NULL_IMG_ALT, NULL},
#ifdef VIEW_UNSEENOBJECTS
{"view_unseenobject", P_INT, PI_ONOFF, (void *) &view_unseenobject, CMT_VIEW_UNSEENOBJECTS, NULL},
#endif /* VIEW_UNSEENOBJECTS */
{"show_lnum", P_INT, PI_ONOFF, (void *) &showLineNum, CMT_SHOW_NUM, NULL},
{NULL, 0, 0, NULL, NULL, NULL},
};
@@ -346,34 +372,20 @@ struct param_ptr params2[] =
struct param_ptr params3[] =
{
{"pagerline", P_INT, PI_TEXT, (void *) &PagerMax, CMT_PAGERLINE, NULL},
{"pagerline", P_INT, PI_TEXT, (void *) &PagerMax, CMT_PAGERLINE, NULL},
#ifdef USE_HISTORY
{"history", P_INT, PI_TEXT, (void *) &URLHistSize, CMT_HISTSIZE, NULL},
{"save_hist", P_INT, PI_ONOFF, (void *) &SaveURLHist, CMT_SAVEHIST, NULL},
{"history", P_INT, PI_TEXT, (void *) &URLHistSize, CMT_HISTSIZE, NULL},
{"save_hist", P_INT, PI_ONOFF, (void *) &SaveURLHist, CMT_SAVEHIST, NULL},
#endif /* USE_HISTORY */
{"confirm_qq", P_INT, PI_ONOFF, (void *) &confirm_on_quit, CMT_CONFIRM_QQ, NULL},
{"show_lnum", P_INT, PI_ONOFF, (void *) &showLineNum, CMT_SHOW_NUM, NULL},
{"ftppasswd", P_STRING, PI_TEXT, (void *) &ftppasswd, CMT_FTPPASS, NULL},
{"user_agent", P_STRING, PI_TEXT, (void *) &UserAgent, CMT_USERAGENT, NULL},
{"no_referer", P_INT, PI_ONOFF, (void *) &NoSendReferer, CMT_NOSENDREFERER, NULL},
{"accept_language", P_STRING, PI_TEXT, (void *) &AcceptLang, CMT_ACCEPTLANG, NULL},
#ifdef JP_CHARSET
{"document_code", P_CODE, PI_SEL_C, (void *) &DocumentCode, CMT_DOCUMENTCODE, dcodestr},
#endif
{"wrap_search", P_INT, PI_ONOFF, (void *) &WrapDefault, CMT_WRAP, NULL},
{"ignorecase_search", P_INT, PI_ONOFF, (void *) &IgnoreCase, CMT_IGNORE_CASE, NULL},
#ifdef VIEW_UNSEENOBJECTS
{"view_unseenobject", P_INT, PI_ONOFF, (void *) &view_unseenobject, CMT_VIEW_UNSEENOBJECTS, NULL},
#endif /* VIEW_UNSEENOBJECTS */
{"wrap_search", P_INT, PI_ONOFF, (void *) &WrapDefault, CMT_WRAP, NULL},
{"ignorecase_search", P_INT, PI_ONOFF, (void *) &IgnoreCase, CMT_IGNORE_CASE, NULL},
#ifdef MOUSE
{"use_mouse", P_INT, PI_ONOFF, (void *) &use_mouse, CMT_MOUSE, NULL},
{"reverse_mouse", P_INT, PI_ONOFF, (void *) &reverse_mouse, CMT_REVERSE_MOUSE, NULL},
#endif /* MOUSE */
{"retry_http", P_INT, PI_ONOFF, (void *) &retryAsHttp, CMT_RETRY_HTTP, NULL},
{"clear_buffer", P_INT, PI_ONOFF, (void *) &clear_buffer, CMT_CLEAR_BUF, NULL},
#ifdef USE_SSL
{"ssl_forbid_method", P_STRING, PI_TEXT, (void *) &ssl_forbid_method, CMT_SSL_FORBID_METHOD, NULL},
#endif /* USE_SSL */
{"decode_cte", P_CHARINT, PI_ONOFF, (void *) &DecodeCTE, CMT_DECODE_CTE, NULL},
{NULL, 0, 0, NULL, NULL, NULL},
};
@@ -386,9 +398,8 @@ struct param_ptr params4[] =
{"ftp_proxy", P_STRING, PI_TEXT, (void *) &FTP_proxy, CMT_FTP_PROXY, NULL},
{"no_proxy", P_STRING, PI_TEXT, (void *) &NO_proxy, CMT_NO_PROXY, NULL},
{"noproxy_netaddr", P_INT, PI_ONOFF, (void *) &NOproxy_netaddr, CMT_NOPROXY_NETADDR, NULL},
#ifdef INET6
{"dns_order", P_INT, PI_SEL_C, (void *) &DNS_order, CMT_DNS_ORDER, dnsorders},
#endif /* INET6 */
{"no_cache", P_CHARINT, PI_ONOFF, (void *) &NoCache, CMT_NO_CACHE, NULL},
{NULL, 0, 0, NULL, NULL, NULL},
};
@@ -439,6 +450,23 @@ struct param_ptr params8[] =
{NULL, 0, 0, NULL, NULL, NULL},
};
#endif
struct param_ptr params9[] =
{
{"ftppasswd", P_STRING, PI_TEXT, (void *) &ftppasswd, CMT_FTPPASS, NULL},
{"user_agent", P_STRING, PI_TEXT, (void *) &UserAgent, CMT_USERAGENT, NULL},
{"no_referer", P_INT, PI_ONOFF, (void *) &NoSendReferer, CMT_NOSENDREFERER, NULL},
{"accept_language", P_STRING, PI_TEXT, (void *) &AcceptLang, CMT_ACCEPTLANG, NULL},
{"argv_is_url", P_CHARINT, PI_ONOFF, (void *) &ArgvIsURL, CMT_ARGV_IS_URL, NULL},
{"retry_http", P_INT, PI_ONOFF, (void *) &retryAsHttp, CMT_RETRY_HTTP, NULL},
{"follow_redirection", P_INT, PI_TEXT, &FollowRedirection, CMT_FOLLOW_REDIRECTION, NULL},
#ifdef USE_SSL
{"ssl_forbid_method", P_STRING, PI_TEXT, (void *) &ssl_forbid_method, CMT_SSL_FORBID_METHOD, NULL},
#endif /* USE_SSL */
#ifdef INET6
{"dns_order", P_INT, PI_SEL_C, (void *) &DNS_order, CMT_DNS_ORDER, dnsorders},
#endif /* INET6 */
{NULL, 0, 0, NULL, NULL, NULL},
};
struct param_section sections[] =
{
@@ -447,17 +475,15 @@ struct param_section sections[] =
#ifdef COLOR
{"ɽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", params2},
#endif /* COLOR */
{"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>¾<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", params3},
{"<EFBFBD>ץ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", params4},
{"<EFBFBD><EFBFBD>¿<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", params3},
{"<EFBFBD>ǥ<EFBFBD><EFBFBD><EFBFBD>ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", params5},
{"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ץ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", params6},
{"<EFBFBD>ͥåȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", params9},
{"<EFBFBD>ץ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", params4},
#if defined(USE_SSL) && defined(USE_SSL_VERIFY)
{"SSLǧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", params7},
#endif /* defined(USE_SSL) &&
* defined(USE_SSL_VERIFY) */
#ifdef USE_SSL
#define CMT_SSL_FORBID_METHOD "<22>Ȥ<EFBFBD><C8A4>ʤ<EFBFBD>SSL<53><EFBFBD>åɤΥ<CEA5><EAA5B9>(2: SSLv2, 3: SSLv3, t:TLSv1)"
#endif
#ifdef USE_COOKIE
{"<EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", params8},
#endif
@@ -466,17 +492,15 @@ struct param_section sections[] =
#ifdef COLOR
{"Color Setting", params2},
#endif /* COLOR */
{"Other Behavior", params3},
{"Proxy Setting", params4},
{"Miscellaneous Setting", params3},
{"Directory Setting", params5},
{"External Programs", params6},
{"Network Setting", params9},
{"Proxy Setting", params4},
#if defined(USE_SSL) && defined(USE_SSL_VERIFY)
{"SSL Verification Setting", params7},
#endif /* defined(USE_SSL) &&
* defined(USE_SSL_VERIFY) */
#ifdef USE_SSL
#define CMT_SSL_FORBID_METHOD N_("List of forbidden SSL method (2: SSLv2, 3: SSLv3, t:TLSv1)")
#endif
#ifdef USE_COOKIE
{"Cookie Setting", params8},
#endif
@@ -484,6 +508,8 @@ struct param_section sections[] =
{NULL, NULL}
};
static Str to_str(struct param_ptr *p);
static int
compare_table(struct rc_search_table *a, struct rc_search_table *b)
{
@@ -646,8 +672,8 @@ show_params(FILE * fp)
}
#endif
static int
str_to_bool(char *value)
int
str_to_bool(char *value, int old)
{
if (value == NULL)
return 1;
@@ -657,6 +683,18 @@ str_to_bool(char *value)
case 'n': /* no */
case 'u': /* undef */
return 0;
case 'o':
if (tolower(value[1]) == 'f') /* off */
return 0;
return 1; /* on */
case 't':
if (tolower(value[1]) == 'o') /* toggle */
return ! old;
return 1; /* true */
case '!':
case 'r': /* reverse */
case 'x': /* exchange */
return ! old;
}
return 1;
}
@@ -774,13 +812,16 @@ set_param(char *name, char *value)
return 0;
switch (p->type) {
case P_INT:
*(int *) p->varptr = (p->inputtype == PI_ONOFF) ? str_to_bool(value) : atoi(value);
*(int *) p->varptr = (p->inputtype == PI_ONOFF)
? str_to_bool(value, *(int *) p->varptr) : atoi(value);
break;
case P_SHORT:
*(short *) p->varptr = (p->inputtype == PI_ONOFF) ? str_to_bool(value) : atoi(value);
*(short *) p->varptr = (p->inputtype == PI_ONOFF)
? str_to_bool(value, *(short *) p->varptr) : atoi(value);
break;
case P_CHARINT:
*(char *) p->varptr = (p->inputtype == PI_ONOFF) ? str_to_bool(value) : atoi(value);
*(char *) p->varptr = (p->inputtype == PI_ONOFF)
? str_to_bool(value, *(char *) p->varptr) : atoi(value);
break;
case P_CHAR:
*(char *) p->varptr = value[0];
@@ -817,8 +858,6 @@ set_param(char *name, char *value)
return 1;
}
static void sync_with_option(void);
int
set_param_option(char *option)
{
@@ -851,10 +890,18 @@ set_param_option(char *option)
goto option_assigned;
return 0;
option_assigned:
sync_with_option();
return 1;
}
char *
get_param_option(char *name)
{
struct param_ptr *p;
p = search_param(name);
return p ? to_str(p)->ptr : NULL;
}
static void
interpret_rc(FILE * f)
{
@@ -995,7 +1042,7 @@ initMimeTypes()
UserMimeTypes[i] = loadMimeTypes(tl->ptr);
}
static void
void
sync_with_option(void)
{
WrapSearch = WrapDefault;
@@ -1071,7 +1118,7 @@ init_rc(char *config_file)
static char optionpanel_src1[] =
"<html><head><title>Option Setting Panel</title></head>\
<body><center><b>Option Setting Panel</b></center><p>\n"
<body><center><b>Option Setting Panel</b><br><b>(w3m version %s)</b></center><p>\n"
#ifdef __EMX__
"<a href=\"file:///$LIB/w3mhelperpanel.exe?mode=panel\">%s</a>\n"
#else /* not __EMX__ */
@@ -1112,7 +1159,7 @@ to_str(struct param_ptr *p)
Buffer *
load_option_panel(void)
{
Str src = Sprintf(optionpanel_src1, CMT_HELPER);
Str src = Sprintf(optionpanel_src1, version, CMT_HELPER);
struct param_ptr *p;
struct sel_c *s;
int x, i;
@@ -1134,7 +1181,7 @@ load_option_panel(void)
Strcat_m_charp(src, "<input type=text name=",
p->name,
" value=\"",
htmlquote_str( to_str(p)->ptr ),
html_quote( to_str(p)->ptr ),
"\">", NULL);
break;
case PI_ONOFF: