w3m

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/w3m.git/
Log | Files | Refs | README

commit 45b7a2d2fb798aed15528c8931af859221cf5685
parent 3a412a068303f07b844e705d2f58570a25583500
Author: ukai <ukai>
Date:   Mon, 20 Jan 2003 15:30:18 +0000

[w3m-dev 03660] Re: fputs -> Strfputs
* Str.h (Strncmp_charp): paren
	(Strncasecmp_charp): ditto
	(Strinsert): ditto
	(Strshrinkfirst): ditto
* display.c (disp_err_message): added
* file.c (loadGeneralFile): don't put function in macro arg
	(saveBuffer): ditto
* frame.c (createFrameFile): ditto
* proto.h (disp_err_message): macro->function
* table.c (pushdata): if data is NULL, use ""
	(suspend_or_pushdata): if line is NULL, use ""
* textlist.h (pushText): don't use (s) twice in a macro
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>

Diffstat:
MChangeLog | 16++++++++++++++++
MStr.h | 8++++----
Mdisplay.c | 6++++++
Mfile.c | 6++++--
Mframe.c | 5++---
Mproto.h | 2+-
Mtable.c | 4++--
Mtextlist.h | 2+-
8 files changed, 36 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,5 +1,21 @@ 2003-01-21 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + * [w3m-dev 03660] Re: fputs -> Strfputs + * Str.h (Strncmp_charp): paren + (Strncasecmp_charp): ditto + (Strinsert): ditto + (Strshrinkfirst): ditto + * display.c (disp_err_message): added + * file.c (loadGeneralFile): don't put function in macro arg + (saveBuffer): ditto + * frame.c (createFrameFile): ditto + * proto.h (disp_err_message): macro->function + * table.c (pushdata): if data is NULL, use "" + (suspend_or_pushdata): if line is NULL, use "" + * textlist.h (pushText): don't use (s) twice in a macro + +2003-01-21 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + * [w3m-dev 03659] Can't download from SSL. * istream.c (ISfileno): case IST_SSL diff --git a/Str.h b/Str.h @@ -70,14 +70,14 @@ void Strgrow(Str s); #define Strcmp(x,y) strcmp((x)->ptr,(y)->ptr) #define Strcmp_charp(x,y) strcmp((x)->ptr,(y)) #define Strncmp(x,y,n) strncmp((x)->ptr,(y)->ptr,(n)) -#define Strncmp_charp(x,y,n) strncmp((x)->ptr,y,(n)) +#define Strncmp_charp(x,y,n) strncmp((x)->ptr,(y),(n)) #define Strcasecmp(x,y) strcasecmp((x)->ptr,(y)->ptr) #define Strcasecmp_charp(x,y) strcasecmp((x)->ptr,(y)) #define Strncasecmp(x,y,n) strncasecmp((x)->ptr,(y)->ptr,(n)) -#define Strncasecmp_charp(x,y,n) strncasecmp((x)->ptr,y,(n)) +#define Strncasecmp_charp(x,y,n) strncasecmp((x)->ptr,(y),(n)) #define Strlastchar(s) ((s)->length>0?(s)->ptr[(s)->length-1]:'\0') -#define Strinsert(s,n,p) Strinsert_charp(s,n,(p)->ptr) -#define Strshrinkfirst(s,n) Strdelete(s,0,n) +#define Strinsert(s,n,p) Strinsert_charp((s),(n),(p)->ptr) +#define Strshrinkfirst(s,n) Strdelete((s),0,(n)) #define Strfputs(s,f) fwrite((s)->ptr,1,(s)->length,(f)) #endif /* not GC_STR_H */ diff --git a/display.c b/display.c @@ -1178,6 +1178,12 @@ message(char *s, int return_x, int return_y) move(return_y, return_x); } +void disp_err_message(char *s, int redraw_current) +{ + record_err_message(s); + disp_message(s, redraw_current); +} + void disp_message_nsec(char *s, int redraw_current, int sec, int purge, int mouse) { diff --git a/file.c b/file.c @@ -1910,7 +1910,8 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer, tmp = tmpfname(TMPF_SRC, ".html"); src = fopen(tmp->ptr, "w"); if (src) { - Strfputs(conv_str(page, InnerCode, code), src); + Str s = conv_str(page, InnerCode, code); + Strfputs(s, src); fclose(src); } if (do_download) { @@ -6940,7 +6941,8 @@ saveBuffer(Buffer *buf, FILE * f) else #endif tmp = Strnew_charp_n(l->lineBuf, l->len); - Strfputs(conv_str(tmp, InnerCode, DisplayCode), f); + tmp = conv_str(tmp, InnerCode, DisplayCode); + Strfputs(tmp, f); if (Strlastchar(tmp) != '\n') putc('\n', f); } diff --git a/frame.c b/frame.c @@ -805,9 +805,8 @@ createFrameFile(struct frameset *f, FILE * f1, Buffer *current, int level, parsedtag_set_value(tag, ATTR_TARGET, d_target); } if (parsedtag_need_reconstruct(tag)) - Strfputs(parsedtag2str(tag), f1); - else - Strfputs(tok, f1); + tok = parsedtag2str(tag); + Strfputs(tok, f1); } else { if (pre_mode & (RB_PLAIN | RB_INTXTA)) diff --git a/proto.h b/proto.h @@ -276,7 +276,7 @@ extern void addChar(char c, Lineprop mode); extern void record_err_message(char *s); extern Buffer *message_list_panel(void); extern void message(char *s, int return_x, int return_y); -#define disp_err_message(s, f) (record_err_message((s)), disp_message((s), (f))) +extern void disp_err_message(char *s, int redraw_current); extern void disp_message_nsec(char *s, int redraw_current, int sec, int purge, int mouse); extern void disp_message(char *s, int redraw_current); diff --git a/table.c b/table.c @@ -449,7 +449,7 @@ pushdata(struct table *t, int row, int col, char *data) if (t->tabdata[row][col] == NULL) t->tabdata[row][col] = newGeneralList(); - pushText(t->tabdata[row][col], data); + pushText(t->tabdata[row][col], data ? data : ""); } void @@ -460,7 +460,7 @@ suspend_or_pushdata(struct table *tbl, char *line) else { if (!tbl->suspended_data) tbl->suspended_data = newTextList(); - pushText(tbl->suspended_data, line); + pushText(tbl->suspended_data, line ? line : ""); } } diff --git a/textlist.h b/textlist.h @@ -40,7 +40,7 @@ typedef struct _textlist { } TextList; #define newTextList() ((TextList *)newGeneralList()) -#define pushText(tl, s) pushValue((GeneralList *)(tl), (void *)allocStr((s)?(s):"",-1)) +#define pushText(tl, s) pushValue((GeneralList *)(tl), (void *)allocStr((s),-1)) #define popText(tl) ((char *)popValue((GeneralList *)(tl))) #define rpopText(tl) ((char *)rpopValue((GeneralList *)(tl))) #define delText(tl, i) delValue((GeneralList *)(tl), (void *)(i))