zfs_iter.h revision d5b5bb256c576fe5ef26e0795bd40abe77f93246
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 */
fa9e4066f08beec538e775443c5be79dd423fcabahrens/*
d5b5bb256c576fe5ef26e0795bd40abe77f93246Rich Morris * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Use is subject to license terms.
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)
d5b5bb256c576fe5ef26e0795bd40abe77f93246Rich Morris
d5b5bb256c576fe5ef26e0795bd40abe77f93246Rich Morrisint zfs_for_each(int, char **, int options, zfs_type_t,
d5b5bb256c576fe5ef26e0795bd40abe77f93246Rich Morris zfs_sort_column_t *, zprop_list_t **, 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 *);
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#ifdef __cplusplus
fa9e4066f08beec538e775443c5be79dd423fcabahrens}
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif
fa9e4066f08beec538e775443c5be79dd423fcabahrens
fa9e4066f08beec538e775443c5be79dd423fcabahrens#endif /* ZFS_ITER_H */