~noskcaj/ubuntu/vivid/gnome-keyring/3.15.90

« back to all changes in this revision

Viewing changes to gck/gck-private.h

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach
  • Date: 2012-05-14 22:13:02 UTC
  • mfrom: (1.3.1)
  • mto: (80.2.8 experimental) (1.1.77)
  • mto: This revision was merged to the branch mainline in revision 148.
  • Revision ID: package-import@ubuntu.com-20120514221302-0l3gjmqpe6xopond
ImportĀ upstreamĀ versionĀ 3.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2
 
/* gck-private.h - the GObject PKCS#11 wrapper library
3
 
 
4
 
   Copyright (C) 2008, Stefan Walter
5
 
 
6
 
   The Gnome Keyring Library is free software; you can redistribute it and/or
7
 
   modify it under the terms of the GNU Library General Public License as
8
 
   published by the Free Software Foundation; either version 2 of the
9
 
   License, or (at your option) any later version.
10
 
 
11
 
   The Gnome Keyring Library is distributed in the hope that it will be useful,
12
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 
   Library General Public License for more details.
15
 
 
16
 
   You should have received a copy of the GNU Library General Public
17
 
   License along with the Gnome Library; see the file COPYING.LIB.  If not,
18
 
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
 
   Boston, MA 02111-1307, USA.
20
 
 
21
 
   Author: Stef Walter <nielsen@memberwebs.com>
22
 
*/
23
 
 
24
 
#ifndef GCK_PRIVATE_H_
25
 
#define GCK_PRIVATE_H_
26
 
 
27
 
#include "gck.h"
28
 
 
29
 
#include <glib.h>
30
 
#include <glib-object.h>
31
 
#include <gio/gio.h>
32
 
 
33
 
G_BEGIN_DECLS
34
 
 
35
 
/* ---------------------------------------------------------------------------
36
 
 * ATTRIBUTE INTERNALS
37
 
 */
38
 
 
39
 
void                _gck_attributes_lock                   (GckAttributes *attrs);
40
 
 
41
 
void                _gck_attributes_unlock                 (GckAttributes *attrs);
42
 
 
43
 
CK_ATTRIBUTE_PTR    _gck_attributes_prepare_in             (GckAttributes *attrs,
44
 
                                                             CK_ULONG_PTR n_attrs);
45
 
 
46
 
CK_ATTRIBUTE_PTR    _gck_attributes_commit_in              (GckAttributes *attrs,
47
 
                                                             CK_ULONG_PTR n_attrs);
48
 
 
49
 
CK_ATTRIBUTE_PTR    _gck_attributes_commit_out             (GckAttributes *attrs,
50
 
                                                             CK_ULONG_PTR n_attrs);
51
 
 
52
 
/* ----------------------------------------------------------------------------
53
 
 * MISC
54
 
 */
55
 
 
56
 
guint               _gck_ulong_hash                        (gconstpointer v);
57
 
 
58
 
gboolean            _gck_ulong_equal                       (gconstpointer v1,
59
 
                                                             gconstpointer v2);
60
 
 
61
 
/* ----------------------------------------------------------------------------
62
 
 * MODULE
63
 
 */
64
 
 
65
 
gboolean            _gck_module_fire_authenticate_slot     (GckModule *module,
66
 
                                                             GckSlot *slot,
67
 
                                                             gchar *label,
68
 
                                                             gchar **password);
69
 
 
70
 
gboolean            _gck_module_fire_authenticate_object   (GckModule *module,
71
 
                                                             GckObject *object,
72
 
                                                             gchar *label,
73
 
                                                             gchar **password);
74
 
 
75
 
gboolean            _gck_module_info_match                  (GckModuleInfo *match,
76
 
                                                             GckModuleInfo *module_info);
77
 
 
78
 
/* -----------------------------------------------------------------------------
79
 
 * ENUMERATOR
80
 
 */
81
 
 
82
 
GckEnumerator*      _gck_enumerator_new                     (GList *modules,
83
 
                                                             guint session_options,
84
 
                                                             GckUriInfo *uri_info);
85
 
 
86
 
/* ----------------------------------------------------------------------------
87
 
 * SLOT
88
 
 */
89
 
 
90
 
gboolean           _gck_token_info_match                    (GckTokenInfo *match,
91
 
                                                             GckTokenInfo *info);
92
 
 
93
 
/* ----------------------------------------------------------------------------
94
 
 * URI
95
 
 */
96
 
 
97
 
GckUriInfo*         _gck_uri_info_new                       (void);
98
 
 
99
 
/* ----------------------------------------------------------------------------
100
 
 * CALL
101
 
 */
102
 
 
103
 
typedef CK_RV (*GckPerformFunc) (gpointer call_data);
104
 
typedef gboolean (*GckCompleteFunc) (gpointer call_data, CK_RV result);
105
 
 
106
 
typedef struct _GckCall GckCall;
107
 
 
108
 
typedef struct _GckArguments {
109
 
        GckCall *call;
110
 
 
111
 
        /* For the call function to use */
112
 
        CK_FUNCTION_LIST_PTR pkcs11;
113
 
        CK_ULONG handle;
114
 
 
115
 
} GckArguments;
116
 
 
117
 
#define GCK_MECHANISM_EMPTY        { 0UL, NULL, 0 }
118
 
 
119
 
#define GCK_ARGUMENTS_INIT         { NULL, NULL, 0 }
120
 
 
121
 
#define GCK_TYPE_CALL             (_gck_call_get_type())
122
 
#define GCK_CALL(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), GCK_TYPE_CALL, GckCall))
123
 
#define GCK_CALL_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), GCK_TYPE_CALL, GckCall))
124
 
#define GCK_IS_CALL(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), GCK_TYPE_CALL))
125
 
#define GCK_IS_CALL_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), GCK_TYPE_CALL))
126
 
#define GCK_CALL_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), GCK_TYPE_CALL, GckCallClass))
127
 
 
128
 
typedef struct _GckCallClass GckCallClass;
129
 
 
130
 
GType              _gck_call_get_type                    (void) G_GNUC_CONST;
131
 
 
132
 
#define            _gck_call_arguments(call, type)       (type*)(_gck_call_get_arguments (GCK_CALL (call)))
133
 
 
134
 
gpointer           _gck_call_get_arguments               (GckCall *call);
135
 
 
136
 
void               _gck_call_uninitialize                (void);
137
 
 
138
 
gboolean           _gck_call_sync                        (gpointer object,
139
 
                                                           gpointer perform,
140
 
                                                           gpointer complete,
141
 
                                                           gpointer args,
142
 
                                                           GCancellable *cancellable,
143
 
                                                           GError **err);
144
 
 
145
 
gpointer           _gck_call_async_prep                  (gpointer object,
146
 
                                                           gpointer cb_object,
147
 
                                                           gpointer perform,
148
 
                                                           gpointer complete,
149
 
                                                           gsize args_size,
150
 
                                                           gpointer destroy_func);
151
 
 
152
 
GckCall*          _gck_call_async_ready                 (gpointer args,
153
 
                                                           GCancellable *cancellable,
154
 
                                                           GAsyncReadyCallback callback,
155
 
                                                           gpointer user_data);
156
 
 
157
 
void               _gck_call_async_go                    (GckCall *call);
158
 
 
159
 
void               _gck_call_async_ready_go              (gpointer args,
160
 
                                                           GCancellable *cancellable,
161
 
                                                           GAsyncReadyCallback callback,
162
 
                                                           gpointer user_data);
163
 
 
164
 
void               _gck_call_async_short                 (GckCall *call,
165
 
                                                           CK_RV rv);
166
 
 
167
 
gboolean           _gck_call_basic_finish                (GAsyncResult *result,
168
 
                                                           GError **err);
169
 
 
170
 
void               _gck_call_async_object                (GckCall *call,
171
 
                                                           gpointer object);
172
 
 
173
 
#endif /* GCK_PRIVATE_H_ */