/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
*/
#include <mdb/mdb_modapi.h>
typedef struct list_walk_data {
const char *lw_elem_name;
void *lw_elem_check_arg;
/*
* Initialize a forward walk through a list.
*
* begin and end optionally specify objects other than the first and last
* objects in the list; either or both may be NULL (defaulting to first and
* last).
*
* list_name and element_name specify command-specific labels other than
* "list_t" and "list element" for use in error messages.
*
* element_check() returns -1, 1, or 0: abort the walk with an error, stop
* without an error, or allow the normal callback; arg is an optional user
* argument to element_check().
*/
int
const char *list_name, const char *element_name,
{
list_name = "list_t";
if (element_name == NULL)
element_name = "list element";
return (WALK_ERR);
}
return (WALK_ERR);
}
return (WALK_NEXT);
}
int
{
}
int
const char *list_name, const char *element_name)
{
}
int
const char *list_name, const char *element_name,
{
element_check, arg));
}
int
{
int status;
return (WALK_DONE);
return (WALK_DONE);
return (WALK_ERR);
}
if (rc == -1)
return (WALK_ERR);
else if (rc == 1)
return (WALK_DONE);
}
return (status);
}
void
{
}