zfs_iter.h revision 219089
1168404Spjd/*
2168404Spjd * CDDL HEADER START
3168404Spjd *
4168404Spjd * The contents of this file are subject to the terms of the
5168404Spjd * Common Development and Distribution License (the "License").
6168404Spjd * You may not use this file except in compliance with the License.
7168404Spjd *
8168404Spjd * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9168404Spjd * or http://www.opensolaris.org/os/licensing.
10168404Spjd * See the License for the specific language governing permissions
11168404Spjd * and limitations under the License.
12168404Spjd *
13168404Spjd * When distributing Covered Code, include this CDDL HEADER in each
14168404Spjd * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15168404Spjd * If applicable, add the following below this CDDL HEADER, with the
16168404Spjd * fields enclosed by brackets "[]" replaced with your own identifying
17168404Spjd * information: Portions Copyright [yyyy] [name of copyright owner]
18168404Spjd *
19168404Spjd * CDDL HEADER END
20168404Spjd */
21168404Spjd/*
22205199Sdelphij * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23168404Spjd * Use is subject to license terms.
24168404Spjd */
25168404Spjd
26168404Spjd#ifndef	ZFS_ITER_H
27168404Spjd#define	ZFS_ITER_H
28168404Spjd
29168404Spjd#ifdef	__cplusplus
30168404Spjdextern "C" {
31168404Spjd#endif
32168404Spjd
33168404Spjdtypedef struct zfs_sort_column {
34168404Spjd	struct zfs_sort_column	*sc_next;
35168404Spjd	struct zfs_sort_column	*sc_last;
36168404Spjd	zfs_prop_t		sc_prop;
37168404Spjd	char			*sc_user_prop;
38168404Spjd	boolean_t		sc_reverse;
39168404Spjd} zfs_sort_column_t;
40168404Spjd
41185029Spjd#define	ZFS_ITER_RECURSE	   (1 << 0)
42185029Spjd#define	ZFS_ITER_ARGS_CAN_BE_PATHS (1 << 1)
43185029Spjd#define	ZFS_ITER_PROP_LISTSNAPS    (1 << 2)
44205199Sdelphij#define	ZFS_ITER_DEPTH_LIMIT	   (1 << 3)
45219089Spjd#define	ZFS_ITER_RECVD_PROPS	   (1 << 4)
46185029Spjd
47185029Spjdint zfs_for_each(int, char **, int options, zfs_type_t,
48205199Sdelphij    zfs_sort_column_t *, zprop_list_t **, int, zfs_iter_f, void *);
49168404Spjdint zfs_add_sort_column(zfs_sort_column_t **, const char *, boolean_t);
50168404Spjdvoid zfs_free_sort_columns(zfs_sort_column_t *);
51168404Spjd
52168404Spjd#ifdef	__cplusplus
53168404Spjd}
54168404Spjd#endif
55168404Spjd
56168404Spjd#endif	/* ZFS_ITER_H */
57