aboutsummaryrefslogtreecommitdiffstats
path: root/Str.h
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2021-04-05 13:36:45 +0000
committerTatsuya Kinoshita <tats@debian.org>2021-04-05 13:36:45 +0000
commitfbaa526b8b5acbed3f76e7ed9fdc32356af91d46 (patch)
treec280bf70d0e78a99cd9f5c8cdf2348b21a97e4cf /Str.h
parentMerge pull request #177 from bptato/inlineimages (diff)
downloadw3m-fbaa526b8b5acbed3f76e7ed9fdc32356af91d46.tar.gz
w3m-fbaa526b8b5acbed3f76e7ed9fdc32356af91d46.zip
New macro Strcatc and Strnulterm
Diffstat (limited to 'Str.h')
-rw-r--r--Str.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Str.h b/Str.h
index 64e3dbc..d8968ef 100644
--- a/Str.h
+++ b/Str.h
@@ -69,6 +69,8 @@ void Strgrow(Str s);
#define STR_SIZE_MAX (INT_MAX / 32)
#define Strcat_char(x,y) (((x)->length+1>=STR_SIZE_MAX)?0:(((x)->length+1>=(x)->area_size)?Strgrow(x),0:0,(x)->ptr[(x)->length++]=(y),(x)->ptr[(x)->length]=0))
+#define Strcatc(x,y) ((x)->ptr[(x)->length++]=(y))
+#define Strnulterm(x) ((x)->ptr[(x)->length]=0)
#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))