]>
Commit | Line | Data |
---|---|---|
959ef981 | 1 | // SPDX-License-Identifier: GPL-2.0+ |
d11cc69e DW |
2 | /* |
3 | * Copyright (C) 2018 Oracle. All Rights Reserved. | |
d11cc69e | 4 | * Author: Darrick J. Wong <darrick.wong@oracle.com> |
d11cc69e | 5 | */ |
14051909 DW |
6 | #ifndef __LIBFROG_PTVAR_H__ |
7 | #define __LIBFROG_PTVAR_H__ | |
d11cc69e DW |
8 | |
9 | struct ptvar; | |
10 | ||
cb321a39 | 11 | int ptvar_alloc(size_t nr, size_t size, struct ptvar **pptv); |
d11cc69e | 12 | void ptvar_free(struct ptvar *ptv); |
cb321a39 | 13 | void *ptvar_get(struct ptvar *ptv, int *ret); |
aeff0641 DW |
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); | |
cb321a39 | 20 | int ptvar_foreach(struct ptvar *ptv, ptvar_iter_fn fn, void *foreach_arg); |
d11cc69e | 21 | |
14051909 | 22 | #endif /* __LIBFROG_PTVAR_H__ */ |