diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-09-20 13:19:13 +0200 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-09-20 13:19:13 +0200 |
commit | 3253105d495cefd8cbcf6bfea3044e8eb38b68ee (patch) | |
tree | f37b5a1c061d7295c74bd49b9840d0c1c66105a5 /sds.h | |
parent | e621f31306d0fd7592a98dad44f3d6f0eaeb84db (diff) |
Update sds code
Diffstat (limited to 'sds.h')
-rw-r--r-- | sds.h | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -32,12 +32,13 @@ #define __SDS_H #include <sys/types.h> +#include <stdarg.h> typedef char *sds; struct sdshdr { - long len; - long free; + int len; + int free; char buf[]; }; @@ -53,6 +54,7 @@ sds sdscat(sds s, const char *t); sds sdscpylen(sds s, char *t, size_t len); sds sdscpy(sds s, char *t); +sds sdscatvprintf(sds s, const char *fmt, va_list ap); #ifdef __GNUC__ sds sdscatprintf(sds s, const char *fmt, ...) __attribute__((format(printf, 2, 3))); @@ -61,7 +63,7 @@ sds sdscatprintf(sds s, const char *fmt, ...); #endif sds sdstrim(sds s, const char *cset); -sds sdsrange(sds s, long start, long end); +sds sdsrange(sds s, int start, int end); void sdsupdatelen(sds s); int sdscmp(sds s1, sds s2); sds *sdssplitlen(char *s, int len, char *sep, int seplen, int *count); @@ -69,5 +71,7 @@ void sdsfreesplitres(sds *tokens, int count); void sdstolower(sds s); void sdstoupper(sds s); sds sdsfromlonglong(long long value); +sds sdscatrepr(sds s, char *p, size_t len); +sds *sdssplitargs(char *line, int *argc); #endif |