1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
|
/* GIO - GLib Input, Output and Streaming Library
*
* Copyright (C) 2014 Руслан Ижбулатов <lrn1986@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef __G_WIN32_REGISTRY_KEY_H__
#define __G_WIN32_REGISTRY_KEY_H__
#include <gio/gio.h>
#ifdef G_PLATFORM_WIN32
G_BEGIN_DECLS
#define G_TYPE_WIN32_REGISTRY_KEY (g_win32_registry_key_get_type ())
#define G_WIN32_REGISTRY_KEY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_WIN32_REGISTRY_KEY, GWin32RegistryKey))
#define G_WIN32_REGISTRY_KEY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G_TYPE_WIN32_REGISTRY_KEY, GWin32RegistryKeyClass))
#define G_IS_WIN32_REGISTRY_KEY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_WIN32_REGISTRY_KEY))
#define G_IS_WIN32_REGISTRY_KEY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G_TYPE_WIN32_REGISTRY_KEY))
#define G_WIN32_REGISTRY_KEY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_WIN32_REGISTRY_KEY, GWin32RegistryKeyClass))
typedef enum {
G_WIN32_REGISTRY_VALUE_NONE = 0,
G_WIN32_REGISTRY_VALUE_BINARY = 1,
G_WIN32_REGISTRY_VALUE_UINT32LE = 2,
G_WIN32_REGISTRY_VALUE_UINT32BE = 3,
#if G_BYTE_ORDER == G_BIG_ENDIAN
G_WIN32_REGISTRY_VALUE_UINT32 = G_WIN32_REGISTRY_VALUE_UINT32BE,
#else
G_WIN32_REGISTRY_VALUE_UINT32 = G_WIN32_REGISTRY_VALUE_UINT32LE,
#endif
G_WIN32_REGISTRY_VALUE_EXPAND_STR = 4,
G_WIN32_REGISTRY_VALUE_LINK = 5,
G_WIN32_REGISTRY_VALUE_MULTI_STR = 6,
G_WIN32_REGISTRY_VALUE_UINT64LE = 7,
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
G_WIN32_REGISTRY_VALUE_UINT64 = G_WIN32_REGISTRY_VALUE_UINT64LE,
#endif
G_WIN32_REGISTRY_VALUE_STR = 8
} GWin32RegistryValueType;
typedef enum {
G_WIN32_REGISTRY_WATCH_NAME = 1 << 0,
G_WIN32_REGISTRY_WATCH_ATTRIBUTES = 1 << 1,
G_WIN32_REGISTRY_WATCH_VALUES = 1 << 2,
G_WIN32_REGISTRY_WATCH_SECURITY = 1 << 3,
} GWin32RegistryKeyWatcherFlags;
typedef struct _GWin32RegistryKey GWin32RegistryKey;
typedef struct _GWin32RegistryKeyClass GWin32RegistryKeyClass;
typedef struct _GWin32RegistryKeyPrivate GWin32RegistryKeyPrivate;
typedef struct _GWin32RegistrySubkeyIter GWin32RegistrySubkeyIter;
typedef struct _GWin32RegistryValueIter GWin32RegistryValueIter;
struct _GWin32RegistryKey {
GObject parent_instance;
/*< private >*/
GWin32RegistryKeyPrivate *priv;
};
struct _GWin32RegistryKeyClass {
GObjectClass parent_class;
};
/**
* GWin32RegistryKeyWatchCallbackFunc:
* @key: A #GWin32RegistryKey that was watched.
* @user_data: The @user_data #gpointer passed to g_win32_registry_key_watch().
*
* The type of the callback passed to g_win32_registry_key_watch().
*
* The callback is invoked after a change matching the watch flags and arguments
* occurs. If the children of the key were watched also, there is no way to know
* which one of them triggered the callback.
*
* Since: 2.42
*/
typedef void (*GWin32RegistryKeyWatchCallbackFunc) (GWin32RegistryKey *key,
gpointer user_data);
#define G_TYPE_WIN32_REGISTRY_SUBKEY_ITER (g_win32_registry_subkey_iter_get_type ())
struct _GWin32RegistrySubkeyIter {
/*< private >*/
GWin32RegistryKey *key;
gint counter;
gint subkey_count;
gunichar2 *subkey_name;
gsize subkey_name_size;
gsize subkey_name_len;
gchar *subkey_name_u8;
};
#define G_TYPE_WIN32_REGISTRY_VALUE_ITER (g_win32_registry_value_iter_get_type ())
struct _GWin32RegistryValueIter {
/*< private >*/
GWin32RegistryKey *key;
gint counter;
gint value_count;
gunichar2 *value_name;
gsize value_name_size;
gsize value_name_len;
GWin32RegistryValueType value_type;
guint8 *value_data;
gsize value_data_size;
gsize value_actual_data_size;
GWin32RegistryValueType value_expanded_type;
gunichar2 *value_data_expanded;
gsize value_data_expanded_charsize;
gchar *value_name_u8;
gsize value_name_u8_len;
gchar *value_data_u8;
gsize value_data_u8_size;
gchar *value_data_expanded_u8;
gsize value_data_expanded_u8_size;
};
GLIB_AVAILABLE_IN_2_46
GWin32RegistrySubkeyIter *g_win32_registry_subkey_iter_copy (const GWin32RegistrySubkeyIter *iter);
GLIB_AVAILABLE_IN_2_46
void g_win32_registry_subkey_iter_free (GWin32RegistrySubkeyIter *iter);
GLIB_AVAILABLE_IN_2_46
void g_win32_registry_subkey_iter_assign (GWin32RegistrySubkeyIter *iter,
const GWin32RegistrySubkeyIter *other);
GLIB_AVAILABLE_IN_2_46
GType g_win32_registry_subkey_iter_get_type (void) G_GNUC_CONST;
GLIB_AVAILABLE_IN_2_46
GWin32RegistryValueIter *g_win32_registry_value_iter_copy (const GWin32RegistryValueIter *iter);
GLIB_AVAILABLE_IN_2_46
void g_win32_registry_value_iter_free (GWin32RegistryValueIter *iter);
GLIB_AVAILABLE_IN_2_46
void g_win32_registry_value_iter_assign (GWin32RegistryValueIter *iter,
const GWin32RegistryValueIter *other);
GLIB_AVAILABLE_IN_2_46
GType g_win32_registry_value_iter_get_type (void) G_GNUC_CONST;
GLIB_AVAILABLE_IN_2_46
GType g_win32_registry_key_get_type (void);
GLIB_AVAILABLE_IN_2_46
GWin32RegistryKey *g_win32_registry_key_new (const gchar *path,
GError **error);
GLIB_AVAILABLE_IN_2_46
GWin32RegistryKey *g_win32_registry_key_new_w (const gunichar2 *path,
GError **error);
GLIB_AVAILABLE_IN_2_46
GWin32RegistryKey *g_win32_registry_key_get_child (GWin32RegistryKey *key,
const gchar *subkey,
GError **error);
GLIB_AVAILABLE_IN_2_46
GWin32RegistryKey *g_win32_registry_key_get_child_w (GWin32RegistryKey *key,
const gunichar2 *subkey,
GError **error);
GLIB_AVAILABLE_IN_2_46
gboolean g_win32_registry_subkey_iter_init (GWin32RegistrySubkeyIter *iter,
GWin32RegistryKey *key,
GError **error);
GLIB_AVAILABLE_IN_2_46
void g_win32_registry_subkey_iter_clear (GWin32RegistrySubkeyIter *iter);
GLIB_AVAILABLE_IN_2_46
gsize g_win32_registry_subkey_iter_n_subkeys (GWin32RegistrySubkeyIter *iter);
GLIB_AVAILABLE_IN_2_46
gboolean g_win32_registry_subkey_iter_next (GWin32RegistrySubkeyIter *iter,
gboolean skip_errors,
GError **error);
GLIB_AVAILABLE_IN_2_46
gboolean g_win32_registry_subkey_iter_get_name (GWin32RegistrySubkeyIter *iter,
const gchar **subkey_name,
gsize *subkey_name_len,
GError **error);
GLIB_AVAILABLE_IN_2_46
gboolean g_win32_registry_subkey_iter_get_name_w (GWin32RegistrySubkeyIter *iter,
const gunichar2 **subkey_name,
gsize *subkey_name_len,
GError **error);
GLIB_AVAILABLE_IN_2_46
gboolean g_win32_registry_value_iter_init (GWin32RegistryValueIter *iter,
GWin32RegistryKey *key,
GError **error);
GLIB_AVAILABLE_IN_2_46
void g_win32_registry_value_iter_clear (GWin32RegistryValueIter *iter);
GLIB_AVAILABLE_IN_2_46
gsize g_win32_registry_value_iter_n_values (GWin32RegistryValueIter *iter);
GLIB_AVAILABLE_IN_2_46
gboolean g_win32_registry_value_iter_next (GWin32RegistryValueIter *iter,
gboolean skip_errors,
GError **error);
GLIB_AVAILABLE_IN_2_46
gboolean g_win32_registry_value_iter_get_value_type (GWin32RegistryValueIter *iter,
GWin32RegistryValueType *value_type,
GError **error);
GLIB_AVAILABLE_IN_2_46
gboolean g_win32_registry_value_iter_get_name (GWin32RegistryValueIter *iter,
gchar **value_name,
gsize *value_name_len,
GError **error);
GLIB_AVAILABLE_IN_2_46
gboolean g_win32_registry_value_iter_get_name_w (GWin32RegistryValueIter *iter,
gunichar2 **value_name,
gsize *value_name_len,
GError **error);
GLIB_AVAILABLE_IN_2_46
gboolean g_win32_registry_value_iter_get_data (GWin32RegistryValueIter *iter,
gboolean auto_expand,
gpointer *value_data,
gsize *value_data_size,
GError **error);
GLIB_AVAILABLE_IN_2_46
gboolean g_win32_registry_value_iter_get_data_w (GWin32RegistryValueIter *iter,
gboolean auto_expand,
gpointer *value_data,
gsize *value_data_size,
GError **error);
GLIB_AVAILABLE_IN_2_66
gboolean g_win32_registry_key_get_value (GWin32RegistryKey *key,
const gchar * const *mui_dll_dirs,
gboolean auto_expand,
const gchar *value_name,
GWin32RegistryValueType *value_type,
gpointer *value_data,
gsize *value_data_size,
GError **error);
GLIB_AVAILABLE_IN_2_66
gboolean g_win32_registry_key_get_value_w (GWin32RegistryKey *key,
const gunichar2 * const *mui_dll_dirs,
gboolean auto_expand,
const gunichar2 *value_name,
GWin32RegistryValueType *value_type,
gpointer *value_data,
gsize *value_data_size,
GError **error);
GLIB_AVAILABLE_IN_2_46
const gchar *g_win32_registry_key_get_path (GWin32RegistryKey *key);
GLIB_AVAILABLE_IN_2_46
const gunichar2 *g_win32_registry_key_get_path_w (GWin32RegistryKey *key);
GLIB_AVAILABLE_IN_2_46
gboolean g_win32_registry_key_watch (GWin32RegistryKey *key,
gboolean watch_children,
GWin32RegistryKeyWatcherFlags watch_flags,
GWin32RegistryKeyWatchCallbackFunc callback,
gpointer user_data,
GError **error);
GLIB_AVAILABLE_IN_2_46
gboolean g_win32_registry_key_has_changed (GWin32RegistryKey *key);
GLIB_AVAILABLE_IN_2_46
void g_win32_registry_key_erase_change_indicator (GWin32RegistryKey *key);
GLIB_AVAILABLE_IN_2_66
const gunichar2 * const *g_win32_registry_get_os_dirs_w (void);
GLIB_AVAILABLE_IN_2_66
const gchar * const *g_win32_registry_get_os_dirs (void);
G_END_DECLS
#endif /* G_PLATFORM_WIN32 */
#endif /* __G_WIN32_REGISTRY_KEY_H__ */
|