fa9e4066f08beec538e775443c5be79dd423fcabahrens/*
fa9e4066f08beec538e775443c5be79dd423fcabahrens * CDDL HEADER START
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * The contents of this file are subject to the terms of the
99653d4ee642c6528e88224f12409a5f23060994eschrock * Common Development and Distribution License (the "License").
99653d4ee642c6528e88224f12409a5f23060994eschrock * You may not use this file except in compliance with the License.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fa9e4066f08beec538e775443c5be79dd423fcabahrens * or http://www.opensolaris.org/os/licensing.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * See the License for the specific language governing permissions
fa9e4066f08beec538e775443c5be79dd423fcabahrens * and limitations under the License.
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * When distributing Covered Code, include this CDDL HEADER in each
fa9e4066f08beec538e775443c5be79dd423fcabahrens * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * If applicable, add the following below this CDDL HEADER, with the
fa9e4066f08beec538e775443c5be79dd423fcabahrens * fields enclosed by brackets "[]" replaced with your own identifying
fa9e4066f08beec538e775443c5be79dd423fcabahrens * information: Portions Copyright [yyyy] [name of copyright owner]
fa9e4066f08beec538e775443c5be79dd423fcabahrens *
fa9e4066f08beec538e775443c5be79dd423fcabahrens * CDDL HEADER END
fa9e4066f08beec538e775443c5be79dd423fcabahrens */
43d68d68c1ce08fb35026bebfb141af422e7082eYuri Pankov
fa9e4066f08beec538e775443c5be79dd423fcabahrens/*
ae1726b6ae69a6882b0d520f4bc3433f501f2065Chris Gerhard * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Use is subject to license terms.
0d8fa8f8eba3ea46bc79d73445009505d1dd5d7dMartin Matuska * Copyright (c) 2011-2012 Pawel Jakub Dawidek. All rights reserved.
43d68d68c1ce08fb35026bebfb141af422e7082eYuri Pankov * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
fa9e4066f08beec538e775443c5be79dd423fcabahrens */
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#ifndef ZFS_ITER_H
fa9e4066f08beec538e775443c5be79dd423fcabahrens#define ZFS_ITER_H
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#ifdef __cplusplus
fa9e4066f08beec538e775443c5be79dd423fcabahrensextern "C" {
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif
fa9e4066f08beec538e775443c5be79dd423fcabahrens
b6825278356f1c9ddb8765d2f2b1d4fb62be1dbdsjelinektypedef struct zfs_sort_column {
b6825278356f1c9ddb8765d2f2b1d4fb62be1dbdsjelinek struct zfs_sort_column *sc_next;
b6825278356f1c9ddb8765d2f2b1d4fb62be1dbdsjelinek struct zfs_sort_column *sc_last;
b6825278356f1c9ddb8765d2f2b1d4fb62be1dbdsjelinek zfs_prop_t sc_prop;
e9dbad6f263d5570ed7ff5443ec5b958af8c24d7eschrock char *sc_user_prop;
b6825278356f1c9ddb8765d2f2b1d4fb62be1dbdsjelinek boolean_t sc_reverse;
b6825278356f1c9ddb8765d2f2b1d4fb62be1dbdsjelinek} zfs_sort_column_t;
b6825278356f1c9ddb8765d2f2b1d4fb62be1dbdsjelinek
d5b5bb256c576fe5ef26e0795bd40abe77f93246Rich Morris#define ZFS_ITER_RECURSE (1 << 0)
d5b5bb256c576fe5ef26e0795bd40abe77f93246Rich Morris#define ZFS_ITER_ARGS_CAN_BE_PATHS (1 << 1)
d5b5bb256c576fe5ef26e0795bd40abe77f93246Rich Morris#define ZFS_ITER_PROP_LISTSNAPS (1 << 2)
ae1726b6ae69a6882b0d520f4bc3433f501f2065Chris Gerhard#define ZFS_ITER_DEPTH_LIMIT (1 << 3)
92241e0b80813d0b83c08e730a29b9d1831794fcTom Erickson#define ZFS_ITER_RECVD_PROPS (1 << 4)
0d8fa8f8eba3ea46bc79d73445009505d1dd5d7dMartin Matuska#define ZFS_ITER_SIMPLE (1 << 5)
0d8fa8f8eba3ea46bc79d73445009505d1dd5d7dMartin Matuska#define ZFS_ITER_LITERAL_PROPS (1 << 6)
d5b5bb256c576fe5ef26e0795bd40abe77f93246Rich Morris
d5b5bb256c576fe5ef26e0795bd40abe77f93246Rich Morrisint zfs_for_each(int, char **, int options, zfs_type_t,
ae1726b6ae69a6882b0d520f4bc3433f501f2065Chris Gerhard zfs_sort_column_t *, zprop_list_t **, int, zfs_iter_f, void *);
e9dbad6f263d5570ed7ff5443ec5b958af8c24d7eschrockint zfs_add_sort_column(zfs_sort_column_t **, const char *, boolean_t);
b6825278356f1c9ddb8765d2f2b1d4fb62be1dbdsjelinekvoid zfs_free_sort_columns(zfs_sort_column_t *);
0d8fa8f8eba3ea46bc79d73445009505d1dd5d7dMartin Matuskaboolean_t zfs_sort_only_by_name(const zfs_sort_column_t *);
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#ifdef __cplusplus
fa9e4066f08beec538e775443c5be79dd423fcabahrens}
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif /* ZFS_ITER_H */