xref: /titanic_44/usr/src/lib/udapl/libdat/include/dat_dictionary.h (revision 8eea8e29cc4374d1ee24c25a07f45af132db3499)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved.
24  */
25 
26 /*
27  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
28  * Use is subject to license terms.
29  */
30 
31 /*
32  *
33  * HEADER: dat_dictionary.h
34  *
35  * PURPOSE: dictionary data structure
36  *
37  * $Id: dat_dictionary.h,v 1.6 2003/08/05 19:01:48 jlentini Exp $
38  */
39 
40 #ifndef _DAT_DICTIONARY_H_
41 #define	_DAT_DICTIONARY_H_
42 
43 #pragma ident	"%Z%%M%	%I%	%E% SMI"
44 
45 #include <dat_osd.h>
46 
47 #ifdef	__cplusplus
48 extern "C" {
49 #endif
50 
51 /*
52  *
53  * Typedefs
54  *
55  */
56 
57 typedef struct DAT_DICTIONARY   DAT_DICTIONARY;
58 typedef	void			*DAT_DICTIONARY_DATA;
59 typedef	void			*DAT_DICTIONARY_ENTRY;
60 
61 
62 /*
63  *
64  * Function Prototypes
65  *
66  */
67 
68 extern DAT_RETURN
69 dat_dictionary_create(
70     OUT DAT_DICTIONARY **pp_dictionary);
71 
72 extern DAT_RETURN
73 dat_dictionary_destroy(
74     IN  DAT_DICTIONARY *p_dictionary);
75 
76 extern DAT_RETURN
77 dat_dictionary_size(
78     IN  DAT_DICTIONARY *p_dictionary,
79     OUT DAT_COUNT *p_size);
80 
81 extern DAT_RETURN
82 dat_dictionary_entry_create(
83     OUT DAT_DICTIONARY_ENTRY *p_entry);
84 
85 extern DAT_RETURN
86 dat_dictionary_entry_destroy(
87     IN  DAT_DICTIONARY_ENTRY entry);
88 
89 extern DAT_RETURN
90 dat_dictionary_insert(
91     IN  DAT_DICTIONARY *p_dictionary,
92     IN  DAT_DICTIONARY_ENTRY entry,
93     IN  const DAT_PROVIDER_INFO *key,
94     IN  DAT_DICTIONARY_DATA data);
95 
96 extern DAT_RETURN
97 dat_dictionary_search(
98     IN  DAT_DICTIONARY *p_dictionary,
99     IN  const DAT_PROVIDER_INFO *key,
100     OUT DAT_DICTIONARY_DATA *p_data);
101 
102 extern DAT_RETURN
103 dat_dictionary_enumerate(
104     IN  DAT_DICTIONARY *p_dictionary,
105     IN  DAT_DICTIONARY_DATA array[],
106     IN  DAT_COUNT array_size);
107 
108 
109 extern DAT_RETURN
110 dat_dictionary_remove(
111     IN  DAT_DICTIONARY *p_dictionary,
112     IN  DAT_DICTIONARY_ENTRY *p_entry,
113     IN  const DAT_PROVIDER_INFO *key,
114     OUT DAT_DICTIONARY_DATA *p_data);
115 
116 #ifdef	__cplusplus
117 }
118 #endif
119 
120 #endif /* _DAT_DICTIONARY_H_ */
121