xref: /onnv-gate/usr/src/cmd/zfs/zfs_iter.h (revision 11022:63ab26072e41)
1789Sahrens /*
2789Sahrens  * CDDL HEADER START
3789Sahrens  *
4789Sahrens  * The contents of this file are subject to the terms of the
52082Seschrock  * Common Development and Distribution License (the "License").
62082Seschrock  * You may not use this file except in compliance with the License.
7789Sahrens  *
8789Sahrens  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9789Sahrens  * or http://www.opensolaris.org/os/licensing.
10789Sahrens  * See the License for the specific language governing permissions
11789Sahrens  * and limitations under the License.
12789Sahrens  *
13789Sahrens  * When distributing Covered Code, include this CDDL HEADER in each
14789Sahrens  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15789Sahrens  * If applicable, add the following below this CDDL HEADER, with the
16789Sahrens  * fields enclosed by brackets "[]" replaced with your own identifying
17789Sahrens  * information: Portions Copyright [yyyy] [name of copyright owner]
18789Sahrens  *
19789Sahrens  * CDDL HEADER END
20789Sahrens  */
21789Sahrens /*
229365SChris.Gerhard@sun.com  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23789Sahrens  * Use is subject to license terms.
24789Sahrens  */
25789Sahrens 
26789Sahrens #ifndef	ZFS_ITER_H
27789Sahrens #define	ZFS_ITER_H
28789Sahrens 
29789Sahrens #ifdef	__cplusplus
30789Sahrens extern "C" {
31789Sahrens #endif
32789Sahrens 
332379Ssjelinek typedef struct zfs_sort_column {
342379Ssjelinek 	struct zfs_sort_column	*sc_next;
352379Ssjelinek 	struct zfs_sort_column	*sc_last;
362379Ssjelinek 	zfs_prop_t		sc_prop;
372676Seschrock 	char			*sc_user_prop;
382379Ssjelinek 	boolean_t		sc_reverse;
392379Ssjelinek } zfs_sort_column_t;
402379Ssjelinek 
417538SRichard.Morris@Sun.COM #define	ZFS_ITER_RECURSE	   (1 << 0)
427538SRichard.Morris@Sun.COM #define	ZFS_ITER_ARGS_CAN_BE_PATHS (1 << 1)
437538SRichard.Morris@Sun.COM #define	ZFS_ITER_PROP_LISTSNAPS    (1 << 2)
449365SChris.Gerhard@sun.com #define	ZFS_ITER_DEPTH_LIMIT	   (1 << 3)
45*11022STom.Erickson@Sun.COM #define	ZFS_ITER_RECVD_PROPS	   (1 << 4)
467538SRichard.Morris@Sun.COM 
477538SRichard.Morris@Sun.COM int zfs_for_each(int, char **, int options, zfs_type_t,
489365SChris.Gerhard@sun.com     zfs_sort_column_t *, zprop_list_t **, int, zfs_iter_f, void *);
492676Seschrock int zfs_add_sort_column(zfs_sort_column_t **, const char *, boolean_t);
502379Ssjelinek void zfs_free_sort_columns(zfs_sort_column_t *);
51789Sahrens 
52789Sahrens #ifdef	__cplusplus
53789Sahrens }
54789Sahrens #endif
55789Sahrens 
56789Sahrens #endif	/* ZFS_ITER_H */
57