X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=libcfs%2Finclude%2Flibcfs%2Flibcfs_string.h;h=ab035786bdaa51181d003fe8d19b87caee58c7ce;hb=40e312a8275ed9240e63f0ac023d8b7a38136f42;hp=72a5ef9aa310fac703334a46f52543bfd937a18b;hpb=18bae1e2a77956913dcbe80708f1fc512cb32bdf;p=fs%2Flustre-release.git diff --git a/libcfs/include/libcfs/libcfs_string.h b/libcfs/include/libcfs/libcfs_string.h index 72a5ef9..ab03578 100644 --- a/libcfs/include/libcfs/libcfs_string.h +++ b/libcfs/include/libcfs/libcfs_string.h @@ -26,7 +26,7 @@ * GPL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ /* @@ -45,8 +45,17 @@ /* libcfs_string.c */ /* Convert a text string to a bitmask */ -int libcfs_str2mask(const char *str, const char *(*bit2str)(int bit), - int *oldmask, int minmask, int allmask); +int cfs_str2mask(const char *str, const char *(*bit2str)(int bit), + int *oldmask, int minmask, int allmask); +/* Allocate space for and copy an existing string. + * Must free with cfs_free(). + */ +char *cfs_strdup(const char *str, u_int32_t flags); + +/* safe vsnprintf */ +int cfs_vsnprintf(char *buf, size_t size, const char *fmt, va_list args); +/* safe snprintf */ +int cfs_snprintf(char *buf, size_t size, const char *fmt, ...); #endif