xref: /freebsd/crypto/krb5/src/ccapi/server/ccs_array.h (revision b670c9bafc0e31c7609969bf374b2e80bdc00211)
1 /* ccapi/server/ccs_array.h */
2 /*
3  * Copyright 2006, 2007 Massachusetts Institute of Technology.
4  * All Rights Reserved.
5  *
6  * Export of this software from the United States of America may
7  * require a specific license from the United States Government.
8  * It is the responsibility of any person or organization contemplating
9  * export to obtain such a license before exporting.
10  *
11  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
12  * distribute this software and its documentation for any purpose and
13  * without fee is hereby granted, provided that the above copyright
14  * notice appear in all copies and that both that copyright notice and
15  * this permission notice appear in supporting documentation, and that
16  * the name of M.I.T. not be used in advertising or publicity pertaining
17  * to distribution of the software without specific, written prior
18  * permission.  Furthermore if you modify this software you must label
19  * your software as modified software and not distribute it in such a
20  * fashion that it might be confused with the original M.I.T. software.
21  * M.I.T. makes no representations about the suitability of
22  * this software for any purpose.  It is provided "as is" without express
23  * or implied warranty.
24  */
25 
26 #ifndef CCS_ARRAY_H
27 #define CCS_ARRAY_H
28 
29 #include "ccs_types.h"
30 
31 cc_int32 ccs_client_array_new (ccs_client_array_t *out_array);
32 
33 cc_int32 ccs_client_array_release (ccs_client_array_t io_array);
34 
35 cc_uint64 ccs_client_array_count (ccs_client_array_t in_array);
36 
37 ccs_client_t ccs_client_array_object_at_index (ccs_client_array_t io_array,
38                                                cc_uint64          in_position);
39 
40 cc_int32 ccs_client_array_insert (ccs_client_array_t io_array,
41                                   ccs_client_t       in_client,
42                                   cc_uint64          in_position);
43 
44 cc_int32 ccs_client_array_remove (ccs_client_array_t io_array,
45                                   cc_uint64          in_position);
46 
47 #ifdef TARGET_OS_MAC
48 #pragma mark -
49 #endif
50 
51 cc_int32 ccs_lock_array_new (ccs_lock_array_t *out_array);
52 
53 cc_int32 ccs_lock_array_release (ccs_lock_array_t io_array);
54 
55 cc_uint64 ccs_lock_array_count (ccs_lock_array_t in_array);
56 
57 ccs_lock_t ccs_lock_array_object_at_index (ccs_lock_array_t io_array,
58                                            cc_uint64        in_position);
59 
60 cc_int32 ccs_lock_array_insert (ccs_lock_array_t io_array,
61                                 ccs_lock_t       in_lock,
62                                 cc_uint64        in_position);
63 
64 cc_int32 ccs_lock_array_remove (ccs_lock_array_t io_array,
65                                 cc_uint64        in_position);
66 
67 cc_int32 ccs_lock_array_move (ccs_lock_array_t  io_array,
68                               cc_uint64         in_position,
69                               cc_uint64         in_new_position,
70                               cc_uint64        *out_real_new_position);
71 
72 #ifdef TARGET_OS_MAC
73 #pragma mark -
74 #endif
75 
76 cc_int32 ccs_callback_array_new (ccs_callback_array_t *out_array);
77 
78 cc_int32 ccs_callback_array_release (ccs_callback_array_t io_array);
79 
80 cc_uint64 ccs_callback_array_count (ccs_callback_array_t in_array);
81 
82 ccs_callback_t ccs_callback_array_object_at_index (ccs_callback_array_t io_array,
83 						   cc_uint64            in_position);
84 
85 cc_int32 ccs_callback_array_insert (ccs_callback_array_t io_array,
86 				    ccs_callback_t       in_callback,
87 				    cc_uint64            in_position);
88 
89 cc_int32 ccs_callback_array_remove (ccs_callback_array_t io_array,
90 				    cc_uint64           in_position);
91 
92 #ifdef TARGET_OS_MAC
93 #pragma mark -
94 #endif
95 
96 cc_int32 ccs_callbackref_array_new (ccs_callbackref_array_t *out_array);
97 
98 cc_int32 ccs_callbackref_array_release (ccs_callbackref_array_t io_array);
99 
100 cc_uint64 ccs_callbackref_array_count (ccs_callbackref_array_t in_array);
101 
102 ccs_callback_t ccs_callbackref_array_object_at_index (ccs_callbackref_array_t io_array,
103 						      cc_uint64               in_position);
104 
105 cc_int32 ccs_callbackref_array_insert (ccs_callbackref_array_t io_array,
106 				       ccs_callback_t          in_callback,
107 				       cc_uint64               in_position);
108 
109 cc_int32 ccs_callbackref_array_remove (ccs_callbackref_array_t io_array,
110 				       cc_uint64               in_position);
111 
112 #ifdef TARGET_OS_MAC
113 #pragma mark -
114 #endif
115 
116 cc_int32 ccs_iteratorref_array_new (ccs_iteratorref_array_t *out_array);
117 
118 cc_int32 ccs_iteratorref_array_release (ccs_iteratorref_array_t io_array);
119 
120 cc_uint64 ccs_iteratorref_array_count (ccs_iteratorref_array_t in_array);
121 
122 ccs_generic_list_iterator_t ccs_iteratorref_array_object_at_index (ccs_iteratorref_array_t io_array,
123                                                                    cc_uint64               in_position);
124 
125 cc_int32 ccs_iteratorref_array_insert (ccs_iteratorref_array_t     io_array,
126                                        ccs_generic_list_iterator_t in_iterator,
127                                        cc_uint64                   in_position);
128 
129 cc_int32 ccs_iteratorref_array_remove (ccs_iteratorref_array_t io_array,
130                                        cc_uint64               in_position);
131 
132 #endif /* CCS_ARRAY_H */
133