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 */
21259850Sdelphij
22168404Spjd/*
23205199Sdelphij * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24168404Spjd * Use is subject to license terms.
25259850Sdelphij * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
26168404Spjd */
27168404Spjd
28168404Spjd#ifndef	ZFS_ITER_H
29168404Spjd#define	ZFS_ITER_H
30168404Spjd
31168404Spjd#ifdef	__cplusplus
32168404Spjdextern "C" {
33168404Spjd#endif
34168404Spjd
35168404Spjdtypedef struct zfs_sort_column {
36168404Spjd	struct zfs_sort_column	*sc_next;
37168404Spjd	struct zfs_sort_column	*sc_last;
38168404Spjd	zfs_prop_t		sc_prop;
39168404Spjd	char			*sc_user_prop;
40168404Spjd	boolean_t		sc_reverse;
41168404Spjd} zfs_sort_column_t;
42168404Spjd
43185029Spjd#define	ZFS_ITER_RECURSE	   (1 << 0)
44185029Spjd#define	ZFS_ITER_ARGS_CAN_BE_PATHS (1 << 1)
45185029Spjd#define	ZFS_ITER_PROP_LISTSNAPS    (1 << 2)
46205199Sdelphij#define	ZFS_ITER_DEPTH_LIMIT	   (1 << 3)
47219089Spjd#define	ZFS_ITER_RECVD_PROPS	   (1 << 4)
48230438Spjd#define	ZFS_ITER_SIMPLE		   (1 << 5)
49259850Sdelphij#define	ZFS_ITER_LITERAL_PROPS	   (1 << 6)
50185029Spjd
51185029Spjdint zfs_for_each(int, char **, int options, zfs_type_t,
52205199Sdelphij    zfs_sort_column_t *, zprop_list_t **, int, zfs_iter_f, void *);
53168404Spjdint zfs_add_sort_column(zfs_sort_column_t **, const char *, boolean_t);
54168404Spjdvoid zfs_free_sort_columns(zfs_sort_column_t *);
55230438Spjdboolean_t zfs_sort_only_by_name(const zfs_sort_column_t *);
56168404Spjd
57168404Spjd#ifdef	__cplusplus
58168404Spjd}
59168404Spjd#endif
60168404Spjd
61168404Spjd#endif	/* ZFS_ITER_H */
62