Whamcloud - gitweb
LU-5030 libcfs: create cfs_get_paths() function
[fs/lustre-release.git] / libcfs / include / libcfs / util / param.h
1 /*
2  * LGPL HEADER START
3  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as
8  * published by the Free Software Foundation; either version 2.1 of the
9  * License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * LGPL HEADER END
20  *
21  * Copyright (c) 2015, James Simmons
22  *
23  * Author:
24  *   James Simmons <jsimmons@infradead.org>
25  */
26 #ifndef _LIBCFS_UTIL_PARAM_H_
27 #define _LIBCFS_UTIL_PARAM_H_
28
29 #include <glob.h>
30 #include <stdbool.h>
31
32 static inline void cfs_free_param_data(glob_t *paths)
33 {
34         globfree(paths);
35 }
36
37 int cfs_get_param_paths(glob_t *paths, const char *pattern, ...)
38                        __attribute__((__format__(__printf__, 2, 3)));
39
40 #endif /* _LIBCFS_UTIL_PARAM_H_ */