From 3253105d495cefd8cbcf6bfea3044e8eb38b68ee Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Mon, 20 Sep 2010 13:19:13 +0200 Subject: Update sds code --- sds.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sds.h') diff --git a/sds.h b/sds.h index 76d69a8..2c3fb52 100644 --- a/sds.h +++ b/sds.h @@ -32,12 +32,13 @@ #define __SDS_H #include +#include 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 -- cgit v1.2.3