xref: /illumos-gate/usr/src/lib/udapl/libdat/include/dat_dictionary.h (revision d48be21240dfd051b689384ce2b23479d757f2d8)
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 #include <dat_osd.h>
44 
45 #ifdef	__cplusplus
46 extern "C" {
47 #endif
48 
49 /*
50  *
51  * Typedefs
52  *
53  */
54 
55 typedef struct DAT_DICTIONARY   DAT_DICTIONARY;
56 typedef	void			*DAT_DICTIONARY_DATA;
57 typedef	void			*DAT_DICTIONARY_ENTRY;
58 
59 
60 /*
61  *
62  * Function Prototypes
63  *
64  */
65 
66 extern DAT_RETURN
67 dat_dictionary_create(
68     OUT DAT_DICTIONARY **pp_dictionary);
69 
70 extern DAT_RETURN
71 dat_dictionary_destroy(
72     IN  DAT_DICTIONARY *p_dictionary);
73 
74 extern DAT_RETURN
75 dat_dictionary_size(
76     IN  DAT_DICTIONARY *p_dictionary,
77     OUT DAT_COUNT *p_size);
78 
79 extern DAT_RETURN
80 dat_dictionary_entry_create(
81     OUT DAT_DICTIONARY_ENTRY *p_entry);
82 
83 extern DAT_RETURN
84 dat_dictionary_entry_destroy(
85     IN  DAT_DICTIONARY_ENTRY entry);
86 
87 extern DAT_RETURN
88 dat_dictionary_insert(
89     IN  DAT_DICTIONARY *p_dictionary,
90     IN  DAT_DICTIONARY_ENTRY entry,
91     IN  const DAT_PROVIDER_INFO *key,
92     IN  DAT_DICTIONARY_DATA data);
93 
94 extern DAT_RETURN
95 dat_dictionary_search(
96     IN  DAT_DICTIONARY *p_dictionary,
97     IN  const DAT_PROVIDER_INFO *key,
98     OUT DAT_DICTIONARY_DATA *p_data);
99 
100 extern DAT_RETURN
101 dat_dictionary_enumerate(
102     IN  DAT_DICTIONARY *p_dictionary,
103     IN  DAT_DICTIONARY_DATA array[],
104     IN  DAT_COUNT array_size);
105 
106 
107 extern DAT_RETURN
108 dat_dictionary_remove(
109     IN  DAT_DICTIONARY *p_dictionary,
110     IN  DAT_DICTIONARY_ENTRY *p_entry,
111     IN  const DAT_PROVIDER_INFO *key,
112     OUT DAT_DICTIONARY_DATA *p_data);
113 
114 #ifdef	__cplusplus
115 }
116 #endif
117 
118 #endif /* _DAT_DICTIONARY_H_ */
119