[OLEACC]
[reactos.git] / reactos / include / reactos / libs / gnutls / p11-kit / iter.h
1 /*
2 * Copyright (c) 2013 Red Hat, Inc
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * * Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the
10 * following disclaimer.
11 * * Redistributions in binary form must reproduce the
12 * above copyright notice, this list of conditions and
13 * the following disclaimer in the documentation and/or
14 * other materials provided with the distribution.
15 * * The names of contributors to this software may not be
16 * used to endorse or promote products derived from this
17 * software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
26 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
29 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
30 * DAMAGE.
31 *
32 * Author: Stef Walter <stefw@redhat.com>
33 */
34
35 #ifndef P11_KIT_ITER_H
36 #define P11_KIT_ITER_H
37
38 #include "p11-kit/p11-kit.h"
39 #include "p11-kit/pkcs11.h"
40 #include "p11-kit/uri.h"
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
46 #ifdef P11_KIT_FUTURE_UNSTABLE_API
47
48 typedef struct p11_kit_iter P11KitIter;
49 typedef P11KitIter p11_kit_iter;
50
51 typedef enum {
52 P11_KIT_ITER_BUSY_SESSIONS = 1 << 1,
53 P11_KIT_ITER_WANT_WRITABLE = 1 << 2,
54 } P11KitIterBehavior;
55
56 typedef CK_RV (* p11_kit_iter_callback) (P11KitIter *iter,
57 CK_BBOOL *matches,
58 void *data);
59
60 P11KitIter * p11_kit_iter_new (P11KitUri *uri,
61 P11KitIterBehavior behavior);
62
63 void p11_kit_iter_free (P11KitIter *iter);
64
65 void p11_kit_iter_add_callback (P11KitIter *iter,
66 p11_kit_iter_callback callback,
67 void *callback_data,
68 p11_kit_destroyer callback_destroy);
69
70 void p11_kit_iter_add_filter (P11KitIter *iter,
71 CK_ATTRIBUTE *matching,
72 CK_ULONG count);
73
74 void p11_kit_iter_set_uri (P11KitIter *iter,
75 P11KitUri *uri);
76
77 void p11_kit_iter_begin (P11KitIter *iter,
78 CK_FUNCTION_LIST_PTR *modules);
79
80 void p11_kit_iter_begin_with (P11KitIter *iter,
81 CK_FUNCTION_LIST_PTR module,
82 CK_SLOT_ID slot,
83 CK_SESSION_HANDLE session);
84
85 CK_RV p11_kit_iter_next (P11KitIter *iter);
86
87 CK_FUNCTION_LIST_PTR p11_kit_iter_get_module (P11KitIter *iter);
88
89 CK_SLOT_ID p11_kit_iter_get_slot (P11KitIter *iter);
90
91 CK_TOKEN_INFO * p11_kit_iter_get_token (P11KitIter *iter);
92
93 CK_SESSION_HANDLE p11_kit_iter_get_session (P11KitIter *iter);
94
95 CK_OBJECT_HANDLE p11_kit_iter_get_object (P11KitIter *iter);
96
97 CK_RV p11_kit_iter_get_attributes (P11KitIter *iter,
98 CK_ATTRIBUTE *template,
99 CK_ULONG count);
100
101 CK_RV p11_kit_iter_load_attributes (P11KitIter *iter,
102 CK_ATTRIBUTE *template,
103 CK_ULONG count);
104
105 CK_SESSION_HANDLE p11_kit_iter_keep_session (P11KitIter *iter);
106
107 CK_RV p11_kit_iter_destroy_object (P11KitIter *iter);
108
109 #endif /* P11_KIT_FUTURE_UNSTABLE_API */
110
111 #ifdef __cplusplus
112 } /* extern "C" */
113 #endif
114
115 #endif /* P11_KIT_ITER_H */