diff --git a/cookie.c b/cookie.c index 705e277..0a6aecf 100644 --- a/cookie.c +++ b/cookie.c @@ -191,7 +191,7 @@ match_cookie(ParsedURL *pu, struct cookie *cookie, char *domainname) return 1; } -struct cookie * +static struct cookie * get_cookie_info(Str domain, Str path, Str name) { struct cookie *p; @@ -254,7 +254,7 @@ find_cookie(ParsedURL *pu) return tmp; } -int +static int check_avoid_wrong_number_of_dots_domain( Str domain ) { TextListItem *tl; @@ -412,7 +412,7 @@ add_cookie(ParsedURL *pu, Str name, Str value, return 0; } -struct cookie * +static struct cookie * nth_cookie(int n) { struct cookie *p; diff --git a/entity.c b/entity.c index 67b8cfb..acb593f 100644 --- a/entity.c +++ b/entity.c @@ -14,6 +14,8 @@ #endif #endif /* DUMMY */ +extern char * conv_entity(unsigned int c); + /* *INDENT-OFF* */ static char *alt_latin1[ 96 ] = { NBSP, "!", "-c-", "-L-", "CUR", "=Y=", "|", "S:", diff --git a/file.c b/file.c index 9704cea..371ca97 100644 --- a/file.c +++ b/file.c @@ -418,7 +418,7 @@ examineFile(char *path, URLFile *uf) #define S_IXANY (S_IXUSR|S_IXGRP|S_IXOTH) -int +static int check_command(char *cmd, int auxbin_p) { static char *path = NULL; @@ -449,7 +449,7 @@ check_command(char *cmd, int auxbin_p) } char * -acceptableEncoding() +acceptableEncoding(void) { static Str encodings = NULL; struct compression_decoder *d; @@ -938,7 +938,7 @@ checkHeader(Buffer *buf, char *field) return NULL; } -char * +static char * checkContentType(Buffer *buf) { char *p; @@ -2750,7 +2750,7 @@ is_blank_line(char *line, int indent) } #endif -void +static void fillline(struct readbuffer *obuf, int indent) { push_spaces(obuf, 1, indent - obuf->pos); @@ -4148,7 +4148,7 @@ feed_textarea(char *str) } } -Str +static Str process_hr(struct parsed_tag *tag, int width, int indent_width) { Str tmp = Strnew_charp(""); @@ -5547,7 +5547,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) static TextLineListItem *_tl_lp2; static Str -textlist_feed() +textlist_feed(void) { TextLine *p; if (_tl_lp2 != NULL) { @@ -6330,7 +6330,7 @@ HTMLlineproc2(Buffer *buf, TextLineList *tl) static InputStream _file_lp2; static Str -file_feed() +file_feed(void) { Str s; s = StrISgets(_file_lp2); @@ -6341,7 +6341,7 @@ file_feed() return s; } -void +static void HTMLlineproc3(Buffer *buf, InputStream stream) { _file_lp2 = stream; diff --git a/frame.c b/frame.c index be1a961..6369cdc 100644 --- a/frame.c +++ b/frame.c @@ -210,7 +210,7 @@ copyFrameSet(struct frameset *of) return rf; } -void +static void flushFrameSet(struct frameset *fs) { int n = fs->i; diff --git a/func.c b/func.c index 8b5deac..c229799 100644 --- a/func.c +++ b/func.c @@ -9,6 +9,7 @@ #include "func.h" #include "myctype.h" #include "regex.h" +#include "rc.h" #include "funcname.c" #include "functable.c" diff --git a/history.c b/history.c index eeb8f5c..514ae9a 100644 --- a/history.c +++ b/history.c @@ -89,7 +89,7 @@ saveHistory(Hist *hist, size_t size) #endif /* USE_HISTORY */ Hist * -newHist() +newHist(void) { Hist *hist; diff --git a/history.h b/history.h index e2b3bf2..a6468ec 100644 --- a/history.h +++ b/history.h @@ -18,7 +18,7 @@ typedef struct { Hash_sv *hash; } Hist; -extern Hist *newHist(); +extern Hist *newHist(void); extern Hist *copyHist(Hist *hist); extern HistItem *unshiftHist(Hist *hist, char *ptr); extern HistItem *pushHist(Hist *hist, char *ptr); diff --git a/image.c b/image.c index 3532040..6570cb4 100644 --- a/image.c +++ b/image.c @@ -31,9 +31,9 @@ static int n_terminal_image = 0; static int max_terminal_image = 0; static FILE *Imgdisplay_rf = NULL, *Imgdisplay_wf = NULL; static pid_t Imgdisplay_pid = 0; -static int openImgdisplay(); -static void closeImgdisplay(); -int getCharSize(); +static int openImgdisplay(void); +static void closeImgdisplay(void); +static int getCharSize(void); void initImage() @@ -46,8 +46,8 @@ initImage() int get_pixel_per_cell(int *ppc, int *ppl); -int -getCharSize() +static int +getCharSize(void) { FILE *f; Str tmp; @@ -134,7 +134,7 @@ openImgdisplay() } static void -closeImgdisplay() +closeImgdisplay(void) { if (Imgdisplay_wf) fclose(Imgdisplay_wf); @@ -195,14 +195,8 @@ syncImage(void) n_terminal_image = 0; } -void put_image_osc5379(char *url, int x, int y, int w, int h, int sx, int sy, int sw, int sh); -void put_image_sixel(char *url, int x, int y, int w, int h, int sx, int sy, int sw, int sh, int n_terminal_image); -void put_image_iterm2(char *url, int x, int y, int w, int h); -void put_image_kitty(char *url, int x, int y, int w, int h, int sx, int sy, int - sw, int sh, int c, int r); - void -drawImage() +drawImage(void) { static char buf[64]; int j, draw = FALSE; @@ -388,7 +382,7 @@ getAllImage(Buffer *buf) } } -void +static void showImageProgress(Buffer *buf) { AnchorList *al; diff --git a/indep.c b/indep.c index 4d13a3f..d9b9ae9 100644 --- a/indep.c +++ b/indep.c @@ -840,32 +840,32 @@ w3m_dir(const char *name, char *dft) } char * -w3m_auxbin_dir() +w3m_auxbin_dir(void) { return w3m_dir("W3M_AUXBIN_DIR", AUXBIN_DIR); } char * -w3m_lib_dir() +w3m_lib_dir(void) { /* FIXME: use W3M_CGIBIN_DIR? */ return w3m_dir("W3M_LIB_DIR", CGIBIN_DIR); } char * -w3m_etc_dir() +w3m_etc_dir(void) { return w3m_dir("W3M_ETC_DIR", ETC_DIR); } char * -w3m_conf_dir() +w3m_conf_dir(void) { return w3m_dir("W3M_CONF_DIR", CONF_DIR); } char * -w3m_help_dir() +w3m_help_dir(void) { return w3m_dir("W3M_HELP_DIR", HELP_DIR); } diff --git a/indep.h b/indep.h index b123c85..d4bef53 100644 --- a/indep.h +++ b/indep.h @@ -86,11 +86,11 @@ extern void growbuf_reserve(struct growbuf *gb, int leastarea); extern void growbuf_append(struct growbuf *gb, const unsigned char *src, int len); #define GROWBUF_ADD_CHAR(gb,ch) ((((gb)->length>=(gb)->area_size)?growbuf_reserve(gb,(gb)->length+1):(void)0),(void)((gb)->ptr[(gb)->length++] = (ch))) -extern char *w3m_auxbin_dir(); -extern char *w3m_lib_dir(); -extern char *w3m_etc_dir(); -extern char *w3m_conf_dir(); -extern char *w3m_help_dir(); +extern char *w3m_auxbin_dir(void); +extern char *w3m_lib_dir(void); +extern char *w3m_etc_dir(void); +extern char *w3m_conf_dir(void); +extern char *w3m_help_dir(void); #define NewWithoutGC(type) ((type*)xmalloc(sizeof(type))) #define NewWithoutGC_N(type,n) ((type*)xmalloc((n)*sizeof(type))) diff --git a/linein.c b/linein.c index b58cad6..9da03ad 100644 --- a/linein.c +++ b/linein.c @@ -845,7 +845,7 @@ next_dcompl(int next) } -Str +static Str escape_spaces(Str s) { Str tmp = NULL; diff --git a/mailcap.c b/mailcap.c index f0c6242..cca13f9 100644 --- a/mailcap.c +++ b/mailcap.c @@ -220,7 +220,7 @@ loadMailcap(char *filename) } void -initMailcap() +initMailcap(void) { TextListItem *tl; int i; @@ -238,7 +238,7 @@ initMailcap() } char * -acceptableMimeTypes() +acceptableMimeTypes(void) { static Str types = NULL; TextList *l; @@ -308,7 +308,7 @@ searchExtViewer(char *type) #define MCF_SQUOTED (1 << 0) #define MCF_DQUOTED (1 << 1) -Str +static Str quote_mailcap(char *s, int flag) { Str d; diff --git a/main.c b/main.c index 45f5a4b..7873a5a 100644 --- a/main.c +++ b/main.c @@ -18,6 +18,7 @@ #include "terms.h" #include "myctype.h" #include "regex.h" +#include "rc.h" #ifdef USE_M17N #include "wc.h" #include "wtf.h" @@ -363,7 +364,7 @@ sig_chld(int signo) } #endif -Str +static Str make_optional_header_string(char *s) { char *p; @@ -1886,7 +1887,7 @@ dispincsrch(int ch, Str buf, Lineprop *prop) return -1; } -void +static void isrch(int (*func) (Buffer *, char *), char *prompt) { char *str; @@ -1902,7 +1903,7 @@ isrch(int (*func) (Buffer *, char *), char *prompt) displayBuffer(Currentbuf, B_FORCE_REDRAW); } -void +static void srch(int (*func) (Buffer *, char *), char *prompt) { char *str; diff --git a/proto.h b/proto.h index be9d64a..3be7d22 100644 --- a/proto.h +++ b/proto.h @@ -164,7 +164,7 @@ extern int currentLn(Buffer *buf); extern void tmpClearBuffer(Buffer *buf); extern char *filename_extension(char *patch, int is_url); #ifdef USE_EXTERNAL_URI_LOADER -extern void initURIMethods(); +extern void initURIMethods(void); extern Str searchURIMethods(ParsedURL *pu); extern void chkExternalURIBuffer(Buffer *buf); #endif @@ -188,7 +188,7 @@ extern char *url_decode0(const char *url); #define url_decode2(url, buf) url_decode0(url) #endif /* !defined(USE_M17N) */ extern void examineFile(char *path, URLFile *uf); -extern char *acceptableEncoding(); +extern char *acceptableEncoding(void); extern int dir_exist(char *path); extern int is_html_type(char *type); #ifdef USE_M17N @@ -533,10 +533,10 @@ extern char getch(void); extern void bell(void); extern int sleep_till_anykey(int sec, int purge); #ifdef USE_IMAGE -extern void touch_cursor(); +extern void touch_cursor(void); #endif -extern void initMimeTypes(); -extern void free_ssl_ctx(); +extern void initMimeTypes(void); +extern void free_ssl_ctx(void); extern ParsedURL *baseURL(Buffer *buf); extern int openSocket(char *hostname, char *remoteport_name, unsigned short remoteport_num); @@ -555,8 +555,8 @@ extern URLFile openURL(char *url, ParsedURL *pu, ParsedURL *current, HRequest *hr, unsigned char *status); extern int mailcapMatch(struct mailcap *mcap, char *type); extern struct mailcap *searchMailcap(struct mailcap *table, char *type); -extern void initMailcap(); -extern char *acceptableMimeTypes(); +extern void initMailcap(void); +extern char *acceptableMimeTypes(void); extern struct mailcap *searchExtViewer(char *type); extern Str unquote_mailcap(char *qstr, char *type, char *name, char *attr, int *mc_stat); diff --git a/rc.c b/rc.c index 5511e25..d335564 100644 --- a/rc.c +++ b/rc.c @@ -12,6 +12,7 @@ #include "regex.h" #include #include +#include "rc.h" struct param_ptr { char *name; @@ -852,7 +853,7 @@ create_option_search_table() } } -struct param_ptr * +static struct param_ptr * search_param(char *name) { size_t b, e, i; @@ -1182,8 +1183,8 @@ interpret_rc(FILE * f) } } -void -parse_proxy() +static void +parse_proxy(void) { if (non_null(HTTP_proxy)) parseURL(HTTP_proxy, &HTTP_proxy_parsed, NULL); @@ -1202,8 +1203,8 @@ parse_proxy() } #ifdef USE_COOKIE -void -parse_cookie() +static void +parse_cookie(void) { if (non_null(cookie_reject_domains)) Cookie_reject_domains = make_domain_list(cookie_reject_domains); diff --git a/rc.h b/rc.h new file mode 100644 index 0000000..edb1821 --- /dev/null +++ b/rc.h @@ -0,0 +1,7 @@ +#ifndef RC_H +#define RC_H + +extern void show_params(FILE * fp); +extern int str_to_bool(char *value, int old); + +#endif /* RC_H */ diff --git a/table.c b/table.c index 9d99bb3..043df86 100644 --- a/table.c +++ b/table.c @@ -404,7 +404,7 @@ pushdata(struct table *t, int row, int col, char *data) pushText(t->tabdata[row][col], data ? data : ""); } -void +static void suspend_or_pushdata(struct table *tbl, char *line) { if (tbl->flag & TBL_IN_COL) @@ -509,7 +509,7 @@ visible_length(char *str) return len > max_len ? len : max_len; } -int +static int visible_length_plain(char *str) { int len = 0, max_len = 0; @@ -922,7 +922,7 @@ check_cell_width(short *tabwidth, short *cellwidth, } } -void +static void check_minimum_width(struct table *t, short *tabwidth) { int i; @@ -937,7 +937,7 @@ check_minimum_width(struct table *t, short *tabwidth) cell->maxcell, cell->index, t->cellspacing, 0); } -void +static void check_maximum_width(struct table *t) { struct table_cell *cell = &t->cell; @@ -1255,7 +1255,7 @@ check_compressible_cell(struct table *t, MAT * minv, } #define MAX_ITERATION 10 -int +static int check_table_width(struct table *t, double *newwidth, MAT * minv, int itr) { int i, j, k, m, bcol, ecol; @@ -1513,7 +1513,7 @@ set_table_width(struct table *t, short *newwidth, int maxwidth) } #endif /* not MATRIX */ -void +static void check_table_height(struct table *t) { int i, j, k; @@ -1612,7 +1612,7 @@ check_table_height(struct table *t) #define CHECK_MINIMUM 1 #define CHECK_FIXED 2 -int +static int get_table_width(struct table *t, short *orgwidth, short *cellwidth, int flag) { #ifdef __GNUC__ @@ -1677,7 +1677,7 @@ initRenderTable(void) cotable_level = 0; } -void +static void renderCoTable(struct table *tbl, int maxlimit) { struct readbuffer obuf; @@ -2289,7 +2289,7 @@ check_rowcol(struct table *tbl, struct table_mode *mode) tbl->flag |= TBL_IN_COL; } -int +static int skip_space(struct table *t, char *line, struct table_linfo *linfo, int checkminimum) { @@ -3585,7 +3585,7 @@ set_table_matrix0(struct table *t, int maxwidth) } } -void +static void check_relative_width(struct table *t, int maxwidth) { int i; diff --git a/terms.c b/terms.c index e272aab..ad6df34 100644 --- a/terms.c +++ b/terms.c @@ -41,7 +41,7 @@ static int xpix, ypix, nbs, obs = 0; static int is_xterm = 0; -void mouse_init(), mouse_end(); +void mouse_init(void), mouse_end(void); int mouseActive = 0; #endif /* USE_MOUSE */ @@ -263,7 +263,7 @@ check_cygwin_console(void) char *getenv(const char *); MySignalHandler reset_exit(SIGNAL_ARG), reset_error_exit(SIGNAL_ARG), error_dump(SIGNAL_ARG); void setlinescols(void); -void flush_tty(); +void flush_tty(void); #ifndef SIGIOT #define SIGIOT SIGABRT @@ -452,7 +452,7 @@ extern int tgetflag(char *); extern char *tgetstr(char *, char **); extern char *tgoto(char *, int, int); extern int tputs(char *, int, int (*)(char)); -void clear(), wrap(), touch_line(), touch_column(int); +void clear(void), wrap(void), touch_line(void), touch_column(int); #if 0 void need_clrtoeol(void); #endif @@ -2059,7 +2059,7 @@ clrtoeol(void) } #ifdef USE_BG_COLOR -void +static void clrtoeol_with_bcolor(void) { int i, cli, cco; @@ -2093,7 +2093,7 @@ clrtoeolx(void) } #endif /* not USE_BG_COLOR */ -void +static void clrtobot_eol(void (*clrtoeol) ()) { int l, c; @@ -2422,7 +2422,7 @@ bell(void) write1(7); } -void +static void skip_escseq(void) { int c; @@ -2654,7 +2654,7 @@ mouse_inactive() #endif /* USE_MOUSE */ void -flush_tty() +flush_tty(void) { if (ttyf) fflush(ttyf); @@ -2662,7 +2662,7 @@ flush_tty() #ifdef USE_IMAGE void -touch_cursor() +touch_cursor(void) { #ifdef USE_M17N int i; diff --git a/terms.h b/terms.h index 55c7a60..8c6992e 100644 --- a/terms.h +++ b/terms.h @@ -30,4 +30,12 @@ extern void disable_win9x_console_input(void); #endif #endif +#ifdef USE_IMAGE +extern void put_image_osc5379(char *url, int x, int y, int w, int h, int sx, int sy, int sw, int sh); +extern void put_image_sixel(char *url, int x, int y, int w, int h, int sx, int sy, int sw, int sh, int n_terminal_image); +extern void put_image_iterm2(char *url, int x, int y, int w, int h); +extern void put_image_kitty(char *url, int x, int y, int w, int h, int sx, int sy, int sw, int sh, int c, int r); +extern int get_pixel_per_cell(int *ppc, int *ppl); +#endif + #endif /* not TERMS_H */ diff --git a/url.c b/url.c index 07f3ea0..b4c9ce4 100644 --- a/url.c +++ b/url.c @@ -202,7 +202,7 @@ loadMimeTypes(char *filename) } void -initMimeTypes() +initMimeTypes(void) { int i; TextListItem *tl; @@ -251,7 +251,7 @@ KeyAbort(SIGNAL_ARG) SSL_CTX *ssl_ctx = NULL; void -free_ssl_ctx() +free_ssl_ctx(void) { if (ssl_ctx != NULL) SSL_CTX_free(ssl_ctx); @@ -262,7 +262,7 @@ free_ssl_ctx() #if SSLEAY_VERSION_NUMBER >= 0x00905100 #include static void -init_PRNG() +init_PRNG(void) { char buffer[256]; const char *file; @@ -2305,7 +2305,7 @@ loadURIMethods(char *filename) } void -initURIMethods() +initURIMethods(void) { TextList *methodmap_list = NULL; TextListItem *tl; diff --git a/w3mbookmark.c b/w3mbookmark.c index 2e64327..bf3dade 100644 --- a/w3mbookmark.c +++ b/w3mbookmark.c @@ -51,7 +51,7 @@ static char end_section[] = static char *Local_cookie = NULL; -void +static void print_bookmark_panel(char *bmark, char *url, char *title, char *charset) { Str tmp, tmp2; @@ -107,7 +107,7 @@ create_new_bookmark(char *bmark, char *section, char *title, char *url, return TRUE; } -int +static int insert_bookmark(char *bmark, struct parsed_tagarg *data) { char *url, *title, *section; diff --git a/w3mhelperpanel.c b/w3mhelperpanel.c index 7d13032..a519954 100644 --- a/w3mhelperpanel.c +++ b/w3mhelperpanel.c @@ -29,9 +29,9 @@ #define MSG_DOIT "Do it" #endif /* LANG != JA */ -char *local_cookie; +static char *local_cookie; -void +static void extractMailcapEntry(char *mcap_entry, char **type, char **cmd) { int j; @@ -56,7 +56,7 @@ bye(const char *action, const char *mailcap) exit(1); } -void +static void printMailcapPanel(char *mailcap) { FILE *f; @@ -118,7 +118,7 @@ printMailcapPanel(char *mailcap) fclose(f); } -void +static void editMailcap(char *mailcap, struct parsed_tagarg *args) { TextList *t = newTextList();