nscd_db.h revision e37190e5b4531a897e4191a30b8f41678b582e25
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _NSCD_DB_H
#define _NSCD_DB_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <nss_dbdefs.h> /* nssuint_t */
#include "nscd_common.h"
/* make a pointer 8-byte aligned, or an integer a multiple of 8 */
/*
* type of nscd data
*/
#define NSCD_DATA_UNKNOWN 0
#define NSCD_DATA_NSW_CONFIG 1
#define NSCD_DATA_NSW_STATE_BASE 2
#define NSCD_DATA_GETENT_CTX_BASE 3
#define NSCD_DATA_BACKEND_INFO 4
#define NSCD_DATA_BACKEND_INFO_DB 5
#define NSCD_DATA_CFG_NSW_DB_INDEX 6
#define NSCD_DATA_CFG_NSW_SRC_INDEX 7
#define NSCD_DATA_CFG_PARAM_INDEX 8
#define NSCD_DATA_CFG_STAT_INDEX 9
#define NSCD_DATA_ADDR 127
#define NSCD_DATA_CTX_ADDR 128
/*
* database operation options
*/
typedef enum {
/*
* This structure defines an instance of the
* nscd database entry.
*/
typedef struct nscd_db_entry {
int type;
int id_num;
int num_data;
int num_array;
char *name;
void **data_array;
/*
* sequence number attached to nscd data
*/
typedef nssuint_t nscd_seq_num_t;
typedef nssuint_t nscd_cookie_num_t;
/*
* The nscd_access_s datatype represents a nscd
* access data structure. It is an opaque structure.
*/
struct nscd_access_s;
typedef struct nscd_access_s nscd_access_t;
struct nscd_acc_data_s;
typedef struct nscd_acc_data_s nscd_acc_data_t;
/*
* The nscd_db_t datatype represents a nscd
* database. It is also an opaque structure.
*/
struct nscd_db_s;
/*
* four sizes for a nscd database:
* large, medium, small, tiny
*/
#define NSCD_DB_SIZE_LARGE 1
#define NSCD_DB_SIZE_MEDIUM 2
#define NSCD_DB_SIZE_SMALL 3
#define NSCD_DB_SIZE_TINY 4
/*
* options for _nscd_alloc()
*/
#define NSCD_ALLOC_MUTEX 0x0001
#define NSCD_ALLOC_RWLOCK 0x0002
#define NSCD_ALLOC_COND 0x0004
/*
* prototypes
*/
void
void
void
void
void
void
int type,
void (*data_free)(
int option);
void *ptr,
int type,
rwlock_t *
void *ptr,
void
void *ptr,
int size);
void
int type,
const char *name,
int dataSize,
int num_data,
int num_array);
const nscd_db_entry_t *
int type,
const char *str,
int id_num);
const char *str,
int type,
const char *str,
int id_num);
void *
void
#ifdef __cplusplus
}
#endif
#endif /* _NSCD_DB_H */