]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - libfrog/ptvar.h
mkfs: use cvtnum from libfrog
[thirdparty/xfsprogs-dev.git] / libfrog / ptvar.h
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3 * Copyright (C) 2018 Oracle. All Rights Reserved.
4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
5 */
6 #ifndef __LIBFROG_PTVAR_H__
7 #define __LIBFROG_PTVAR_H__
8
9 struct ptvar;
10
11 int ptvar_alloc(size_t nr, size_t size, struct ptvar **pptv);
12 void ptvar_free(struct ptvar *ptv);
13 void *ptvar_get(struct ptvar *ptv, int *ret);
14
15 /*
16 * Visit each per-thread value. Return 0 to continue iteration or nonzero to
17 * stop iterating and return to the caller.
18 */
19 typedef int (*ptvar_iter_fn)(struct ptvar *ptv, void *data, void *foreach_arg);
20 int ptvar_foreach(struct ptvar *ptv, ptvar_iter_fn fn, void *foreach_arg);
21
22 #endif /* __LIBFROG_PTVAR_H__ */