diff options
author | Jason King <jason.king@joyent.com> | 2018-02-16 16:21:53 +0000 |
---|---|---|
committer | Dan McDonald <danmcd@joyent.com> | 2018-08-28 10:23:33 -0400 |
commit | 500cf85b0395b6835818b6248681bbbc27563dc1 (patch) | |
tree | 2ea59ada8aeeeb746404c53003cfad37d9331077 /usr/src/lib/libcmdutils/libcmdutils.h | |
parent | f8e0ecf7cceff807dcd13fe031936e1ff28193e3 (diff) | |
download | illumos-gate-500cf85b0395b6835818b6248681bbbc27563dc1.tar.gz |
9762 Split the custr functions into their own library
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Yuri Pankov <yuripv@yuripv.net>
Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/lib/libcmdutils/libcmdutils.h')
-rw-r--r-- | usr/src/lib/libcmdutils/libcmdutils.h | 56 |
1 files changed, 1 insertions, 55 deletions
diff --git a/usr/src/lib/libcmdutils/libcmdutils.h b/usr/src/lib/libcmdutils/libcmdutils.h index 5f9957b861..c9a61aab4d 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 2017 Joyent, Inc. + * Copyright 2018 Joyent, Inc. */ /* @@ -162,60 +162,6 @@ extern int findnextuid(uid_t, uid_t, uid_t *); */ extern int findnextgid(gid_t, gid_t, gid_t *); - - - /* dynamic string utilities */ - -typedef struct custr custr_t; - -/* - * Allocate and free a "custr_t" dynamic string object. Returns 0 on success - * and -1 otherwise. - */ -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. - */ -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. - */ -extern size_t custr_len(custr_t *); - -/* - * Clear the contents of a dynamic string. Does not free the underlying - * memory. - */ -extern void custr_reset(custr_t *); - -/* - * Retrieve a const pointer to a NUL-terminated string version of the contents - * of the dynamic string. Storage for this string should not be freed, and - * the pointer will be invalidated by any mutations to the dynamic string. - */ -extern const char *custr_cstr(custr_t *str); - #define NN_DIVISOR_1000 (1U << 0) /* Minimum size for the output of nicenum, including NULL */ |