xref: /onnv-gate/usr/src/lib/libuutil/common/libuutil.h (revision 12890:16985853e3aa)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57887SLiane.Praza@Sun.COM  * Common Development and Distribution License (the "License").
67887SLiane.Praza@Sun.COM  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*12890SJoyce.McIntosh@Sun.COM  * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
230Sstevel@tonic-gate  */
240Sstevel@tonic-gate 
250Sstevel@tonic-gate #ifndef	_LIBUUTIL_H
260Sstevel@tonic-gate #define	_LIBUUTIL_H
270Sstevel@tonic-gate 
280Sstevel@tonic-gate #include <sys/types.h>
290Sstevel@tonic-gate #include <stdarg.h>
30*12890SJoyce.McIntosh@Sun.COM #include <stdio.h>
310Sstevel@tonic-gate 
320Sstevel@tonic-gate #ifdef	__cplusplus
330Sstevel@tonic-gate extern "C" {
340Sstevel@tonic-gate #endif
350Sstevel@tonic-gate 
360Sstevel@tonic-gate /*
370Sstevel@tonic-gate  * Standard flags codes.
380Sstevel@tonic-gate  */
390Sstevel@tonic-gate #define	UU_DEFAULT		0
400Sstevel@tonic-gate 
410Sstevel@tonic-gate /*
420Sstevel@tonic-gate  * Standard error codes.
430Sstevel@tonic-gate  */
440Sstevel@tonic-gate #define	UU_ERROR_NONE		0	/* no error */
450Sstevel@tonic-gate #define	UU_ERROR_INVALID_ARGUMENT 1	/* invalid argument */
460Sstevel@tonic-gate #define	UU_ERROR_UNKNOWN_FLAG	2	/* passed flag invalid */
470Sstevel@tonic-gate #define	UU_ERROR_NO_MEMORY	3	/* out of memory */
480Sstevel@tonic-gate #define	UU_ERROR_CALLBACK_FAILED 4	/* callback-initiated error */
490Sstevel@tonic-gate #define	UU_ERROR_NOT_SUPPORTED	5	/* operation not supported */
500Sstevel@tonic-gate #define	UU_ERROR_EMPTY		6	/* no value provided */
510Sstevel@tonic-gate #define	UU_ERROR_UNDERFLOW	7	/* value is too small */
520Sstevel@tonic-gate #define	UU_ERROR_OVERFLOW	8	/* value is too value */
530Sstevel@tonic-gate #define	UU_ERROR_INVALID_CHAR	9	/* value contains unexpected char */
540Sstevel@tonic-gate #define	UU_ERROR_INVALID_DIGIT	10	/* value contains digit not in base */
550Sstevel@tonic-gate 
560Sstevel@tonic-gate #define	UU_ERROR_SYSTEM		99	/* underlying system error */
570Sstevel@tonic-gate #define	UU_ERROR_UNKNOWN	100	/* error status not known */
580Sstevel@tonic-gate 
590Sstevel@tonic-gate /*
600Sstevel@tonic-gate  * Standard program exit codes.
610Sstevel@tonic-gate  */
620Sstevel@tonic-gate #define	UU_EXIT_OK	(*(uu_exit_ok()))
630Sstevel@tonic-gate #define	UU_EXIT_FATAL	(*(uu_exit_fatal()))
640Sstevel@tonic-gate #define	UU_EXIT_USAGE	(*(uu_exit_usage()))
650Sstevel@tonic-gate 
660Sstevel@tonic-gate /*
670Sstevel@tonic-gate  * Exit status profiles.
680Sstevel@tonic-gate  */
690Sstevel@tonic-gate #define	UU_PROFILE_DEFAULT	0
700Sstevel@tonic-gate #define	UU_PROFILE_LAUNCHER	1
710Sstevel@tonic-gate 
720Sstevel@tonic-gate /*
730Sstevel@tonic-gate  * Error reporting functions.
740Sstevel@tonic-gate  */
750Sstevel@tonic-gate uint32_t uu_error(void);
760Sstevel@tonic-gate const char *uu_strerror(uint32_t);
770Sstevel@tonic-gate 
780Sstevel@tonic-gate /*
790Sstevel@tonic-gate  * Program notification functions.
800Sstevel@tonic-gate  */
810Sstevel@tonic-gate extern void uu_alt_exit(int);
820Sstevel@tonic-gate extern const char *uu_setpname(char *);
830Sstevel@tonic-gate extern const char *uu_getpname(void);
840Sstevel@tonic-gate /*PRINTFLIKE1*/
850Sstevel@tonic-gate extern void uu_warn(const char *, ...);
860Sstevel@tonic-gate extern void uu_vwarn(const char *, va_list);
870Sstevel@tonic-gate /*PRINTFLIKE1*/
88471Shg115875 extern void uu_die(const char *, ...) __NORETURN;
89471Shg115875 extern void uu_vdie(const char *, va_list) __NORETURN;
900Sstevel@tonic-gate /*PRINTFLIKE2*/
91471Shg115875 extern void uu_xdie(int, const char *, ...) __NORETURN;
92471Shg115875 extern void uu_vxdie(int, const char *, va_list) __NORETURN;
930Sstevel@tonic-gate 
940Sstevel@tonic-gate /*
950Sstevel@tonic-gate  * Exit status functions (not to be used directly)
960Sstevel@tonic-gate  */
970Sstevel@tonic-gate extern int *uu_exit_ok(void);
980Sstevel@tonic-gate extern int *uu_exit_fatal(void);
990Sstevel@tonic-gate extern int *uu_exit_usage(void);
1000Sstevel@tonic-gate 
1010Sstevel@tonic-gate /*
1020Sstevel@tonic-gate  * string->number conversions
1030Sstevel@tonic-gate  */
1040Sstevel@tonic-gate extern int uu_strtoint(const char *, void *, size_t, int, int64_t, int64_t);
1050Sstevel@tonic-gate extern int uu_strtouint(const char *, void *, size_t, int, uint64_t, uint64_t);
1060Sstevel@tonic-gate 
1070Sstevel@tonic-gate /*
1080Sstevel@tonic-gate  * Debug print facility functions.
1090Sstevel@tonic-gate  */
1100Sstevel@tonic-gate typedef struct uu_dprintf uu_dprintf_t;
1110Sstevel@tonic-gate 
1120Sstevel@tonic-gate typedef enum {
1130Sstevel@tonic-gate 	UU_DPRINTF_SILENT,
1140Sstevel@tonic-gate 	UU_DPRINTF_FATAL,
1150Sstevel@tonic-gate 	UU_DPRINTF_WARNING,
1160Sstevel@tonic-gate 	UU_DPRINTF_NOTICE,
1170Sstevel@tonic-gate 	UU_DPRINTF_INFO,
1180Sstevel@tonic-gate 	UU_DPRINTF_DEBUG
1190Sstevel@tonic-gate } uu_dprintf_severity_t;
1200Sstevel@tonic-gate 
1210Sstevel@tonic-gate extern uu_dprintf_t *uu_dprintf_create(const char *, uu_dprintf_severity_t,
1220Sstevel@tonic-gate     uint_t);
1230Sstevel@tonic-gate /*PRINTFLIKE3*/
1240Sstevel@tonic-gate extern void uu_dprintf(uu_dprintf_t *, uu_dprintf_severity_t,
1250Sstevel@tonic-gate     const char *, ...);
1260Sstevel@tonic-gate extern void uu_dprintf_destroy(uu_dprintf_t *);
1270Sstevel@tonic-gate extern const char *uu_dprintf_getname(uu_dprintf_t *);
1280Sstevel@tonic-gate 
1290Sstevel@tonic-gate /*
1300Sstevel@tonic-gate  * Identifier test flags and function.
1310Sstevel@tonic-gate  */
1320Sstevel@tonic-gate #define	UU_NAME_DOMAIN		0x1	/* allow SUNW, or com.sun, prefix */
1330Sstevel@tonic-gate #define	UU_NAME_PATH		0x2	/* allow '/'-delimited paths */
1340Sstevel@tonic-gate 
1350Sstevel@tonic-gate int uu_check_name(const char *, uint_t);
1360Sstevel@tonic-gate 
1370Sstevel@tonic-gate /*
1380Sstevel@tonic-gate  * File creation functions.
1390Sstevel@tonic-gate  */
1400Sstevel@tonic-gate extern int uu_open_tmp(const char *dir, uint_t uflags);
1410Sstevel@tonic-gate 
1420Sstevel@tonic-gate /*
1430Sstevel@tonic-gate  * Convenience functions.
1440Sstevel@tonic-gate  */
145*12890SJoyce.McIntosh@Sun.COM #define	UU_NELEM(a)	(sizeof (a) / sizeof ((a)[0]))
146*12890SJoyce.McIntosh@Sun.COM 
1470Sstevel@tonic-gate /*PRINTFLIKE1*/
1480Sstevel@tonic-gate extern char *uu_msprintf(const char *format, ...);
1490Sstevel@tonic-gate extern void *uu_zalloc(size_t);
1507887SLiane.Praza@Sun.COM extern char *uu_strdup(const char *);
1510Sstevel@tonic-gate extern void uu_free(void *);
1520Sstevel@tonic-gate 
153*12890SJoyce.McIntosh@Sun.COM extern boolean_t uu_strcaseeq(const char *a, const char *b);
154*12890SJoyce.McIntosh@Sun.COM extern boolean_t uu_streq(const char *a, const char *b);
155*12890SJoyce.McIntosh@Sun.COM extern char *uu_strndup(const char *s, size_t n);
156*12890SJoyce.McIntosh@Sun.COM extern boolean_t uu_strbw(const char *a, const char *b);
157*12890SJoyce.McIntosh@Sun.COM extern void *uu_memdup(const void *buf, size_t sz);
158*12890SJoyce.McIntosh@Sun.COM extern void uu_dump(FILE *out, const char *prefix, const void *buf, size_t len);
159*12890SJoyce.McIntosh@Sun.COM 
1600Sstevel@tonic-gate /*
1610Sstevel@tonic-gate  * Comparison function type definition.
1620Sstevel@tonic-gate  *   Developers should be careful in their use of the _private argument. If you
1630Sstevel@tonic-gate  *   break interface guarantees, you get undefined behavior.
1640Sstevel@tonic-gate  */
1650Sstevel@tonic-gate typedef int uu_compare_fn_t(const void *__left, const void *__right,
1660Sstevel@tonic-gate     void *__private);
1670Sstevel@tonic-gate 
1680Sstevel@tonic-gate /*
1690Sstevel@tonic-gate  * Walk variant flags.
1700Sstevel@tonic-gate  *   A data structure need not provide support for all variants and
1710Sstevel@tonic-gate  *   combinations.  Refer to the appropriate documentation.
1720Sstevel@tonic-gate  */
1730Sstevel@tonic-gate #define	UU_WALK_ROBUST		0x00000001	/* walk can survive removes */
1740Sstevel@tonic-gate #define	UU_WALK_REVERSE		0x00000002	/* reverse walk order */
1750Sstevel@tonic-gate 
1760Sstevel@tonic-gate #define	UU_WALK_PREORDER	0x00000010	/* walk tree in pre-order */
1770Sstevel@tonic-gate #define	UU_WALK_POSTORDER	0x00000020	/* walk tree in post-order */
1780Sstevel@tonic-gate 
1790Sstevel@tonic-gate /*
1800Sstevel@tonic-gate  * Walk callback function return codes.
1810Sstevel@tonic-gate  */
1820Sstevel@tonic-gate #define	UU_WALK_ERROR		-1
1830Sstevel@tonic-gate #define	UU_WALK_NEXT		0
1840Sstevel@tonic-gate #define	UU_WALK_DONE		1
1850Sstevel@tonic-gate 
1860Sstevel@tonic-gate /*
1870Sstevel@tonic-gate  * Walk callback function type definition.
1880Sstevel@tonic-gate  */
1890Sstevel@tonic-gate typedef int uu_walk_fn_t(void *_elem, void *_private);
1900Sstevel@tonic-gate 
1910Sstevel@tonic-gate /*
1920Sstevel@tonic-gate  * lists: opaque structures
1930Sstevel@tonic-gate  */
1940Sstevel@tonic-gate typedef struct uu_list_pool uu_list_pool_t;
1950Sstevel@tonic-gate typedef struct uu_list uu_list_t;
1960Sstevel@tonic-gate 
1970Sstevel@tonic-gate typedef struct uu_list_node {
1980Sstevel@tonic-gate 	uintptr_t uln_opaque[2];
1990Sstevel@tonic-gate } uu_list_node_t;
2000Sstevel@tonic-gate 
2010Sstevel@tonic-gate typedef struct uu_list_walk uu_list_walk_t;
2020Sstevel@tonic-gate 
2030Sstevel@tonic-gate typedef uintptr_t uu_list_index_t;
2040Sstevel@tonic-gate 
2050Sstevel@tonic-gate /*
2060Sstevel@tonic-gate  * lists: interface
2070Sstevel@tonic-gate  *
2080Sstevel@tonic-gate  * basic usage:
2090Sstevel@tonic-gate  *	typedef struct foo {
2100Sstevel@tonic-gate  *		...
2110Sstevel@tonic-gate  *		uu_list_node_t foo_node;
2120Sstevel@tonic-gate  *		...
2130Sstevel@tonic-gate  *	} foo_t;
2140Sstevel@tonic-gate  *
2150Sstevel@tonic-gate  *	static int
2160Sstevel@tonic-gate  *	foo_compare(void *l_arg, void *r_arg, void *private)
2170Sstevel@tonic-gate  *	{
2180Sstevel@tonic-gate  *		foo_t *l = l_arg;
2190Sstevel@tonic-gate  *		foo_t *r = r_arg;
2200Sstevel@tonic-gate  *
2210Sstevel@tonic-gate  *		if (... l greater than r ...)
2220Sstevel@tonic-gate  *			return (1);
2230Sstevel@tonic-gate  *		if (... l less than r ...)
2240Sstevel@tonic-gate  *			return (-1);
2250Sstevel@tonic-gate  *		return (0);
2260Sstevel@tonic-gate  *	}
2270Sstevel@tonic-gate  *
2280Sstevel@tonic-gate  *	...
2290Sstevel@tonic-gate  *		// at initialization time
2300Sstevel@tonic-gate  *		foo_pool = uu_list_pool_create("foo_pool",
2310Sstevel@tonic-gate  *		    sizeof (foo_t), offsetof(foo_t, foo_node), foo_compare,
2320Sstevel@tonic-gate  *		    debugging? 0 : UU_AVL_POOL_DEBUG);
2330Sstevel@tonic-gate  *	...
2340Sstevel@tonic-gate  */
2350Sstevel@tonic-gate uu_list_pool_t *uu_list_pool_create(const char *, size_t, size_t,
2360Sstevel@tonic-gate     uu_compare_fn_t *, uint32_t);
2370Sstevel@tonic-gate #define	UU_LIST_POOL_DEBUG	0x00000001
2380Sstevel@tonic-gate 
2390Sstevel@tonic-gate void uu_list_pool_destroy(uu_list_pool_t *);
2400Sstevel@tonic-gate 
2410Sstevel@tonic-gate /*
2420Sstevel@tonic-gate  * usage:
2430Sstevel@tonic-gate  *
2440Sstevel@tonic-gate  *	foo_t *a;
2450Sstevel@tonic-gate  *	a = malloc(sizeof(*a));
2460Sstevel@tonic-gate  *	uu_list_node_init(a, &a->foo_list, pool);
2470Sstevel@tonic-gate  *	...
2480Sstevel@tonic-gate  *	uu_list_node_fini(a, &a->foo_list, pool);
2490Sstevel@tonic-gate  *	free(a);
2500Sstevel@tonic-gate  */
2510Sstevel@tonic-gate void uu_list_node_init(void *, uu_list_node_t *, uu_list_pool_t *);
2520Sstevel@tonic-gate void uu_list_node_fini(void *, uu_list_node_t *, uu_list_pool_t *);
2530Sstevel@tonic-gate 
2540Sstevel@tonic-gate uu_list_t *uu_list_create(uu_list_pool_t *, void *_parent, uint32_t);
2550Sstevel@tonic-gate #define	UU_LIST_DEBUG	0x00000001
2560Sstevel@tonic-gate #define	UU_LIST_SORTED	0x00000002	/* list is sorted */
2570Sstevel@tonic-gate 
2580Sstevel@tonic-gate void uu_list_destroy(uu_list_t *);	/* list must be empty */
2590Sstevel@tonic-gate 
2600Sstevel@tonic-gate size_t uu_list_numnodes(uu_list_t *);
2610Sstevel@tonic-gate 
2620Sstevel@tonic-gate void *uu_list_first(uu_list_t *);
2630Sstevel@tonic-gate void *uu_list_last(uu_list_t *);
2640Sstevel@tonic-gate 
2650Sstevel@tonic-gate void *uu_list_next(uu_list_t *, void *);
2660Sstevel@tonic-gate void *uu_list_prev(uu_list_t *, void *);
2670Sstevel@tonic-gate 
2680Sstevel@tonic-gate int uu_list_walk(uu_list_t *, uu_walk_fn_t *, void *, uint32_t);
2690Sstevel@tonic-gate 
2700Sstevel@tonic-gate uu_list_walk_t *uu_list_walk_start(uu_list_t *, uint32_t);
2710Sstevel@tonic-gate void *uu_list_walk_next(uu_list_walk_t *);
2720Sstevel@tonic-gate void uu_list_walk_end(uu_list_walk_t *);
2730Sstevel@tonic-gate 
2740Sstevel@tonic-gate void *uu_list_find(uu_list_t *, void *, void *, uu_list_index_t *);
2750Sstevel@tonic-gate void uu_list_insert(uu_list_t *, void *, uu_list_index_t);
2760Sstevel@tonic-gate 
2770Sstevel@tonic-gate void *uu_list_nearest_next(uu_list_t *, uu_list_index_t);
2780Sstevel@tonic-gate void *uu_list_nearest_prev(uu_list_t *, uu_list_index_t);
2790Sstevel@tonic-gate 
2800Sstevel@tonic-gate void *uu_list_teardown(uu_list_t *, void **);
2810Sstevel@tonic-gate 
2820Sstevel@tonic-gate void uu_list_remove(uu_list_t *, void *);
2830Sstevel@tonic-gate 
2840Sstevel@tonic-gate /*
2850Sstevel@tonic-gate  * lists: interfaces for non-sorted lists only
2860Sstevel@tonic-gate  */
2870Sstevel@tonic-gate int uu_list_insert_before(uu_list_t *, void *_target, void *_elem);
2880Sstevel@tonic-gate int uu_list_insert_after(uu_list_t *, void *_target, void *_elem);
2890Sstevel@tonic-gate 
2900Sstevel@tonic-gate /*
2910Sstevel@tonic-gate  * avl trees: opaque structures
2920Sstevel@tonic-gate  */
2930Sstevel@tonic-gate typedef struct uu_avl_pool uu_avl_pool_t;
2940Sstevel@tonic-gate typedef struct uu_avl uu_avl_t;
2950Sstevel@tonic-gate 
2960Sstevel@tonic-gate typedef struct uu_avl_node {
2970Sstevel@tonic-gate #ifdef _LP64
2980Sstevel@tonic-gate 	uintptr_t uan_opaque[3];
2990Sstevel@tonic-gate #else
3000Sstevel@tonic-gate 	uintptr_t uan_opaque[4];
3010Sstevel@tonic-gate #endif
3020Sstevel@tonic-gate } uu_avl_node_t;
3030Sstevel@tonic-gate 
3040Sstevel@tonic-gate typedef struct uu_avl_walk uu_avl_walk_t;
3050Sstevel@tonic-gate 
3060Sstevel@tonic-gate typedef uintptr_t uu_avl_index_t;
3070Sstevel@tonic-gate 
3080Sstevel@tonic-gate /*
3090Sstevel@tonic-gate  * avl trees: interface
3100Sstevel@tonic-gate  *
3110Sstevel@tonic-gate  * basic usage:
3120Sstevel@tonic-gate  *	typedef struct foo {
3130Sstevel@tonic-gate  *		...
3140Sstevel@tonic-gate  *		uu_avl_node_t foo_node;
3150Sstevel@tonic-gate  *		...
3160Sstevel@tonic-gate  *	} foo_t;
3170Sstevel@tonic-gate  *
3180Sstevel@tonic-gate  *	static int
3190Sstevel@tonic-gate  *	foo_compare(void *l_arg, void *r_arg, void *private)
3200Sstevel@tonic-gate  *	{
3210Sstevel@tonic-gate  *		foo_t *l = l_arg;
3220Sstevel@tonic-gate  *		foo_t *r = r_arg;
3230Sstevel@tonic-gate  *
3240Sstevel@tonic-gate  *		if (... l greater than r ...)
3250Sstevel@tonic-gate  *			return (1);
3260Sstevel@tonic-gate  *		if (... l less than r ...)
3270Sstevel@tonic-gate  *			return (-1);
3280Sstevel@tonic-gate  *		return (0);
3290Sstevel@tonic-gate  *	}
3300Sstevel@tonic-gate  *
3310Sstevel@tonic-gate  *	...
3320Sstevel@tonic-gate  *		// at initialization time
3330Sstevel@tonic-gate  *		foo_pool = uu_avl_pool_create("foo_pool",
3340Sstevel@tonic-gate  *		    sizeof (foo_t), offsetof(foo_t, foo_node), foo_compare,
3350Sstevel@tonic-gate  *		    debugging? 0 : UU_AVL_POOL_DEBUG);
3360Sstevel@tonic-gate  *	...
3370Sstevel@tonic-gate  */
3380Sstevel@tonic-gate uu_avl_pool_t *uu_avl_pool_create(const char *, size_t, size_t,
3390Sstevel@tonic-gate     uu_compare_fn_t *, uint32_t);
3400Sstevel@tonic-gate #define	UU_AVL_POOL_DEBUG	0x00000001
3410Sstevel@tonic-gate 
3420Sstevel@tonic-gate void uu_avl_pool_destroy(uu_avl_pool_t *);
3430Sstevel@tonic-gate 
3440Sstevel@tonic-gate /*
3450Sstevel@tonic-gate  * usage:
3460Sstevel@tonic-gate  *
3470Sstevel@tonic-gate  *	foo_t *a;
3480Sstevel@tonic-gate  *	a = malloc(sizeof(*a));
3490Sstevel@tonic-gate  *	uu_avl_node_init(a, &a->foo_avl, pool);
3500Sstevel@tonic-gate  *	...
3510Sstevel@tonic-gate  *	uu_avl_node_fini(a, &a->foo_avl, pool);
3520Sstevel@tonic-gate  *	free(a);
3530Sstevel@tonic-gate  */
3540Sstevel@tonic-gate void uu_avl_node_init(void *, uu_avl_node_t *, uu_avl_pool_t *);
3550Sstevel@tonic-gate void uu_avl_node_fini(void *, uu_avl_node_t *, uu_avl_pool_t *);
3560Sstevel@tonic-gate 
3570Sstevel@tonic-gate uu_avl_t *uu_avl_create(uu_avl_pool_t *, void *_parent, uint32_t);
3580Sstevel@tonic-gate #define	UU_AVL_DEBUG	0x00000001
3590Sstevel@tonic-gate 
3600Sstevel@tonic-gate void uu_avl_destroy(uu_avl_t *);	/* list must be empty */
3610Sstevel@tonic-gate 
3620Sstevel@tonic-gate size_t uu_avl_numnodes(uu_avl_t *);
3630Sstevel@tonic-gate 
3640Sstevel@tonic-gate void *uu_avl_first(uu_avl_t *);
3650Sstevel@tonic-gate void *uu_avl_last(uu_avl_t *);
3660Sstevel@tonic-gate 
3670Sstevel@tonic-gate void *uu_avl_next(uu_avl_t *, void *);
3680Sstevel@tonic-gate void *uu_avl_prev(uu_avl_t *, void *);
3690Sstevel@tonic-gate 
3700Sstevel@tonic-gate int uu_avl_walk(uu_avl_t *, uu_walk_fn_t *, void *, uint32_t);
3710Sstevel@tonic-gate 
3720Sstevel@tonic-gate uu_avl_walk_t *uu_avl_walk_start(uu_avl_t *, uint32_t);
3730Sstevel@tonic-gate void *uu_avl_walk_next(uu_avl_walk_t *);
3740Sstevel@tonic-gate void uu_avl_walk_end(uu_avl_walk_t *);
3750Sstevel@tonic-gate 
3760Sstevel@tonic-gate void *uu_avl_find(uu_avl_t *, void *, void *, uu_avl_index_t *);
3770Sstevel@tonic-gate void uu_avl_insert(uu_avl_t *, void *, uu_avl_index_t);
3780Sstevel@tonic-gate 
3790Sstevel@tonic-gate void *uu_avl_nearest_next(uu_avl_t *, uu_avl_index_t);
3800Sstevel@tonic-gate void *uu_avl_nearest_prev(uu_avl_t *, uu_avl_index_t);
3810Sstevel@tonic-gate 
3820Sstevel@tonic-gate void *uu_avl_teardown(uu_avl_t *, void **);
3830Sstevel@tonic-gate 
3840Sstevel@tonic-gate void uu_avl_remove(uu_avl_t *, void *);
3850Sstevel@tonic-gate 
3860Sstevel@tonic-gate #ifdef	__cplusplus
3870Sstevel@tonic-gate }
3880Sstevel@tonic-gate #endif
3890Sstevel@tonic-gate 
3900Sstevel@tonic-gate #endif	/* _LIBUUTIL_H */
391