diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-09-24 18:48:58 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-09-24 18:48:58 +0000 |
commit | b411c1109dc4305a231689405e214f2e307c3cde (patch) | |
tree | c5a293e6144d774e7f7d32da269f57ebed50d328 | |
parent | gettextize (diff) | |
download | w3m-b411c1109dc4305a231689405e214f2e307c3cde.tar.gz w3m-b411c1109dc4305a231689405e214f2e307c3cde.zip |
fix indent
-rw-r--r-- | anchor.c | 11 | ||||
-rw-r--r-- | display.c | 25 | ||||
-rw-r--r-- | entity.c | 6 | ||||
-rw-r--r-- | etc.c | 8 | ||||
-rw-r--r-- | file.c | 238 | ||||
-rw-r--r-- | fm.h | 8 | ||||
-rw-r--r-- | func.c | 13 | ||||
-rw-r--r-- | hash.h | 4 | ||||
-rw-r--r-- | html.c | 5 | ||||
-rw-r--r-- | linein.c | 6 | ||||
-rw-r--r-- | main.c | 21 | ||||
-rw-r--r-- | map.c | 8 | ||||
-rw-r--r-- | menu.c | 20 | ||||
-rw-r--r-- | rc.c | 34 | ||||
-rw-r--r-- | regex.c | 6 | ||||
-rw-r--r-- | table.c | 20 |
16 files changed, 226 insertions, 207 deletions
@@ -1,4 +1,4 @@ -/* $Id: anchor.c,v 1.28 2003/09/22 21:02:16 ukai Exp $ */ +/* $Id: anchor.c,v 1.29 2003/09/24 18:48:58 ukai Exp $ */ #include "fm.h" #include "myctype.h" #include "regex.h" @@ -811,7 +811,8 @@ link_list_panel(Buffer *buf) if (a->title && *a->title) t = html_quote(a->title); else if (DecodeURL) - t = html_quote(url_unquote_conv(a->url, buf->document_charset)); + t = html_quote(url_unquote_conv + (a->url, buf->document_charset)); else t = html_quote(a->url); Strcat_m_charp(tmp, "<li><a href=\"", u, "\">", t, "</a><br>", p, @@ -838,14 +839,16 @@ link_list_panel(Buffer *buf) u = html_quote(p); if (DecodeURL) p = html_quote(url_unquote_conv(p, - buf->document_charset)); + buf-> + document_charset)); else p = u; if (m->alt && *m->alt) t = html_quote(m->alt); else if (DecodeURL) t = html_quote(url_unquote_conv(m->url, - buf->document_charset)); + buf-> + document_charset)); else t = html_quote(m->url); Strcat_m_charp(tmp, "<li><a href=\"", u, "\">", t, @@ -1,10 +1,11 @@ -/* $Id: display.c,v 1.66 2003/09/22 21:02:17 ukai Exp $ */ +/* $Id: display.c,v 1.67 2003/09/24 18:48:59 ukai Exp $ */ #include <signal.h> #include "fm.h" #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) +/* *INDENT-OFF* */ #ifdef USE_COLOR #define EFFECT_ANCHOR_START effect_anchor_start() @@ -20,8 +21,17 @@ #define EFFECT_MARK_START effect_mark_start() #define EFFECT_MARK_END effect_mark_end() -/* color: * 0 black * 1 red * 2 green * 3 yellow - * * 4 blue * 5 magenta * 6 cyan * 7 white */ +/*- + * color: + * 0 black + * 1 red + * 2 green + * 3 yellow + * 4 blue + * 5 magenta + * 6 cyan + * 7 white + */ #define EFFECT_ANCHOR_START_C setfcolor(anchor_color) #define EFFECT_IMAGE_START_C setfcolor(image_color) @@ -62,6 +72,7 @@ #define define_effect(name_start,name_end,color_start,color_end,mono_start,mono_end) \ static void name_start { if (useColor) { color_start; } else { mono_start; }}\ static void name_end { if (useColor) { color_end; } else { mono_end; }} + define_effect(EFFECT_ANCHOR_START, EFFECT_ANCHOR_END, EFFECT_ANCHOR_START_C, EFFECT_ANCHOR_END_C, EFFECT_ANCHOR_START_M, EFFECT_ANCHOR_END_M) define_effect(EFFECT_IMAGE_START, EFFECT_IMAGE_END, EFFECT_IMAGE_START_C, @@ -72,7 +83,6 @@ define_effect(EFFECT_MARK_START, EFFECT_MARK_END, EFFECT_MARK_START_C, EFFECT_MARK_END_C, EFFECT_MARK_START_M, EFFECT_MARK_END_M) /*****************/ -/* *INDENT-OFF* */ static void EFFECT_ACTIVE_START { @@ -131,7 +141,7 @@ EFFECT_VISITED_END } } } -/* *INDENT-ON* */ + #else /* not USE_COLOR */ #define EFFECT_ANCHOR_START underline() @@ -147,9 +157,8 @@ EFFECT_VISITED_END #define EFFECT_MARK_START standout() #define EFFECT_MARK_END standend() #endif /* not USE_COLOR */ -/* - * Terminate routine. - */ +/* *INDENT-ON* */ + void fmTerm(void) { @@ -1,10 +1,10 @@ -/* $Id: entity.c,v 1.6 2003/09/22 21:27:42 ukai Exp $ */ +/* $Id: entity.c,v 1.7 2003/09/24 18:48:59 ukai Exp $ */ #ifdef DUMMY #include "Str.h" #define NBSP " " #define UseAltEntity 1 #undef USE_M17N -#else /* DUMMY */ +#else /* DUMMY */ #include "fm.h" #ifdef USE_M17N #ifdef USE_UNICODE @@ -12,7 +12,7 @@ #include "utf8.h" #endif #endif -#endif /* DUMMY */ +#endif /* DUMMY */ /* *INDENT-OFF* */ static char *alt_latin1[ 96 ] = { @@ -1,4 +1,4 @@ -/* $Id: etc.c,v 1.72 2003/09/22 21:02:18 ukai Exp $ */ +/* $Id: etc.c,v 1.73 2003/09/24 18:48:59 ukai Exp $ */ #include "fm.h" #include <pwd.h> #include "myctype.h" @@ -481,7 +481,7 @@ nextColumn(int n, char *p, Lineprop *pr) #ifdef USE_M17N if (*pr & PC_UNKNOWN) return n + 4; - return n + wtf_width((wc_uchar *)p); + return n + wtf_width((wc_uchar *) p); #else return n + 1; #endif @@ -537,7 +537,7 @@ columnLen(Line *line, int column) { int i, j; - for (i = 0, j = 0; i < line->len; ) { + for (i = 0, j = 0; i < line->len;) { j = nextColumn(j, &line->lineBuf[i], &line->propBuf[i]); if (j > column) return i; @@ -816,7 +816,7 @@ read_token(Str buf, char **instr, int *status, int pre, int append) Strclear(buf); if (pre) Strcat_char(buf, *p); - p++; + p++; goto proc_end; } Strcat_char(buf, (!pre && IS_SPACE(*p)) ? ' ' : *p); @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.227 2003/09/22 21:02:18 ukai Exp $ */ +/* $Id: file.c,v 1.228 2003/09/24 18:48:59 ukai Exp $ */ #include "fm.h" #include <sys/types.h> #include "myctype.h" @@ -641,7 +641,7 @@ readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu) lineBuf2 = convertLine(NULL, lineBuf2, RAW_MODE, mime_charset ? &mime_charset : &charset, mime_charset ? mime_charset - : DocumentCharset); + : DocumentCharset); /* separated with line and stored */ tmp = Strnew_size(lineBuf2->length); for (p = lineBuf2->ptr; *p; p = q) { @@ -4430,7 +4430,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) case HTML_PRE_PLAIN: CLOSE_A; if (!(obuf->flag & RB_IGNORE_P)) { - flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); + flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); do_blankline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); } @@ -4439,7 +4439,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) case HTML_N_PRE_PLAIN: CLOSE_A; if (!(obuf->flag & RB_IGNORE_P)) { - flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); + flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); do_blankline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); obuf->flag |= RB_IGNORE_P; @@ -4451,7 +4451,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) case HTML_PLAINTEXT: CLOSE_A; if (!(obuf->flag & RB_IGNORE_P)) { - flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); + flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); do_blankline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); } @@ -4472,7 +4472,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) case HTML_N_XMP: CLOSE_A; if (!(obuf->flag & RB_IGNORE_P)) { - flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); + flushline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); do_blankline(h_env, obuf, envs[h_env->envc].indent, 0, h_env->limit); obuf->flag |= RB_IGNORE_P; @@ -4776,13 +4776,13 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) return 0; case HTML_DEL: if (displayInsDel) - HTMLlineproc1("<U>[DEL:</U>", h_env); + HTMLlineproc1("<U>[DEL:</U>", h_env); else obuf->flag |= RB_DEL; return 1; case HTML_N_DEL: if (displayInsDel) - HTMLlineproc1("<U>:DEL]</U>", h_env); + HTMLlineproc1("<U>:DEL]</U>", h_env); else obuf->flag &= ~RB_DEL; return 1; @@ -4800,11 +4800,11 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) return 1; case HTML_INS: if (displayInsDel) - HTMLlineproc1("<U>[INS:</U>", h_env); + HTMLlineproc1("<U>[INS:</U>", h_env); return 1; case HTML_N_INS: if (displayInsDel) - HTMLlineproc1("<U>:INS]</U>", h_env); + HTMLlineproc1("<U>:INS]</U>", h_env); return 1; case HTML_SUP: if (!(obuf->flag & (RB_DEL | RB_S))) @@ -5717,32 +5717,32 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal) * Tag processing */ if (obuf->status == R_ST_EOL) - obuf->status = R_ST_NORMAL; + obuf->status = R_ST_NORMAL; else { read_token(h_env->tagbuf, &line, &obuf->status, pre_mode & RB_PREMODE, obuf->status != R_ST_NORMAL); if (obuf->status != R_ST_NORMAL) - return; + return; } if (h_env->tagbuf->length == 0) continue; str = h_env->tagbuf->ptr; if (*str == '<') { if (str[1] && REALLY_THE_BEGINNING_OF_A_TAG(str)) - is_tag = TRUE; + is_tag = TRUE; else if (!(pre_mode & (RB_PLAIN | RB_INTXTA | RB_INSELECT | RB_SCRIPT | RB_STYLE | RB_TITLE))) { line = Strnew_m_charp(str + 1, line, NULL)->ptr; str = "<"; } - } } - else { + } + else { read_token(tokbuf, &line, &obuf->status, pre_mode & RB_PREMODE, 0); if (obuf->status != R_ST_NORMAL) /* R_ST_AMP ? */ obuf->status = R_ST_NORMAL; str = tokbuf->ptr; - } + } if (pre_mode & (RB_PLAIN | RB_INTXTA | RB_INSELECT | RB_SCRIPT | RB_STYLE | RB_TITLE)) { @@ -5775,7 +5775,7 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal) line = Strnew_m_charp(p, line, NULL)->ptr; } is_tag = FALSE; - } + } if (obuf->table_level >= 0) goto proc_normal; /* textarea */ @@ -5788,7 +5788,7 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal) continue; /* style */ if (pre_mode & RB_STYLE) - continue; + continue; } proc_normal: @@ -5872,133 +5872,133 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal) if (obuf->flag & (RB_DEL | RB_S)) continue; while (*str) { - mode = get_mctype(str); - delta = get_mcwidth(str); - if (obuf->flag & (RB_SPECIAL & ~RB_NOBR)) { - char ch = *str; + mode = get_mctype(str); + delta = get_mcwidth(str); + if (obuf->flag & (RB_SPECIAL & ~RB_NOBR)) { + char ch = *str; if (!(obuf->flag & RB_PLAIN) && (*str == '&')) { - char *p = str; - int ech = getescapechar(&p); - if (ech == '\n' || ech == '\r') { - ch = '\n'; - str = p - 1; - } - else if (ech == '\t') { - ch = '\t'; - str = p - 1; + char *p = str; + int ech = getescapechar(&p); + if (ech == '\n' || ech == '\r') { + ch = '\n'; + str = p - 1; + } + else if (ech == '\t') { + ch = '\t'; + str = p - 1; + } } - } - if (ch != '\n') - obuf->flag &= ~RB_IGNORE_P; - if (ch == '\n') { - str++; - if (obuf->flag & RB_IGNORE_P) { + if (ch != '\n') obuf->flag &= ~RB_IGNORE_P; - continue; - } - if (obuf->flag & RB_PRE_INT) - PUSH(' '); - else + if (ch == '\n') { + str++; + if (obuf->flag & RB_IGNORE_P) { + obuf->flag &= ~RB_IGNORE_P; + continue; + } + if (obuf->flag & RB_PRE_INT) + PUSH(' '); + else flushline(h_env, obuf, h_env->envs[h_env->envc].indent, 1, h_env->limit); - } - else if (ch == '\t') { - do { - PUSH(' '); - } while ((h_env->envs[h_env->envc].indent + obuf->pos) - % Tabstop != 0); - str++; - } - else if (obuf->flag & RB_PLAIN) { - char *p = html_quote_char(*str); - if (p) { - push_charp(obuf, 1, p, PC_ASCII); + } + else if (ch == '\t') { + do { + PUSH(' '); + } while ((h_env->envs[h_env->envc].indent + obuf->pos) + % Tabstop != 0); str++; } + else if (obuf->flag & RB_PLAIN) { + char *p = html_quote_char(*str); + if (p) { + push_charp(obuf, 1, p, PC_ASCII); + str++; + } + else { + proc_mchar(obuf, 1, delta, &str, mode); + } + } else { - proc_mchar(obuf, 1, delta, &str, mode); + if (*str == '&') + proc_escape(obuf, &str); + else + proc_mchar(obuf, 1, delta, &str, mode); } + if (obuf->flag & (RB_SPECIAL & ~RB_PRE_INT)) + continue; } else { - if (*str == '&') - proc_escape(obuf, &str); - else - proc_mchar(obuf, 1, delta, &str, mode); - } - if (obuf->flag & (RB_SPECIAL & ~RB_PRE_INT)) - continue; - } - else { - if (!IS_SPACE(*str)) - obuf->flag &= ~RB_IGNORE_P; - if ((mode == PC_ASCII || mode == PC_CTRL) && IS_SPACE(*str)) { - if (*obuf->prevchar->ptr != ' ') { - PUSH(' '); + if (!IS_SPACE(*str)) + obuf->flag &= ~RB_IGNORE_P; + if ((mode == PC_ASCII || mode == PC_CTRL) && IS_SPACE(*str)) { + if (*obuf->prevchar->ptr != ' ') { + PUSH(' '); + } + str++; } - str++; - } - else { + else { #ifdef USE_M17N - if (mode == PC_KANJI1) - is_hangul = wtf_is_hangul((wc_uchar *) str); - else - is_hangul = 0; - if (mode == PC_KANJI1 && - !is_hangul && !prev_is_hangul && - obuf->pos > h_env->envs[h_env->envc].indent && - Strlastchar(obuf->line) == ' ') { - while (obuf->line->length >= 2 && + if (mode == PC_KANJI1) + is_hangul = wtf_is_hangul((wc_uchar *) str); + else + is_hangul = 0; + if (mode == PC_KANJI1 && + !is_hangul && !prev_is_hangul && + obuf->pos > h_env->envs[h_env->envc].indent && + Strlastchar(obuf->line) == ' ') { + while (obuf->line->length >= 2 && !strncmp(obuf->line->ptr + obuf->line->length - 2, " ", 2) - && obuf->pos >= h_env->envs[h_env->envc].indent) { - Strshrink(obuf->line, 1); - obuf->pos--; - } - if (obuf->line->length >= 3 && - obuf->prev_ctype == PC_KANJI1 && - Strlastchar(obuf->line) == ' ' && - obuf->pos >= h_env->envs[h_env->envc].indent) { - Strshrink(obuf->line, 1); - obuf->pos--; + && obuf->pos >= h_env->envs[h_env->envc].indent) { + Strshrink(obuf->line, 1); + obuf->pos--; + } + if (obuf->line->length >= 3 && + obuf->prev_ctype == PC_KANJI1 && + Strlastchar(obuf->line) == ' ' && + obuf->pos >= h_env->envs[h_env->envc].indent) { + Strshrink(obuf->line, 1); + obuf->pos--; + } } - } - prev_is_hangul = is_hangul; + prev_is_hangul = is_hangul; #endif - if (*str == '&') - proc_escape(obuf, &str); - else - proc_mchar(obuf, obuf->flag & RB_SPECIAL, delta, &str, - mode); + if (*str == '&') + proc_escape(obuf, &str); + else + proc_mchar(obuf, obuf->flag & RB_SPECIAL, delta, &str, + mode); + } } - } - if (need_flushline(h_env, obuf, mode)) { - char *bp = obuf->line->ptr + obuf->bp.len; - char *tp = bp - obuf->bp.tlen; - int i = 0; + if (need_flushline(h_env, obuf, mode)) { + char *bp = obuf->line->ptr + obuf->bp.len; + char *tp = bp - obuf->bp.tlen; + int i = 0; - if (tp > obuf->line->ptr && tp[-1] == ' ') - i = 1; + if (tp > obuf->line->ptr && tp[-1] == ' ') + i = 1; - indent = h_env->envs[h_env->envc].indent; - if (obuf->bp.pos - i > indent) { - Str line; - append_tags(obuf); - line = Strnew_charp(bp); - Strshrink(obuf->line, obuf->line->length - obuf->bp.len); + indent = h_env->envs[h_env->envc].indent; + if (obuf->bp.pos - i > indent) { + Str line; + append_tags(obuf); + line = Strnew_charp(bp); + Strshrink(obuf->line, obuf->line->length - obuf->bp.len); #ifdef FORMAT_NICE - if (obuf->pos - i > h_env->limit) - obuf->flag |= RB_FILL; + if (obuf->pos - i > h_env->limit) + obuf->flag |= RB_FILL; #endif /* FORMAT_NICE */ - back_to_breakpoint(obuf); - flushline(h_env, obuf, indent, 0, h_env->limit); + back_to_breakpoint(obuf); + flushline(h_env, obuf, indent, 0, h_env->limit); #ifdef FORMAT_NICE - obuf->flag &= ~RB_FILL; + obuf->flag &= ~RB_FILL; #endif /* FORMAT_NICE */ - HTMLlineproc1(line->ptr, h_env); + HTMLlineproc1(line->ptr, h_env); + } } } } - } if (!(obuf->flag & (RB_SPECIAL | RB_INTXTA | RB_INSELECT))) { char *tp; int i = 0; @@ -6664,7 +6664,7 @@ loadHTMLString(Str page) * loadGopherDir: get gopher directory */ Str -loadGopherDir(URLFile *uf, ParsedURL *pu, wc_ces *charset) +loadGopherDir(URLFile *uf, ParsedURL *pu, wc_ces * charset) { Str volatile tmp; Str lbuf, name, file, host, port; @@ -1,4 +1,4 @@ -/* $Id: fm.h,v 1.121 2003/09/23 18:42:25 ukai Exp $ */ +/* $Id: fm.h,v 1.122 2003/09/24 18:48:59 ukai Exp $ */ /* * w3m: WWW wo Miru utility * @@ -51,7 +51,7 @@ #include <locale.h> #endif #if !HAVE_SETLOCALE -#define setlocale(category, locale) /* empty */ +#define setlocale(category, locale) /* empty */ #endif #if ENABLE_NLS @@ -60,9 +60,9 @@ #define N_(String) (String) #else # undef bindtextdomain -# define bindtextdomain(Domain, Directory) /* empty */ +# define bindtextdomain(Domain, Directory) /* empty */ # undef textdomain -# define textdomain(Domain) /* empty */ +# define textdomain(Domain) /* empty */ # define _(Text) Text # define N_(Text) Text # define gettext(Text) Text @@ -1,4 +1,4 @@ -/* $Id: func.c,v 1.25 2003/09/22 21:02:18 ukai Exp $ */ +/* $Id: func.c,v 1.26 2003/09/24 18:48:59 ukai Exp $ */ /* * w3m func.c */ @@ -79,13 +79,13 @@ setKeymap(char *p, int lineno, int verbose) if (keyData == NULL) keyData = newHash_iv(KEYDATA_HASH_SIZE); putHash_iv(keyData, m, (void *)mmap); - if (c & K_ESCD) + if (c & K_ESCD) map = mmap[3]; - else if (c & K_ESCB) + else if (c & K_ESCB) map = mmap[2]; - else if (c & K_ESC) + else if (c & K_ESC) map = mmap[1]; - else + else map = mmap[0]; } else { @@ -610,7 +610,8 @@ initMouseAction(void) #else char **symbol = get_symbol(); #endif - mouse_action.lastline_str = Strnew_charp(symbol[N_GRAPH_SYMBOL + 13])->ptr; + mouse_action.lastline_str = + Strnew_charp(symbol[N_GRAPH_SYMBOL + 13])->ptr; } if ((mf = fopen(confFile(MOUSE_FILE), "rt")) != NULL) { @@ -1,4 +1,4 @@ -/* $Id: hash.h,v 1.5 2003/07/22 17:33:16 ukai Exp $ */ +/* $Id: hash.h,v 1.6 2003/09/24 18:48:59 ukai Exp $ */ #ifndef HASH_H #define HASH_H @@ -19,7 +19,7 @@ extern void putHash_##sym(Hash_##sym *t, keytype key, type value); \ extern type getHash_##sym(Hash_##sym *t, keytype key, type failval); defhash(char *, int, si) - defhash(char *, char *, ss) +defhash(char *, char *, ss) defhash(char *, void *, sv) defhash(int, void *, iv) #define defhashfunc(keytype,type,sym) \ @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.26 2003/09/22 21:02:18 ukai Exp $ */ +/* $Id: html.c,v 1.27 2003/09/24 18:48:59 ukai Exp $ */ #include "html.h" /* Define HTML Tag Infomation Table */ @@ -6,7 +6,8 @@ #define ATTR_CORE ATTR_ID #define MAXA_CORE 1 unsigned char ALST_A[] = { - ATTR_NAME, ATTR_HREF, ATTR_REL, ATTR_CHARSET, ATTR_TARGET, ATTR_HSEQ, ATTR_REFERER, + ATTR_NAME, ATTR_HREF, ATTR_REL, ATTR_CHARSET, ATTR_TARGET, ATTR_HSEQ, + ATTR_REFERER, ATTR_FRAMENAME, ATTR_TITLE, ATTR_ACCESSKEY, ATTR_CORE }; #define MAXA_A MAXA_CORE + 10 @@ -1,4 +1,4 @@ -/* $Id: linein.c,v 1.32 2003/09/22 21:02:19 ukai Exp $ */ +/* $Id: linein.c,v 1.33 2003/09/24 18:48:59 ukai Exp $ */ #include "fm.h" #include "local.h" #include "myctype.h" @@ -184,8 +184,8 @@ inputLineHistSearch(char *prompt, char *def_str, int flag, Hist *hist, cm_clear = TRUE; cm_disp_clear = TRUE; if (!i_quote && - (((cm_mode & CPL_ALWAYS) && (c == CTRL_I || c == ' ')) || - ((cm_mode & CPL_ON) && (c == CTRL_I)))) { + (((cm_mode & CPL_ALWAYS) && (c == CTRL_I || c == ' ')) || + ((cm_mode & CPL_ON) && (c == CTRL_I)))) { if (emacs_like_lineedit && cm_next) { _dcompl(); need_redraw = TRUE; @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.232 2003/09/23 18:42:25 ukai Exp $ */ +/* $Id: main.c,v 1.233 2003/09/24 18:48:59 ukai Exp $ */ #define MAINPROGRAM #include "fm.h" #include <signal.h> @@ -1606,8 +1606,8 @@ srchcore(char *volatile str, int (*func) (Buffer *, char *)) #ifdef USE_M17N if (SearchConv && !WcOption.pre_conv && - Currentbuf->document_charset != DisplayCharset) - str = wtf_conv_fit(str, Currentbuf->document_charset); + Currentbuf->document_charset != DisplayCharset) + str = wtf_conv_fit(str, Currentbuf->document_charset); else #endif str = SearchString; @@ -4159,10 +4159,12 @@ adBmark(void) * WC_CES_SHIFT_JIS, shouldn't it? - ukai */ (Str_form_quote(wc_conv_strict(Currentbuf->buffername, - InnerCharset, WC_CES_EUC_JP)))->ptr); + InnerCharset, + WC_CES_EUC_JP)))->ptr); #else (Str_form_quote(wc_conv_strict(Currentbuf->buffername, - InnerCharset, SystemCharset)))->ptr); + InnerCharset, + SystemCharset)))->ptr); #endif #else (Str_form_quote(Strnew_charp(Currentbuf->buffername)))->ptr); @@ -4509,7 +4511,8 @@ _peekURL(int only_img) s = parsedURL2Str(&pu); } if (DecodeURL) - s = Strnew_charp(url_unquote_conv(s->ptr, Currentbuf->document_charset)); + s = Strnew_charp(url_unquote_conv + (s->ptr, Currentbuf->document_charset)); #ifdef USE_M17N s = checkType(s, &pp, NULL); p = NewAtom_N(Lineprop, s->length); @@ -4618,7 +4621,7 @@ vwSrc(void) old_charset = DisplayCharset; old_fix_width_conv = WcOption.fix_width_conv; DisplayCharset = (Currentbuf->document_charset != WC_CES_US_ASCII) - ? Currentbuf->document_charset : 0; + ? Currentbuf->document_charset : 0; WcOption.fix_width_conv = WC_FALSE; #endif saveBufferBody(Currentbuf, f, TRUE); @@ -5223,7 +5226,7 @@ do_mouse_action(int btn, int x, int y) #ifdef USE_M17N || (WcOption.use_wide && Currentbuf->currentLine != NULL && (CharType(Currentbuf->currentLine-> - propBuf[Currentbuf->pos]) == PC_KANJI1) + propBuf[Currentbuf->pos]) == PC_KANJI1) && x == Currentbuf->cursorX + Currentbuf->rootX + 1) #endif ) && @@ -5285,7 +5288,7 @@ process_mouse(int btn, int x, int y) || (WcOption.use_wide && Currentbuf->currentLine != NULL && (CharType(Currentbuf->currentLine-> - propBuf[Currentbuf->pos]) == PC_KANJI1) + propBuf[Currentbuf->pos]) == PC_KANJI1) && Currentbuf->cursorX == press_x - Currentbuf->rootX - 1) #endif @@ -1,4 +1,4 @@ -/* $Id: map.c,v 1.29 2003/09/22 21:02:20 ukai Exp $ */ +/* $Id: map.c,v 1.30 2003/09/24 18:49:00 ukai Exp $ */ /* * client-side image maps */ @@ -561,8 +561,7 @@ page_info_panel(Buffer *buf) "<tr valign=top><td nowrap>Document Type<td>", buf->real_type ? html_quote(buf->real_type) : "unknown", "<tr valign=top><td nowrap>Last Modified<td>", - html_quote(last_modified(buf)), - NULL); + html_quote(last_modified(buf)), NULL); #ifdef USE_M17N if (buf->document_charset != InnerCharset) { list = wc_get_ces_list(); @@ -572,8 +571,7 @@ page_info_panel(Buffer *buf) sprintf(charset, "%d", (unsigned int)list->id); Strcat_m_charp(tmp, "<option value=", charset, (buf->document_charset == list->id) ? " selected>" - : ">", - list->desc, NULL); + : ">", list->desc, NULL); } Strcat_charp(tmp, "</select>"); Strcat_charp(tmp, "<tr><td><td><input type=submit value=Change>"); @@ -1,4 +1,4 @@ -/* $Id: menu.c,v 1.37 2003/09/24 18:35:06 ukai Exp $ */ +/* $Id: menu.c,v 1.38 2003/09/24 18:49:00 ukai Exp $ */ /* * w3m menu.c */ @@ -257,7 +257,7 @@ static int smDelTab(char c); static Menu MainMenu; #if LANG == JA -static wc_ces MainMenuCharset = WC_CES_EUC_JP; /* charset of source code */ +static wc_ces MainMenuCharset = WC_CES_EUC_JP; /* charset of source code */ static int MainMenuEncode = FALSE; static MenuItem MainMenuItem[] = { /* type label variabel value func popup keys data */ @@ -296,9 +296,11 @@ static int MainMenuEncode = TRUE; #endif static MenuItem MainMenuItem[] = { /* type label variable value func popup keys data */ - {MENU_FUNC, N_(" Back (b) "), NULL, 0, backBf, NULL, "b", NULL}, - {MENU_POPUP, N_(" Select Buffer(s) "), NULL, 0, NULL, &SelectMenu, "s", NULL}, - {MENU_POPUP, N_(" Select Tab (t) "), NULL, 0, NULL, &SelTabMenu, "tT", NULL}, + {MENU_FUNC, N_(" Back (b) "), NULL, 0, backBf, NULL, "b", NULL}, + {MENU_POPUP, N_(" Select Buffer(s) "), NULL, 0, NULL, &SelectMenu, "s", + NULL}, + {MENU_POPUP, N_(" Select Tab (t) "), NULL, 0, NULL, &SelTabMenu, "tT", + NULL}, {MENU_FUNC, N_(" View Source (v) "), NULL, 0, vwSrc, NULL, "vV", NULL}, {MENU_FUNC, N_(" Edit Source (e) "), NULL, 0, editBf, NULL, "eE", NULL}, {MENU_FUNC, N_(" Save Source (S) "), NULL, 0, svSrc, NULL, "S", NULL}, @@ -1729,7 +1731,7 @@ interpret_menu(FILE * mf) #ifdef USE_M17N else if (!strcmp(s, "charset") || !strcmp(s, "encoding")) { s = getQWord(&p); - if (*s == '\0') /* error */ + if (*s == '\0') /* error */ continue; charset = wc_guess_charset(s, charset); } @@ -1760,11 +1762,11 @@ initMenu(void) MenuItem *item; #if ENABLE_NLS /* FIXME: charset that gettext(3) returns */ - MainMenuCharset = SystemCharset; + MainMenuCharset = SystemCharset; #endif for (item = MainMenuItem; item->type != MENU_END; item++) item->label = - wc_conv(gettext(item->label), MainMenuCharset, + wc_conv(gettext(item->label), MainMenuCharset, InnerCharset)->ptr; MainMenuEncode = TRUE; } @@ -1893,7 +1895,7 @@ link_menu(Buffer *buf) if (!l->url) p = ""; else if (DecodeURL) - p = url_unquote_conv(l->url, buf->document_charset); + p = url_unquote_conv(l->url, buf->document_charset); else p = l->url; Strcat_charp(str, p); @@ -1,4 +1,4 @@ -/* $Id: rc.c,v 1.90 2003/09/24 18:35:06 ukai Exp $ */ +/* $Id: rc.c,v 1.91 2003/09/24 18:49:00 ukai Exp $ */ /* * Initialization file etc. */ @@ -52,7 +52,7 @@ static int RC_table_size; #define P_SCALE 10 #if LANG == JA -static wc_ces OptionCharset = WC_CES_EUC_JP; /* charset of source code */ +static wc_ces OptionCharset = WC_CES_EUC_JP; /* charset of source code */ static int OptionEncode = FALSE; #define CMT_HELPER "外部ビューアの編集" @@ -534,7 +534,7 @@ static struct sel_c auto_detect_str[] = { struct param_ptr params1[] = { {"tabstop", P_NZINT, PI_TEXT, (void *)&Tabstop, CMT_TABSTOP, NULL}, {"indent_incr", P_NZINT, PI_TEXT, (void *)&IndentIncr, CMT_INDENT_INCR, - NULL}, + NULL}, {"pixel_per_char", P_PIXELS, PI_TEXT, (void *)&pixel_per_char, CMT_PIXEL_PER_CHAR, NULL}, #ifdef USE_IMAGE @@ -1019,14 +1019,16 @@ show_params(FILE * fp) char *cmt; #if ENABLE_NLS - OptionCharset = SystemCharset; /* FIXME */ -#endif + OptionCharset = SystemCharset; /* FIXME */ +#endif fputs("\nconfiguration parameters\n", fp); for (j = 0; sections[j].name != NULL; j++) { #if LANG == JA || ENABLE_NLS if (!OptionEncode) - cmt = wc_conv(gettext(sections[j].name), OptionCharset, InnerCharset)->ptr; + cmt = + wc_conv(gettext(sections[j].name), OptionCharset, + InnerCharset)->ptr; else #endif cmt = sections[j].name; @@ -1379,9 +1381,9 @@ sync_with_option(void) AcceptLang = "ja;q=1.0, en;q=0.5"; #else /* LANG != JA (must be EN) */ /* TRANSLATORS: - AcceptLang default: this is used in Accept-Language: HTTP request - header. For example, ja.po should translate it as - "ja;q=1.0, en;q=0.5" like that. + * AcceptLang default: this is used in Accept-Language: HTTP request + * header. For example, ja.po should translate it as + * "ja;q=1.0, en;q=0.5" like that. */ AcceptLang = _("en;q=1.0"); #endif @@ -1501,7 +1503,7 @@ to_str(struct param_ptr *p) #endif #ifdef USE_M17N case P_CODE: - return Sprintf("%d", (int)(*(wc_ces *)p->varptr)); + return Sprintf("%d", (int)(*(wc_ces *) p->varptr)); #endif case P_NZINT: return Sprintf("%d", *(int *)p->varptr); @@ -1542,7 +1544,7 @@ load_option_panel(void) optionpanel_str = Sprintf(optionpanel_src1, w3m_version, html_quote(localCookie()->ptr), CMT_HELPER); #if ENABLE_NLS - OptionCharset = SystemCharset; /* FIXME */ + OptionCharset = SystemCharset; /* FIXME */ #endif #if LANG == JA || ENABLE_NLS if (!OptionEncode) { @@ -1550,15 +1552,15 @@ load_option_panel(void) wc_Str_conv(optionpanel_str, OptionCharset, InnerCharset); for (i = 0; sections[i].name != NULL; i++) { sections[i].name = - wc_conv(gettext(sections[i].name), OptionCharset, + wc_conv(gettext(sections[i].name), OptionCharset, InnerCharset)->ptr; for (p = sections[i].params; p->name; p++) p->comment = - wc_conv(gettext(p->comment), OptionCharset, + wc_conv(gettext(p->comment), OptionCharset, InnerCharset)->ptr; } for (s = colorstr; s->text; s++) - s->text = wc_conv(gettext(s->text), OptionCharset, + s->text = wc_conv(gettext(s->text), OptionCharset, InnerCharset)->ptr; OptionEncode = TRUE; } @@ -1609,7 +1611,7 @@ load_option_panel(void) case PI_CODE: tmp = to_str(p); Strcat_m_charp(src, "<select name=", p->name, ">", NULL); - for (c = *(wc_ces_list **)p->select; c->desc != NULL; c++) { + for (c = *(wc_ces_list **) p->select; c->desc != NULL; c++) { Strcat_charp(src, "<option value="); Strcat(src, Sprintf("%s\n", c->name)); if (c->id == atoi(tmp->ptr)) @@ -1634,7 +1636,7 @@ load_option_panel(void) if (buf) #if LANG == JA buf->document_charset = OptionCharset; -#else /* XXX: ENABLE_NLS is ok for SystemCharset */ +#else /* XXX: ENABLE_NLS is ok for SystemCharset */ buf->document_charset = SystemCharset; #endif #endif @@ -1,4 +1,4 @@ -/* $Id: regex.c,v 1.21 2003/09/22 21:02:21 ukai Exp $ */ +/* $Id: regex.c,v 1.22 2003/09/24 18:49:00 ukai Exp $ */ /* * regex: Regular expression pattern match library * @@ -635,7 +635,7 @@ regmatch1(regexchar * re, longchar * c) if (verbose) printf("RE=%s vs %s -> %d\n", lc2c(re->p.pattern, 1), lc2c(c, 1), ans); -#endif /* REGEX_DEBUG */ +#endif /* REGEX_DEBUG */ return ans; case RE_WHICH: return matchWhich(re->p.pattern, c, re->mode & RE_IGNCASE); @@ -690,7 +690,7 @@ match_longchar(longchar * a, longchar * b, int ignore) if (ignore && IS_ALPHA(b->ch)) return (a->ch == TOLOWER(b->ch) || a->ch == TOUPPER(b->ch)); else - return a->ch == b->ch; + return a->ch == b->ch; } static int @@ -1,4 +1,4 @@ -/* $Id: table.c,v 1.47 2003/09/22 21:02:21 ukai Exp $ */ +/* $Id: table.c,v 1.48 2003/09/24 18:49:00 ukai Exp $ */ /* * HTML table */ @@ -2490,8 +2490,8 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode, /* failsafe: a tag other than <option></option>and </select> in * * <select> environment is regarded as the end of <select>. */ if (mode->pre_mode & TBLM_INSELECT) { - switch (cmd) { - CASE_TABLE_TAG: + switch (cmd) { + CASE_TABLE_TAG: case HTML_N_FORM: case HTML_N_SELECT: /* mode->end_tag */ table_close_select(tbl, mode, width); @@ -2508,7 +2508,7 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode, case HTML_N_CAPTION: mode->caption = 0; if (cmd == HTML_N_CAPTION) - return TAG_ACTION_NONE; + return TAG_ACTION_NONE; break; default: return TAG_ACTION_FEED; @@ -3101,8 +3101,8 @@ feed_table(struct table *tbl, char *line, struct table_mode *mode, case TAG_ACTION_FEED: default: if (parsedtag_need_reconstruct(tag)) - line = parsedtag2str(tag)->ptr; - } + line = parsedtag2str(tag)->ptr; + } } else { if (!(mode->pre_mode & (TBLM_PLAIN | TBLM_INTXTA | TBLM_INSELECT | @@ -3228,12 +3228,12 @@ feed_table(struct table *tbl, char *line, struct table_mode *mode, p = line; line = ""; } - if (mode->pre_mode & TBLM_PLAIN) + if (mode->pre_mode & TBLM_PLAIN) i = maximum_visible_length_plain(p); - else + else i = maximum_visible_length(p); - addcontentssize(tbl, i); - setwidth(tbl, mode); + addcontentssize(tbl, i); + setwidth(tbl, mode); if (nl) clearcontentssize(tbl, mode); pushdata(tbl, tbl->row, tbl->col, p); |