summaryrefslogtreecommitdiff
path: root/checkpasswd/stralloc.h
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2012-06-03 01:38:28 (GMT)
committerJohn Denker <jsd@av8n.com>2012-06-03 01:38:28 (GMT)
commit78488dc84afac1398e582ae6bbaf9606d07afa1e (patch)
tree71723e916f23a6a07422587de275dece3ea60252 /checkpasswd/stralloc.h
parent81b5f8f3ab26a7969956faef29a90499ece40ff5 (diff)
checkpassword ... as downloaded
Diffstat (limited to 'checkpasswd/stralloc.h')
-rw-r--r--checkpasswd/stralloc.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/checkpasswd/stralloc.h b/checkpasswd/stralloc.h
new file mode 100644
index 0000000..7866812
--- /dev/null
+++ b/checkpasswd/stralloc.h
@@ -0,0 +1,29 @@
+#ifndef STRALLOC_H
+#define STRALLOC_H
+
+#include "gen_alloc.h"
+
+GEN_ALLOC_typedef(stralloc,char,s,len,a)
+
+extern int stralloc_ready(stralloc *,unsigned int);
+extern int stralloc_readyplus(stralloc *,unsigned int);
+extern int stralloc_copy(stralloc *,stralloc *);
+extern int stralloc_cat(stralloc *,stralloc *);
+extern int stralloc_copys(stralloc *,char *);
+extern int stralloc_cats(stralloc *,char *);
+extern int stralloc_copyb(stralloc *,char *,unsigned int);
+extern int stralloc_catb(stralloc *,char *,unsigned int);
+extern int stralloc_append(stralloc *,char *); /* beware: this takes a pointer to 1 char */
+extern int stralloc_starts(stralloc *,char *);
+
+#define stralloc_0(sa) stralloc_append(sa,"")
+
+extern int stralloc_catulong0(stralloc *,unsigned long,unsigned int);
+extern int stralloc_catlong0(stralloc *,long,unsigned int);
+
+#define stralloc_catlong(sa,l) (stralloc_catlong0((sa),(l),0))
+#define stralloc_catuint0(sa,i,n) (stralloc_catulong0((sa),(i),(n)))
+#define stralloc_catint0(sa,i,n) (stralloc_catlong0((sa),(i),(n)))
+#define stralloc_catint(sa,i) (stralloc_catlong0((sa),(i),0))
+
+#endif