1139743Simp/* 2123474Swpaul * CDDL HEADER START 3123474Swpaul * 4123474Swpaul * The contents of this file are subject to the terms of the 5123474Swpaul * Common Development and Distribution License, Version 1.0 only 6123474Swpaul * (the "License"). You may not use this file except in compliance 7123474Swpaul * with the License. 8123474Swpaul * 9123474Swpaul * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10123474Swpaul * or http://www.opensolaris.org/os/licensing. 11123474Swpaul * See the License for the specific language governing permissions 12123474Swpaul * and limitations under the License. 13123474Swpaul * 14123474Swpaul * When distributing Covered Code, include this CDDL HEADER in each 15123474Swpaul * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16123474Swpaul * If applicable, add the following below this CDDL HEADER, with the 17123474Swpaul * fields enclosed by brackets "[]" replaced with your own identifying 18123474Swpaul * information: Portions Copyright [yyyy] [name of copyright owner] 19123474Swpaul * 20123474Swpaul * CDDL HEADER END 21123474Swpaul */ 22123474Swpaul/* 23123474Swpaul * Copyright 2001-2003 Sun Microsystems, Inc. All rights reserved. 24123474Swpaul * Use is subject to license terms. 25123474Swpaul */ 26123474Swpaul 27123474Swpaul#ifndef _ASSOC_H 28123474Swpaul#define _ASSOC_H 29123474Swpaul 30123474Swpaul#pragma ident "%Z%%M% %I% %E% SMI" 31123474Swpaul 32123474Swpaul/* 33123474Swpaul * Create, manage, and destroy association lists. alists are arrays with 34123474Swpaul * arbitrary index types. 35123474Swpaul */ 36123474Swpaul 37123474Swpaul#ifdef __cplusplus 38123474Swpaulextern "C" { 39123474Swpaul#endif 40123474Swpaul 41123474Swpaultypedef struct alist alist_t; 42123620Swpaul 43123474Swpaulalist_t *alist_new(void (*)(void *), void (*)(void *)); 44123474Swpaulalist_t *alist_xnew(int, void (*)(void *), void (*)(void *), 45123474Swpaul int (*)(int, void *), int (*)(void *, void *)); 46123474Swpaulvoid alist_free(alist_t *); 47123474Swpaulvoid alist_add(alist_t *, void *, void *); 48int alist_find(alist_t *, void *, void **); 49int alist_iter(alist_t *, int (*)(void *, void *, void *), void *); 50void alist_stats(alist_t *, int); 51int alist_dump(alist_t *, int (*)(void *, void *)); 52 53#ifdef __cplusplus 54} 55#endif 56 57#endif /* _ASSOC_H */ 58