xref: /freebsd/sys/contrib/openzfs/cmd/zfs/zfs_iter.h (revision 22649d4dba730d46244fd2dff4fd174903c8379f)
1 // SPDX-License-Identifier: CDDL-1.0
2 /*
3  * This file and its contents are supplied under the terms of the
4  * Common Development and Distribution License ("CDDL"), version 1.0.
5  * You may only use this file in accordance with the terms of version
6  * 1.0 of the CDDL.
7  *
8  * A full copy of the text of the CDDL should have accompanied this
9  * source.  A copy of the CDDL is also available via the Internet at
10  * https://opensource.org/license/CDDL-1.0.
11  */
12 
13 /*
14  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
15  * Use is subject to license terms.
16  * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
17  */
18 
19 #ifndef	ZFS_ITER_H
20 #define	ZFS_ITER_H
21 
22 #ifdef	__cplusplus
23 extern "C" {
24 #endif
25 
26 typedef struct zfs_sort_column {
27 	struct zfs_sort_column	*sc_next;
28 	struct zfs_sort_column	*sc_last;
29 	zfs_prop_t		sc_prop;
30 	char			*sc_user_prop;
31 	boolean_t		sc_reverse;
32 } zfs_sort_column_t;
33 
34 int zfs_for_each(int, char **, int options, zfs_type_t,
35     zfs_sort_column_t *, zprop_list_t **, int, zfs_iter_f, void *);
36 int zfs_add_sort_column(zfs_sort_column_t **, const char *, boolean_t);
37 void zfs_free_sort_columns(zfs_sort_column_t *);
38 boolean_t zfs_sort_only_by_fast(const zfs_sort_column_t *);
39 boolean_t zfs_list_only_by_fast(const zprop_list_t *);
40 
41 #ifdef	__cplusplus
42 }
43 #endif
44 
45 #endif	/* ZFS_ITER_H */
46