X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;ds=sidebyside;f=libcfs%2Finclude%2Flibcfs%2Flibcfs_string.h;h=553347a1186829ee11f459580ab1993b13f7c79c;hb=7de9e8dd313557997fb28f3926516b5c26d31c9a;hp=b81ce36c0fc62e1a3e788b5a7928383c31d1e04a;hpb=c06ffb6998e5512d6589ef3ec4cc748371a07c77;p=fs%2Flustre-release.git diff --git a/libcfs/include/libcfs/libcfs_string.h b/libcfs/include/libcfs/libcfs_string.h index b81ce36..553347a 100644 --- a/libcfs/include/libcfs/libcfs_string.h +++ b/libcfs/include/libcfs/libcfs_string.h @@ -26,8 +26,10 @@ * 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. + * + * Copyright (c) 2012, Whamcloud, Inc. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -45,11 +47,20 @@ /* 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 *libcfs_strdup(const char *str, u_int32_t flags); +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, ...); + +/* trim leading and trailing space characters */ +char *cfs_firststr(char *str, size_t size); #endif