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.
25307046Smav * Copyright (c) 2011-2012 Pawel Jakub Dawidek. All rights reserved.
26259850Sdelphij * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
27168404Spjd */
28168404Spjd
29168404Spjd#ifndef	ZFS_ITER_H
30168404Spjd#define	ZFS_ITER_H
31168404Spjd
32168404Spjd#ifdef	__cplusplus
33168404Spjdextern "C" {
34168404Spjd#endif
35168404Spjd
36168404Spjdtypedef struct zfs_sort_column {
37168404Spjd	struct zfs_sort_column	*sc_next;
38168404Spjd	struct zfs_sort_column	*sc_last;
39168404Spjd	zfs_prop_t		sc_prop;
40168404Spjd	char			*sc_user_prop;
41168404Spjd	boolean_t		sc_reverse;
42168404Spjd} zfs_sort_column_t;
43168404Spjd
44185029Spjd#define	ZFS_ITER_RECURSE	   (1 << 0)
45185029Spjd#define	ZFS_ITER_ARGS_CAN_BE_PATHS (1 << 1)
46185029Spjd#define	ZFS_ITER_PROP_LISTSNAPS    (1 << 2)
47205199Sdelphij#define	ZFS_ITER_DEPTH_LIMIT	   (1 << 3)
48219089Spjd#define	ZFS_ITER_RECVD_PROPS	   (1 << 4)
49230438Spjd#define	ZFS_ITER_SIMPLE		   (1 << 5)
50259850Sdelphij#define	ZFS_ITER_LITERAL_PROPS	   (1 << 6)
51185029Spjd
52185029Spjdint zfs_for_each(int, char **, int options, zfs_type_t,
53205199Sdelphij    zfs_sort_column_t *, zprop_list_t **, int, zfs_iter_f, void *);
54168404Spjdint zfs_add_sort_column(zfs_sort_column_t **, const char *, boolean_t);
55168404Spjdvoid zfs_free_sort_columns(zfs_sort_column_t *);
56230438Spjdboolean_t zfs_sort_only_by_name(const zfs_sort_column_t *);
57168404Spjd
58168404Spjd#ifdef	__cplusplus
59168404Spjd}
60168404Spjd#endif
61168404Spjd
62168404Spjd#endif	/* ZFS_ITER_H */
63