diff options
author | Richard Quirk <richard@quirk.es> | 2015-07-25 13:14:15 +0000 |
---|---|---|
committer | Richard Quirk <richard@quirk.es> | 2015-07-25 13:21:33 +0000 |
commit | 91405c0d06e25e160627d915b6e9747540585f09 (patch) | |
tree | bbc2fad29da4e0c333a78e17ee643194878aaf9e | |
parent | Close temp file if pipe open fails (diff) | |
download | w3m-91405c0d06e25e160627d915b6e9747540585f09.tar.gz w3m-91405c0d06e25e160627d915b6e9747540585f09.zip |
Strnew_charp and co do not modify the char* input
-rw-r--r-- | Str.c | 16 | ||||
-rw-r--r-- | Str.h | 16 |
2 files changed, 16 insertions, 16 deletions
@@ -56,7 +56,7 @@ Strnew_size(int n) } Str -Strnew_charp(char *p) +Strnew_charp(const char *p) { Str x; int n; @@ -73,7 +73,7 @@ Strnew_charp(char *p) } Str -Strnew_m_charp(char *p, ...) +Strnew_m_charp(const char *p, ...) { va_list ap; Str r = Strnew(); @@ -87,7 +87,7 @@ Strnew_m_charp(char *p, ...) } Str -Strnew_charp_n(char *p, int n) +Strnew_charp_n(const char *p, int n) { Str x; @@ -140,7 +140,7 @@ Strcopy(Str x, Str y) } void -Strcopy_charp(Str x, char *y) +Strcopy_charp(Str x, const char *y) { int len; @@ -160,7 +160,7 @@ Strcopy_charp(Str x, char *y) } void -Strcopy_charp_n(Str x, char *y, int n) +Strcopy_charp_n(Str x, const char *y, int n) { int len = n; @@ -180,7 +180,7 @@ Strcopy_charp_n(Str x, char *y, int n) } void -Strcat_charp_n(Str x, char *y, int n) +Strcat_charp_n(Str x, const char *y, int n) { int newlen; @@ -209,7 +209,7 @@ Strcat(Str x, Str y) } void -Strcat_charp(Str x, char *y) +Strcat_charp(Str x, const char *y) { if (y == NULL) return; @@ -301,7 +301,7 @@ Strinsert_char(Str s, int pos, char c) } void -Strinsert_charp(Str s, int pos, char *p) +Strinsert_charp(Str s, int pos, const char *p) { STR_LENGTH_CHECK(s); while (*p) @@ -30,22 +30,22 @@ typedef struct _Str { Str Strnew(void); Str Strnew_size(int); -Str Strnew_charp(char *); -Str Strnew_charp_n(char *, int); -Str Strnew_m_charp(char *, ...); +Str Strnew_charp(const char *); +Str Strnew_charp_n(const char *, int); +Str Strnew_m_charp(const char *, ...); Str Strdup(Str); void Strclear(Str); void Strfree(Str); void Strcopy(Str, Str); -void Strcopy_charp(Str, char *); -void Strcopy_charp_n(Str, char *, int); -void Strcat_charp_n(Str, char *, int); +void Strcopy_charp(Str, const char *); +void Strcopy_charp_n(Str, const char *, int); +void Strcat_charp_n(Str, const char *, int); void Strcat(Str, Str); -void Strcat_charp(Str, char *); +void Strcat_charp(Str, const char *); void Strcat_m_charp(Str, ...); Str Strsubstr(Str, int, int); void Strinsert_char(Str, int, char); -void Strinsert_charp(Str, int, char *); +void Strinsert_charp(Str, int, const char *); void Strdelete(Str, int, int); void Strtruncate(Str, int); void Strlower(Str); |