/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _NIS_HASHITEM_H
#define _NIS_HASHITEM_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <pthread.h>
#include "nisdb_rw.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Private versions of the various NIS_HASH_ITEM functions */
typedef struct __nis_item_item {
int keychain;
typedef struct {
/*
* Protects 'traversed'
* and 'traverser_id'.
*/
void (*destroyItem)(void *);
#define NIS_HASH_TABLE_MT_INIT { \
{0}, \
/* Zero is fine for the rest */ \
}
extern void __nis_init_hash_table(__nis_hash_table_mt *, void (*)(void *));
extern int __nis_lock_hash_table(__nis_hash_table_mt *, int, char *);
extern int __nis_ulock_hash_table(__nis_hash_table_mt *, int, char *);
extern int __nis_insert_item_mt(void *, __nis_hash_table_mt *, int);
int *);
extern void *__nis_pop_item_mt(__nis_hash_table_mt *);
extern int __nis_release_item(void *, __nis_hash_table_mt *, int);
extern int __nis_item_access(void *);
extern void __nis_scan_table_mt(__nis_hash_table_mt *,
bool_t (*)(__nis_hash_item_mt *, void *), void *);
/* Define-magic */
#ifdef NIS_MT_DEBUG
#else
#endif /* NIS_MT_DEBUG */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _NIS_HASHITEM_H */