summaryrefslogtreecommitdiff
path: root/usr/src/lib/libcmdutils/libcmdutils.h
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2016-03-28 19:43:25 -0700
committerRobert Mustacchi <rm@joyent.com>2016-05-19 07:45:52 -0700
commitfc2512cfb727d49529d8ed99164db871f4829b73 (patch)
tree89ea56b5a9833e92795bf45c723c6de65b7490f2 /usr/src/lib/libcmdutils/libcmdutils.h
parentea4a67f462de0a39a9adea8197bcdef849de5371 (diff)
downloadillumos-gate-fc2512cfb727d49529d8ed99164db871f4829b73.tar.gz
6951 Initial c11 support
6952 gets should not be visible in C11 6953 add support for c11 threads api 6954 Symbols test should support validating pre-processor symbols Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Reviewed by: Dan McDonald <danmcd@omniti.com> Reviewed by: Garrett D'Amore <garrett@damore.org> Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src/lib/libcmdutils/libcmdutils.h')
-rw-r--r--usr/src/lib/libcmdutils/libcmdutils.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/usr/src/lib/libcmdutils/libcmdutils.h b/usr/src/lib/libcmdutils/libcmdutils.h
index bbc03475dc..7c3d0ebbc1 100644
--- a/usr/src/lib/libcmdutils/libcmdutils.h
+++ b/usr/src/lib/libcmdutils/libcmdutils.h
@@ -26,7 +26,7 @@
* Copyright (c) 2013 RackTop Systems.
*/
/*
- * Copyright 2014 Joyent, Inc.
+ * Copyright 2016 Joyent, Inc.
*/
/*
@@ -44,6 +44,7 @@
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
+#include <stdarg.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
@@ -156,6 +157,12 @@ extern int custr_alloc(custr_t **);
extern void custr_free(custr_t *);
/*
+ * Allocate a "custr_t" dynamic string object that operates on a fixed external
+ * buffer.
+ */
+extern int custr_alloc_buf(custr_t **, void *, size_t);
+
+/*
* Append a single character, or a NUL-terminated string of characters, to a
* dynamic string. Returns 0 on success and -1 otherwise. The dynamic string
* will be unmodified if the function returns -1.
@@ -164,6 +171,14 @@ extern int custr_appendc(custr_t *, char);
extern int custr_append(custr_t *, const char *);
/*
+ * Append a format string and arguments as though the contents were being parsed
+ * through snprintf. Returns 0 on success and -1 otherwise. The dynamic string
+ * will be unmodified if the function returns -1.
+ */
+extern int custr_append_printf(custr_t *, const char *, ...);
+extern int custr_append_vprintf(custr_t *, const char *, va_list);
+
+/*
* Determine the length in bytes, not including the NUL terminator, of the
* dynamic string.
*/