3 * Copyright (C) 2006-2009 Jürg Billeter
4 * Copyright (C) 2006-2008 Raffaele Sandrini
5 * Copyright (C) 2007 Mathias Hasselmann
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 * As a special exception, if you use inline functions from this file, this
22 * file does not by itself cause the resulting executable to be covered by
23 * the GNU Lesser General Public License.
26 * Jürg Billeter <j@bitron.ch>
27 * Raffaele Sandrini <rasa@gmx.ch>
28 * Mathias Hasselmann <mathias.hasselmann@gmx.de>
32 [CCode (cname = "gboolean", cheader_filename = "glib.h", type_id = "G_TYPE_BOOLEAN", marshaller_type_name = "BOOLEAN", get_value_function = "g_value_get_boolean", set_value_function = "g_value_set_boolean", default_value = "FALSE", type_signature = "b")]
35 public string to_string () {
45 [CCode (cname = "gchar", cprefix = "g_ascii_", cheader_filename = "glib.h", type_id = "G_TYPE_CHAR", marshaller_type_name = "CHAR", get_value_function = "g_value_get_char", set_value_function = "g_value_set_char", default_value = "\'\\0\'", type_signature = "y")]
46 [IntegerType (rank = 2, min = 0, max = 127)]
48 [CCode (cname = "g_strdup_printf", instance_pos = -1)]
49 public string to_string (string format = "%c");
50 public bool isalnum ();
51 public bool isalpha ();
52 public bool iscntrl ();
53 public bool isdigit ();
54 public bool isgraph ();
55 public bool islower ();
56 public bool isprint ();
57 public bool ispunct ();
58 public bool isspace ();
59 public bool isupper ();
60 public bool isxdigit ();
61 public int digit_value ();
62 public int xdigit_value ();
63 public char tolower ();
64 public char toupper ();
66 [CCode (cname = "MIN")]
67 public static char min (char a, char b);
68 [CCode (cname = "MAX")]
69 public static char max (char a, char b);
70 [CCode (cname = "CLAMP")]
71 public char clamp (char low, char high);
75 [CCode (cname = "guchar", cheader_filename = "glib.h", type_id = "G_TYPE_UCHAR", marshaller_type_name = "UCHAR", get_value_function = "g_value_get_uchar", set_value_function = "g_value_set_uchar", default_value = "\'\\0\'")]
76 [IntegerType (rank = 3, min = 0, max = 255)]
78 [CCode (cname = "g_strdup_printf", instance_pos = -1)]
79 public string to_string (string format = "%hhu");
81 [CCode (cname = "MIN")]
82 public static uchar min (uchar a, uchar b);
83 [CCode (cname = "MAX")]
84 public static uchar max (uchar a, uchar b);
85 [CCode (cname = "CLAMP")]
86 public uchar clamp (uchar low, uchar high);
90 [CCode (cname = "gint", cheader_filename = "glib.h", type_id = "G_TYPE_INT", marshaller_type_name = "INT", get_value_function = "g_value_get_int", set_value_function = "g_value_set_int", default_value = "0", type_signature = "i")]
91 [IntegerType (rank = 6)]
93 [CCode (cname = "G_MININT")]
94 public static int MIN;
95 [CCode (cname = "G_MAXINT")]
96 public static int MAX;
98 [CCode (cname = "g_strdup_printf", instance_pos = -1)]
99 public string to_string (string format = "%i");
101 [CCode (cname = "MIN")]
102 public static int min (int a, int b);
103 [CCode (cname = "MAX")]
104 public static int max (int a, int b);
105 [CCode (cname = "CLAMP")]
106 public int clamp (int low, int high);
108 [CCode (cname = "GINT_TO_POINTER")]
109 public void* to_pointer ();
111 [CCode (cname = "abs")]
114 [CCode (cname = "GINT_TO_BE")]
115 public int to_big_endian ();
116 [CCode (cname = "GINT_TO_LE")]
117 public int to_little_endian ();
119 [CCode (cname = "GINT_FROM_BE")]
120 public static int from_big_endian (int val);
121 [CCode (cname = "GINT_FROM_LE")]
122 public static int from_little_endian (int val);
126 [CCode (cname = "guint", cheader_filename = "glib.h", type_id = "G_TYPE_UINT", marshaller_type_name = "UINT", get_value_function = "g_value_get_uint", set_value_function = "g_value_set_uint", default_value = "0U", type_signature = "u")]
127 [IntegerType (rank = 7)]
129 [CCode (cname = "0")]
130 public static uint MIN;
131 [CCode (cname = "G_MAXUINT")]
132 public static uint MAX;
134 [CCode (cname = "g_strdup_printf", instance_pos = -1)]
135 public string to_string (string format = "%u");
137 [CCode (cname = "MIN")]
138 public static uint min (uint a, uint b);
139 [CCode (cname = "MAX")]
140 public static uint max (uint a, uint b);
141 [CCode (cname = "CLAMP")]
142 public uint clamp (uint low, uint high);
144 [CCode (cname = "GUINT_TO_POINTER")]
145 public void* to_pointer ();
147 [CCode (cname = "GUINT_TO_BE")]
148 public uint to_big_endian ();
149 [CCode (cname = "GUINT_TO_LE")]
150 public uint to_little_endian ();
152 [CCode (cname = "GUINT_FROM_BE")]
153 public static uint from_big_endian (uint val);
154 [CCode (cname = "GUINT_FROM_LE")]
155 public static uint from_little_endian (uint val);
159 [CCode (cname = "gshort", cheader_filename = "glib.h", has_type_id = false, default_value = "0", type_signature = "n")]
160 [IntegerType (rank = 4, min = -32768, max = 32767)]
161 public struct short {
162 [CCode (cname = "G_MINSHORT")]
163 public static short MIN;
164 [CCode (cname = "G_MAXSHORT")]
165 public static short MAX;
167 [CCode (cname = "g_strdup_printf", instance_pos = -1)]
168 public string to_string (string format = "%hi");
170 [CCode (cname = "MIN")]
171 public static short min (short a, short b);
172 [CCode (cname = "MAX")]
173 public static short max (short a, short b);
174 [CCode (cname = "CLAMP")]
175 public short clamp (short low, short high);
179 [CCode (cname = "gushort", cheader_filename = "glib.h", has_type_id = false, default_value = "0U", type_signature = "q")]
180 [IntegerType (rank = 5, min = 0, max = 65535)]
181 public struct ushort {
182 [CCode (cname = "0U")]
183 public static ushort MIN;
184 [CCode (cname = "G_MAXUSHORT")]
185 public static ushort MAX;
187 [CCode (cname = "g_strdup_printf", instance_pos = -1)]
188 public string to_string (string format = "%hu");
190 [CCode (cname = "MIN")]
191 public static ushort min (ushort a, ushort b);
192 [CCode (cname = "MAX")]
193 public static ushort max (ushort a, ushort b);
194 [CCode (cname = "CLAMP")]
195 public ushort clamp (ushort low, ushort high);
199 [CCode (cname = "glong", cheader_filename = "glib.h", type_id = "G_TYPE_LONG", marshaller_type_name = "LONG", get_value_function = "g_value_get_long", set_value_function = "g_value_set_long", default_value = "0L")]
200 [IntegerType (rank = 8)]
202 [CCode (cname = "G_MINLONG")]
203 public static long MIN;
204 [CCode (cname = "G_MAXLONG")]
205 public static long MAX;
207 [CCode (cname = "g_strdup_printf", instance_pos = -1)]
208 public string to_string (string format = "%li");
210 [CCode (cname = "MIN")]
211 public static long min (long a, long b);
212 [CCode (cname = "MAX")]
213 public static long max (long a, long b);
214 [CCode (cname = "CLAMP")]
215 public long clamp (long low, long high);
216 [CCode (cname = "labs")]
219 [CCode (cname = "GLONG_TO_BE")]
220 public long to_big_endian ();
221 [CCode (cname = "GLONG_TO_LE")]
222 public long to_little_endian ();
224 [CCode (cname = "GLONG_FROM_BE")]
225 public static long from_big_endian (long val);
226 [CCode (cname = "GLONG_FROM_LE")]
227 public static long from_little_endian (long val);
231 [CCode (cname = "gulong", cheader_filename = "glib.h", type_id = "G_TYPE_ULONG", marshaller_type_name = "ULONG", get_value_function = "g_value_get_ulong", set_value_function = "g_value_set_ulong", default_value = "0UL")]
232 [IntegerType (rank = 9)]
233 public struct ulong {
234 [CCode (cname = "0UL")]
235 public static ulong MIN;
236 [CCode (cname = "G_MAXULONG")]
237 public static ulong MAX;
239 [CCode (cname = "g_strdup_printf", instance_pos = -1)]
240 public string to_string (string format = "%lu");
242 [CCode (cname = "MIN")]
243 public static ulong min (ulong a, ulong b);
244 [CCode (cname = "MAX")]
245 public static ulong max (ulong a, ulong b);
246 [CCode (cname = "CLAMP")]
247 public ulong clamp (ulong low, ulong high);
249 [CCode (cname = "GULONG_TO_BE")]
250 public ulong to_big_endian ();
251 [CCode (cname = "GULONG_TO_LE")]
252 public ulong to_little_endian ();
254 [CCode (cname = "GULONG_FROM_BE")]
255 public static ulong from_big_endian (ulong val);
256 [CCode (cname = "GULONG_FROM_LE")]
257 public static ulong from_little_endian (ulong val);
261 [CCode (cname = "gsize", cheader_filename = "glib.h", type_id = "G_TYPE_ULONG", marshaller_type_name = "ULONG", get_value_function = "g_value_get_ulong", set_value_function = "g_value_set_ulong", default_value = "0UL")]
262 [IntegerType (rank = 9)]
263 public struct size_t {
264 [CCode (cname = "0UL")]
265 public static ulong MIN;
266 [CCode (cname = "G_MAXSIZE")]
267 public static ulong MAX;
269 [CCode (cname = "G_GSIZE_FORMAT")]
270 public const string FORMAT;
271 [CCode (cname = "G_GSIZE_MODIFIER")]
272 public const string FORMAT_MODIFIER;
274 [CCode (cname = "g_strdup_printf", instance_pos = -1)]
275 public string to_string (string format = "%zu");
277 [CCode (cname = "GSIZE_TO_POINTER")]
278 public void* to_pointer ();
280 [CCode (cname = "MIN")]
281 public static size_t min (size_t a, size_t b);
282 [CCode (cname = "MAX")]
283 public static size_t max (size_t a, size_t b);
284 [CCode (cname = "CLAMP")]
285 public size_t clamp (size_t low, size_t high);
289 [CCode (cname = "gssize", cheader_filename = "glib.h", type_id = "G_TYPE_LONG", marshaller_type_name = "LONG", get_value_function = "g_value_get_long", set_value_function = "g_value_set_long", default_value = "0L")]
290 [IntegerType (rank = 8)]
291 public struct ssize_t {
292 [CCode (cname = "G_MINSSIZE")]
293 public static long MIN;
294 [CCode (cname = "G_MAXSSIZE")]
295 public static long MAX;
297 [CCode (cname = "G_GSSIZE_FORMAT")]
298 public const string FORMAT;
299 [CCode (cname = "G_GSIZE_MODIFIER")]
300 public const string FORMAT_MODIFIER;
302 [CCode (cname = "g_strdup_printf", instance_pos = -1)]
303 public string to_string (string format = "%zi");
305 [CCode (cname = "MIN")]
306 public static ssize_t min (ssize_t a, ssize_t b);
307 [CCode (cname = "MAX")]
308 public static ssize_t max (ssize_t a, ssize_t b);
309 [CCode (cname = "CLAMP")]
310 public ssize_t clamp (ssize_t low, ssize_t high);
314 [CCode (cname = "gint8", cheader_filename = "glib.h", type_id = "G_TYPE_CHAR", marshaller_type_name = "CHAR", get_value_function = "g_value_get_char", set_value_function = "g_value_set_char", default_value = "0", type_signature = "y")]
315 [IntegerType (rank = 1, min = -128, max = 127)]
317 [CCode (cname = "G_MININT8")]
318 public static int8 MIN;
319 [CCode (cname = "G_MAXINT8")]
320 public static int8 MAX;
322 [CCode (cname = "g_strdup_printf", instance_pos = -1)]
323 public string to_string (string format = "%hhi");
325 [CCode (cname = "MIN")]
326 public static int8 min (int8 a, int8 b);
327 [CCode (cname = "MAX")]
328 public static int8 max (int8 a, int8 b);
329 [CCode (cname = "CLAMP")]
330 public int8 clamp (int8 low, int8 high);
334 [CCode (cname = "guint8", cheader_filename = "glib.h", type_id = "G_TYPE_UCHAR", marshaller_type_name = "UCHAR", get_value_function = "g_value_get_uchar", set_value_function = "g_value_set_uchar", default_value = "0U", type_signature = "y")]
335 [IntegerType (rank = 3, min = 0, max = 255)]
336 public struct uint8 {
337 [CCode (cname = "0U")]
338 public static uint8 MIN;
339 [CCode (cname = "G_MAXUINT8")]
340 public static uint8 MAX;
342 [CCode (cname = "g_strdup_printf", instance_pos = -1)]
343 public string to_string (string format = "%hhu");
345 [CCode (cname = "MIN")]
346 public static uint8 min (uint8 a, uint8 b);
347 [CCode (cname = "MAX")]
348 public static uint8 max (uint8 a, uint8 b);
349 [CCode (cname = "CLAMP")]
350 public uint8 clamp (uint8 low, uint8 high);
354 [CCode (cname = "gint16", cheader_filename = "glib.h", default_value = "0", type_signature = "n")]
355 [IntegerType (rank = 4, min = -32768, max = 32767)]
356 public struct int16 {
357 [CCode (cname = "G_MININT16")]
358 public static int16 MIN;
359 [CCode (cname = "G_MAXINT16")]
360 public static int16 MAX;
362 [CCode (cname = "G_GINT16_FORMAT")]
363 public const string FORMAT;
364 [CCode (cname = "G_GINT16_MODIFIER")]
365 public const string FORMAT_MODIFIER;
367 [CCode (cname = "g_strdup_printf", instance_pos = -1)]
368 public string to_string (string format = "%hi");
370 [CCode (cname = "MIN")]
371 public static int16 min (int16 a, int16 b);
372 [CCode (cname = "MAX")]
373 public static int16 max (int16 a, int16 b);
374 [CCode (cname = "CLAMP")]
375 public int16 clamp (int16 low, int16 high);
377 [CCode (cname = "GINT16_TO_BE")]
378 public int16 to_big_endian ();
379 [CCode (cname = "GINT16_TO_LE")]
380 public int16 to_little_endian ();
382 [CCode (cname = "GINT16_FROM_BE")]
383 public static int16 from_big_endian (int16 val);
384 [CCode (cname = "GINT16_FROM_LE")]
385 public static int16 from_little_endian (int16 val);
389 [CCode (cname = "guint16", cheader_filename = "glib.h", default_value = "0U", type_signature = "q")]
390 [IntegerType (rank = 5, min = 0, max = 65535)]
391 public struct uint16 {
392 [CCode (cname = "0U")]
393 public static uint16 MIN;
394 [CCode (cname = "G_MAXUINT16")]
395 public static uint16 MAX;
397 [CCode (cname = "G_GUINT16_FORMAT")]
398 public const string FORMAT;
399 [CCode (cname = "G_GINT16_MODIFIER")]
400 public const string FORMAT_MODIFIER;
402 [CCode (cname = "g_strdup_printf", instance_pos = -1)]
403 public string to_string (string format = "%hu");
405 [CCode (cname = "MIN")]
406 public static uint16 min (uint16 a, uint16 b);
407 [CCode (cname = "MAX")]
408 public static uint16 max (uint16 a, uint16 b);
409 [CCode (cname = "CLAMP")]
410 public uint16 clamp (uint16 low, uint16 high);
412 [CCode (cname = "GUINT16_TO_BE")]
413 public uint16 to_big_endian ();
414 [CCode (cname = "GUINT16_TO_LE")]
415 public uint16 to_little_endian ();
417 [CCode (cname = "GUINT16_FROM_BE")]
418 public static uint16 from_big_endian (uint16 val);
419 [CCode (cname = "GUINT16_FROM_LE")]
420 public static uint16 from_little_endian (uint16 val);
424 [CCode (cname = "gint32", cheader_filename = "glib.h", type_id = "G_TYPE_INT", marshaller_type_name = "INT", get_value_function = "g_value_get_int", set_value_function = "g_value_set_int", default_value = "0", type_signature = "i")]
425 [IntegerType (rank = 6)]
426 public struct int32 {
427 [CCode (cname = "G_MININT32")]
428 public static int32 MIN;
429 [CCode (cname = "G_MAXINT32")]
430 public static int32 MAX;
432 [CCode (cname = "G_GINT32_FORMAT")]
433 public const string FORMAT;
434 [CCode (cname = "G_GINT32_MODIFIER")]
435 public const string FORMAT_MODIFIER;
437 [CCode (cname = "g_strdup_printf", instance_pos = -1)]
438 public string to_string (string format = "%i");
440 [CCode (cname = "MIN")]
441 public static int32 min (int32 a, int32 b);
442 [CCode (cname = "MAX")]
443 public static int32 max (int32 a, int32 b);
444 [CCode (cname = "CLAMP")]
445 public int32 clamp (int32 low, int32 high);
447 [CCode (cname = "GINT32_TO_BE")]
448 public int32 to_big_endian ();
449 [CCode (cname = "GINT32_TO_LE")]
450 public int32 to_little_endian ();
452 [CCode (cname = "GINT32_FROM_BE")]
453 public static int32 from_big_endian (int32 val);
454 [CCode (cname = "GINT32_FROM_LE")]
455 public static int32 from_little_endian (int32 val);
459 [CCode (cname = "guint32", cheader_filename = "glib.h", type_id = "G_TYPE_UINT", marshaller_type_name = "UINT", get_value_function = "g_value_get_uint", set_value_function = "g_value_set_uint", default_value = "0U", type_signature = "u")]
460 [IntegerType (rank = 7)]
461 public struct uint32 {
462 [CCode (cname = "0U")]
463 public static uint32 MIN;
464 [CCode (cname = "G_MAXUINT32")]
465 public static uint32 MAX;
467 [CCode (cname = "G_GUINT32_FORMAT")]
468 public const string FORMAT;
469 [CCode (cname = "G_GINT32_MODIFIER")]
470 public const string FORMAT_MODIFIER;
472 [CCode (cname = "g_strdup_printf", instance_pos = -1)]
473 public string to_string (string format = "%u");
475 [CCode (cname = "MIN")]
476 public static uint32 min (uint32 a, uint32 b);
477 [CCode (cname = "MAX")]
478 public static uint32 max (uint32 a, uint32 b);
479 [CCode (cname = "CLAMP")]
480 public uint32 clamp (uint32 low, uint32 high);
482 [CCode (cname = "GUINT32_TO_BE")]
483 public uint32 to_big_endian ();
484 [CCode (cname = "GUINT32_TO_LE")]
485 public uint32 to_little_endian ();
487 [CCode (cname = "GUINT32_FROM_BE")]
488 public static uint32 from_big_endian (uint32 val);
489 [CCode (cname = "GUINT32_FROM_LE")]
490 public static uint32 from_little_endian (uint32 val);
494 [CCode (cname = "gint64", cheader_filename = "glib.h", type_id = "G_TYPE_INT64", marshaller_type_name = "INT64", get_value_function = "g_value_get_int64", set_value_function = "g_value_set_int64", default_value = "0LL", type_signature = "x")]
495 [IntegerType (rank = 10)]
496 public struct int64 {
497 [CCode (cname = "G_MININT64")]
498 public static int64 MIN;
499 [CCode (cname = "G_MAXINT64")]
500 public static int64 MAX;
502 [CCode (cname = "G_GINT64_FORMAT")]
503 public const string FORMAT;
504 [CCode (cname = "G_GINT64_MODIFIER")]
505 public const string FORMAT_MODIFIER;
507 [CCode (cname = "g_strdup_printf", instance_pos = -1)]
508 public string to_string (string format = "%lli");
510 [CCode (cname = "MIN")]
511 public static int64 min (int64 a, int64 b);
512 [CCode (cname = "MAX")]
513 public static int64 max (int64 a, int64 b);
514 [CCode (cname = "CLAMP")]
515 public int64 clamp (int64 low, int64 high);
516 [CCode (cname = "llabs")]
519 [CCode (cname = "GINT64_TO_BE")]
520 public int64 to_big_endian ();
521 [CCode (cname = "GINT64_TO_LE")]
522 public int64 to_little_endian ();
524 [CCode (cname = "GINT64_FROM_BE")]
525 public static int64 from_big_endian (int64 val);
526 [CCode (cname = "GINT64_FROM_LE")]
527 public static int64 from_little_endian (int64 val);
531 [CCode (cname = "guint64", cheader_filename = "glib.h", type_id = "G_TYPE_UINT64", marshaller_type_name = "UINT64", get_value_function = "g_value_get_uint64", set_value_function = "g_value_set_uint64", default_value = "0ULL", type_signature = "t")]
532 [IntegerType (rank = 11)]
533 public struct uint64 {
534 [CCode (cname = "0ULL")]
535 public static uint64 MIN;
536 [CCode (cname = "G_MAXUINT64")]
537 public static uint64 MAX;
539 [CCode (cname = "G_GUINT64_FORMAT")]
540 public const string FORMAT;
541 [CCode (cname = "G_GINT64_MODIFIER")]
542 public const string FORMAT_MODIFIER;
544 [CCode (cname = "g_strdup_printf", instance_pos = -1)]
545 public string to_string (string format = "%llu");
547 [CCode (cname = "MIN")]
548 public static uint64 min (uint64 a, uint64 b);
549 [CCode (cname = "MAX")]
550 public static uint64 max (uint64 a, uint64 b);
551 [CCode (cname = "CLAMP")]
552 public uint64 clamp (uint64 low, uint64 high);
554 [CCode (cname = "GUINT64_TO_BE")]
555 public uint64 to_big_endian ();
556 [CCode (cname = "GUINT64_TO_LE")]
557 public uint64 to_little_endian ();
559 [CCode (cname = "GUINT64_FROM_BE")]
560 public static uint64 from_big_endian (uint64 val);
561 [CCode (cname = "GUINT64_FROM_LE")]
562 public static uint64 from_little_endian (uint64 val);
566 [CCode (cname = "float", cheader_filename = "glib.h,float.h,math.h", type_id = "G_TYPE_FLOAT", marshaller_type_name = "FLOAT", get_value_function = "g_value_get_float", set_value_function = "g_value_set_float", default_value = "0.0F")]
567 [FloatingType (rank = 1)]
568 public struct float {
569 [CCode (cname = "FLT_MANT_DIG")]
570 public static int MANT_DIG;
571 [CCode (cname = "FLT_DIG")]
572 public static int DIG;
574 [CCode (cname = "FLT_MIN_EXP")]
575 public static int MIN_EXP;
576 [CCode (cname = "FLT_MAX_EXP")]
577 public static int MAX_EXP;
579 [CCode (cname = "FLT_MIN_10_EXP")]
580 public static int MIN_10_EXP;
581 [CCode (cname = "FLT_MAX_10_EXP")]
582 public static int MAX_10_EXP;
584 [CCode (cname = "FLT_EPSILON")]
585 public static float EPSILON;
586 [CCode (cname = "FLT_MIN")]
587 public static float MIN;
588 [CCode (cname = "FLT_MAX")]
589 public static float MAX;
591 [CCode (cname = "NAN")]
592 public static float NAN;
593 [CCode (cname = "INFINITY")]
594 public static float INFINITY;
596 [CCode (cname = "isnan")]
597 public bool is_nan ();
598 [CCode (cname = "isfinite")]
599 public bool is_finite ();
600 [CCode (cname = "isnormal")]
601 public bool is_normal ();
602 [CCode (cname = "isinf")]
603 public int is_infinity ();
605 [CCode (cname = "g_strdup_printf", instance_pos = -1)]
606 public string to_string (string format = "%g");
608 [CCode (cname = "MIN")]
609 public static float min (float a, float b);
610 [CCode (cname = "MAX")]
611 public static float max (float a, float b);
612 [CCode (cname = "CLAMP")]
613 public float clamp (float low, float high);
617 [CCode (cname = "double", cheader_filename = "glib.h,float.h,math.h", type_id = "G_TYPE_DOUBLE", marshaller_type_name = "DOUBLE", get_value_function = "g_value_get_double", set_value_function = "g_value_set_double", default_value = "0.0", type_signature = "d")]
618 [FloatingType (rank = 2)]
619 public struct double {
620 [CCode (cname = "DBL_MANT_DIG")]
621 public static int MANT_DIG;
622 [CCode (cname = "DBL_DIG")]
623 public static int DIG;
625 [CCode (cname = "DBL_MIN_EXP")]
626 public static int MIN_EXP;
627 [CCode (cname = "DBL_MAX_EXP")]
628 public static int MAX_EXP;
630 [CCode (cname = "DBL_MIN_10_EXP")]
631 public static int MIN_10_EXP;
632 [CCode (cname = "DBL_MAX_10_EXP")]
633 public static int MAX_10_EXP;
635 [CCode (cname = "DBL_EPSILON")]
636 public static double EPSILON;
637 [CCode (cname = "DBL_MIN")]
638 public static double MIN;
639 [CCode (cname = "DBL_MAX")]
640 public static double MAX;
642 [CCode (cname = "((double) NAN)")]
643 public static double NAN;
644 [CCode (cname = "((double) INFINITY)")]
645 public static double INFINITY;
647 [CCode (cname = "isnan")]
648 public bool is_nan ();
649 [CCode (cname = "isfinite")]
650 public bool is_finite ();
651 [CCode (cname = "isnormal")]
652 public bool is_normal ();
653 [CCode (cname = "isinf")]
654 public int is_infinity ();
656 [CCode (cname = "MIN")]
657 public static double min (double a, double b);
658 [CCode (cname = "MAX")]
659 public static double max (double a, double b);
660 [CCode (cname = "CLAMP")]
661 public double clamp (double low, double high);
663 [CCode (cname = "G_ASCII_DTOSTR_BUF_SIZE")]
664 public const int DTOSTR_BUF_SIZE;
665 [CCode (cname = "g_ascii_dtostr", instance_pos = -1)]
666 public weak string to_str (char[] buffer);
667 [CCode (cname = "g_ascii_formatd", instance_pos = -1)]
668 public weak string format (char[] buffer, string format = "%g");
670 public string to_string () {
671 return this.to_str(new char[DTOSTR_BUF_SIZE]);
675 [CCode (cheader_filename = "time.h", has_type_id = false)]
676 [IntegerType (rank = 8)]
677 public struct time_t {
678 [CCode (cname = "time")]
679 public time_t (out time_t result = null);
683 [CCode (cname = "gunichar", cprefix = "g_unichar_", cheader_filename = "glib.h", type_id = "G_TYPE_UINT", marshaller_type_name = "UINT", get_value_function = "g_value_get_uint", set_value_function = "g_value_set_uint", default_value = "0U", type_signature = "u")]
684 [IntegerType (rank = 7)]
685 public struct unichar {
686 public bool validate ();
687 public bool isalnum ();
688 public bool isalpha ();
689 public bool iscntrl ();
690 public bool isdigit ();
691 public bool isgraph ();
692 public bool islower ();
693 public bool isprint ();
694 public bool ispunct ();
695 public bool isspace ();
696 public bool isupper ();
697 public bool isxdigit ();
698 public bool istitle ();
699 public bool isdefined ();
700 public bool iswide ();
701 public bool iswide_cjk ();
702 public bool iszerowidth ();
703 public unichar toupper ();
704 public unichar tolower ();
705 public unichar totitle ();
706 public int digit_value ();
707 public int xdigit_value ();
708 public UnicodeType type ();
709 public UnicodeBreakType break_type ();
711 public int to_utf8 (string? outbuf);
713 [CCode (cname = "MIN")]
714 public static unichar min (unichar a, unichar b);
715 [CCode (cname = "MAX")]
716 public static unichar max (unichar a, unichar b);
717 [CCode (cname = "CLAMP")]
718 public unichar clamp (unichar low, unichar high);
721 [CCode (cname = "GUnicodeType", cprefix = "G_UNICODE_", has_type_id = false)]
722 public enum UnicodeType {
755 [CCode (cname = "GUnicodeBreakType", cprefix = "G_UNICODE_BREAK_", has_type_id = false)]
756 public enum UnicodeBreakType {
795 [CCode (cname = "GNormalizeMode", cprefix = "G_NORMALIZE_", has_type_id = false)]
796 public enum NormalizeMode {
810 [CCode (cname = "char", const_cname = "const char", copy_function = "g_strdup", free_function = "g_free", cheader_filename = "stdlib.h,string.h,glib.h", type_id = "G_TYPE_STRING", marshaller_type_name = "STRING", param_spec_function = "g_param_spec_string", get_value_function = "g_value_get_string", set_value_function = "g_value_set_string", type_signature = "s")]
811 public class string {
812 [CCode (cname = "strstr")]
813 public weak string? str (string needle);
814 [CCode (cname = "g_str_has_prefix")]
815 public bool has_prefix (string prefix);
816 [CCode (cname = "g_str_has_suffix")]
817 public bool has_suffix (string suffix);
818 [CCode (cname = "g_strdup_printf"), PrintfFormat]
819 public string printf (...);
820 [CCode (cname = "sscanf", cheader_filename = "stdio.h"), ScanfFormat]
821 public int scanf (...);
822 [CCode (cname = "g_strconcat")]
823 public string concat (string string2, ...);
824 [CCode (cname = "g_strescape")]
825 public string escape (string exceptions);
826 [CCode (cname = "g_strcompress")]
827 public string compress ();
828 [CCode (cname = "g_strsplit", array_length = false, array_null_terminated = true)]
830 public string[] split (string delimiter, int max_tokens = 0);
831 [CCode (cname = "g_strsplit_set", array_length = false, array_null_terminated = true)]
832 public string[] split_set (string delimiters, int max_tokens = 0);
833 [CCode (cname = "g_strjoinv")]
835 public static string joinv (string separator, [CCode (array_length = false, array_null_terminated = true)] string[] str_array);
836 [CCode (cname = "g_strjoin")]
837 public static string join (string separator, ...);
838 [CCode (cname = "g_strnfill")]
839 public static string nfill (size_t length, char fill_char);
841 [CCode (cname = "g_utf8_next_char")]
842 public weak string next_char ();
843 [CCode (cname = "g_utf8_get_char")]
844 public unichar get_char ();
845 [CCode (cname = "g_utf8_get_char_validated")]
846 public unichar get_char_validated (long max_len = -1);
847 [CCode (cname = "g_utf8_offset_to_pointer")]
849 public weak string offset (long offset);
850 [CCode (cname = "g_utf8_pointer_to_offset")]
851 public long pointer_to_offset (string pos);
852 [CCode (cname = "g_utf8_prev_char")]
853 public weak string prev_char ();
854 [CCode (cname = "g_utf8_strlen")]
855 public long len (ssize_t max = -1);
856 [CCode (cname = "g_utf8_strchr")]
857 public weak string chr (ssize_t len, unichar c);
858 [CCode (cname = "g_utf8_strrchr")]
859 public weak string rchr (ssize_t len, unichar c);
860 [CCode (cname = "g_utf8_strreverse")]
861 public string reverse (ssize_t len = -1);
862 [CCode (cname = "g_utf8_validate")]
863 public bool validate (ssize_t max_len = -1, out string end = null);
864 [CCode (cname = "g_utf8_normalize")]
865 public string normalize (ssize_t len = -1, NormalizeMode mode = NormalizeMode.DEFAULT);
867 [CCode (cname = "g_utf8_strup")]
868 public string up (ssize_t len = -1);
869 [CCode (cname = "g_utf8_strdown")]
870 public string down (ssize_t len = -1);
871 [CCode (cname = "g_utf8_casefold")]
872 public string casefold (ssize_t len = -1);
873 [CCode (cname = "g_utf8_collate")]
874 public int collate (string str2);
876 [CCode (cname = "g_locale_to_utf8")]
877 public string locale_to_utf8 (ssize_t len, out size_t bytes_read, out size_t bytes_written, out GLib.Error error = null);
879 [CCode (cname = "g_strchomp")]
880 public weak string _chomp();
881 public string chomp () {
882 string result = this.dup ();
887 [CCode (cname = "g_strchug")]
888 public weak string _chug();
889 public string chug () {
890 string result = this.dup ();
895 [CCode (cname = "g_strstrip")]
896 public weak string _strip ();
897 public string strip () {
898 string result = this.dup ();
903 [CCode (cname = "g_strdelimit")]
904 public weak string _delimit (string delimiters, char new_delimiter);
905 public string delimit (string delimiters, char new_delimiter) {
906 string result = this.dup ();
907 result._delimit (delimiters, new_delimiter);
911 [CCode (cname = "g_str_hash")]
914 [CCode (cname = "atoi")]
915 public int to_int ();
916 [CCode (cname = "atol")]
917 public long to_long ();
918 [CCode (cname = "g_ascii_strtod")]
919 public double to_double (out weak string endptr = null);
920 [CCode (cname = "strtoul")]
921 public ulong to_ulong (out weak string endptr = null, int _base = 0);
922 [CCode (cname = "g_ascii_strtoll")]
923 public int64 to_int64 (out weak string endptr = null, int _base = 0);
924 public bool to_bool () {
925 if (this == "true") {
932 [CCode (cname = "strlen")]
933 public size_t size ();
935 [CCode (cname = "g_ascii_strcasecmp")]
936 public int ascii_casecmp (string s2);
937 [CCode (cname = "g_ascii_strncasecmp")]
938 public int ascii_ncasecmp (string s2, size_t n);
940 [CCode (cname = "g_utf8_skip")]
941 public static char[] skip;
943 /* modifies string in place */
944 [CCode (cname = "g_strcanon")]
945 public void canon (string valid_chars, char substitutor);
947 [CCode (cname = "g_strdup")]
948 public string dup ();
949 // n is size in bytes, not length in characters
950 [CCode (cname = "g_strndup")]
951 public string ndup (size_t n);
953 public string substring (long offset, long len = -1) {
954 long string_length = this.len ();
956 offset = string_length + offset;
957 GLib.return_val_if_fail (offset >= 0, null);
959 GLib.return_val_if_fail (offset <= string_length, null);
962 len = string_length - offset;
964 GLib.return_val_if_fail (offset + len <= string_length, null);
965 weak string start = this.offset (offset);
966 return start.ndup (((char*) start.offset (len)) - ((char*) start));
969 public bool contains (string needle) {
970 return this.str (needle) != null;
973 public string replace (string old, string replacement) {
975 var regex = new GLib.Regex (GLib.Regex.escape_string (old));
976 return regex.replace_literal (this, -1, 0, replacement);
977 } catch (GLib.RegexError e) {
978 GLib.assert_not_reached ();
983 get { return this.len (); }
986 public char[] to_utf8 () {
987 char[] result = new char[this.size () + 1];
989 GLib.Memory.copy (result, this, this.size ());
993 public unowned string to_string () {
998 [CCode (cprefix = "G", lower_case_cprefix = "g_", cheader_filename = "glib.h")]
1000 [CCode (lower_case_cprefix = "", cheader_filename = "math.h")]
1002 [CCode (cname = "G_E")]
1003 public const double E;
1005 [CCode (cname = "G_PI")]
1006 public const double PI;
1008 [CCode (cname = "G_LN2")]
1009 public const double LN2;
1011 [CCode (cname = "G_LN10")]
1012 public const double LN10;
1014 [CCode (cname = "G_PI_2")]
1015 public const double PI_2;
1017 [CCode (cname = "G_PI_4")]
1018 public const double PI_4;
1020 [CCode (cname = "G_SQRT2")]
1021 public const double SQRT2;
1023 /* generated from <bits/mathcalls.h> of glibc */
1024 public static double acos (double x);
1025 public static float acosf (float x);
1026 public static double asin (double x);
1027 public static float asinf (float x);
1028 public static double atan (double x);
1029 public static float atanf (float x);
1030 public static double atan2 (double y, double x);
1031 public static float atan2f (float y, float x);
1032 public static double cos (double x);
1033 public static float cosf (float x);
1034 public static double sin (double x);
1035 public static float sinf (float x);
1036 public static double tan (double x);
1037 public static float tanf (float x);
1038 public static double cosh (double x);
1039 public static float coshf (float x);
1040 public static double sinh (double x);
1041 public static float sinhf (float x);
1042 public static double tanh (double x);
1043 public static float tanhf (float x);
1044 public static void sincos (double x, out double sinx, out double cosx);
1045 public static void sincosf (float x, out float sinx, out float cosx);
1046 public static double acosh (double x);
1047 public static float acoshf (float x);
1048 public static double asinh (double x);
1049 public static float asinhf (float x);
1050 public static double atanh (double x);
1051 public static float atanhf (float x);
1052 public static double exp (double x);
1053 public static float expf (float x);
1054 public static double frexp (double x, out int exponent);
1055 public static float frexpf (float x, out int exponent);
1056 public static double ldexp (double x, int exponent);
1057 public static float ldexpf (float x, int exponent);
1058 public static double log (double x);
1059 public static float logf (float x);
1060 public static double log10 (double x);
1061 public static float log10f (float x);
1062 public static double modf (double x, out double iptr);
1063 public static float modff (float x, out float iptr);
1064 public static double exp10 (double x);
1065 public static float exp10f (float x);
1066 public static double pow10 (double x);
1067 public static float pow10f (float x);
1068 public static double expm1 (double x);
1069 public static float expm1f (float x);
1070 public static double log1p (double x);
1071 public static float log1pf (float x);
1072 public static double logb (double x);
1073 public static float logbf (float x);
1074 public static double exp2 (double x);
1075 public static float exp2f (float x);
1076 public static double log2 (double x);
1077 public static float log2f (float x);
1078 public static double pow (double x, double y);
1079 public static float powf (float x, float y);
1080 public static double sqrt (double x);
1081 public static float sqrtf (float x);
1082 public static double hypot (double x, double y);
1083 public static float hypotf (float x, float y);
1084 public static double cbrt (double x);
1085 public static float cbrtf (float x);
1086 public static double ceil (double x);
1087 public static float ceilf (float x);
1088 public static double fabs (double x);
1089 public static float fabsf (float x);
1090 public static double floor (double x);
1091 public static float floorf (float x);
1092 public static double fmod (double x, double y);
1093 public static float fmodf (float x, float y);
1094 public static int isinf (double value);
1095 public static int isinff (float value);
1096 public static int finite (double value);
1097 public static int finitef (float value);
1098 public static double drem (double x, double y);
1099 public static float dremf (float x, float y);
1100 public static double significand (double x);
1101 public static float significandf (float x);
1102 public static double copysign (double x, double y);
1103 public static float copysignf (float x, float y);
1104 public static double nan (string tagb);
1105 public static float nanf (string tagb);
1106 public static int isnan (double value);
1107 public static int isnanf (float value);
1108 public static double j0 (double x0);
1109 public static float j0f (float x0);
1110 public static double j1 (double x0);
1111 public static float j1f (float x0);
1112 public static double jn (int x0, double x1);
1113 public static float jnf (int x0, float x1);
1114 public static double y0 (double x0);
1115 public static float y0f (float x0);
1116 public static double y1 (double x0);
1117 public static float y1f (float x0);
1118 public static double yn (int x0, double x1);
1119 public static float ynf (int x0, float x1);
1120 public static double erf (double x0);
1121 public static float erff (float x0);
1122 public static double erfc (double x0);
1123 public static float erfcf (float x0);
1124 public static double lgamma (double x0);
1125 public static float lgammaf (float x0);
1126 public static double tgamma (double x0);
1127 public static float tgammaf (float x0);
1128 public static double gamma (double x0);
1129 public static float gammaf (float x0);
1130 public static double lgamma_r (double x0, out int signgamp);
1131 public static float lgamma_rf (float x0, out int signgamp);
1132 public static double rint (double x);
1133 public static float rintf (float x);
1134 public static double nextafter (double x, double y);
1135 public static float nextafterf (float x, float y);
1136 public static double nexttoward (double x, double y);
1137 public static float nexttowardf (float x, double y);
1138 public static double remainder (double x, double y);
1139 public static float remainderf (float x, float y);
1140 public static double scalbn (double x, int n);
1141 public static float scalbnf (float x, int n);
1142 public static int ilogb (double x);
1143 public static int ilogbf (float x);
1144 public static double scalbln (double x, long n);
1145 public static float scalblnf (float x, long n);
1146 public static double nearbyint (double x);
1147 public static float nearbyintf (float x);
1148 public static double round (double x);
1149 public static float roundf (float x);
1150 public static double trunc (double x);
1151 public static float truncf (float x);
1152 public static double remquo (double x, double y, out int quo);
1153 public static float remquof (float x, float y, out int quo);
1154 public static long lrint (double x);
1155 public static long lrintf (float x);
1156 public static int64 llrint (double x);
1157 public static int64 llrintf (float x);
1158 public static long lround (double x);
1159 public static long lroundf (float x);
1160 public static int64 llround (double x);
1161 public static int64 llroundf (float x);
1162 public static double fdim (double x, double y);
1163 public static float fdimf (float x, float y);
1164 public static double fmax (double x, double y);
1165 public static float fmaxf (float x, float y);
1166 public static double fmin (double x, double y);
1167 public static float fminf (float x, float y);
1168 public static double fma (double x, double y, double z);
1169 public static float fmaf (float x, float y, float z);
1170 public static double scalb (double x, double n);
1171 public static float scalbf (float x, float n);
1175 [CCode (cprefix = "G_", cname = "int", has_type_id = false)]
1176 public enum ByteOrder {
1177 [CCode (cname = "G_BYTE_ORDER")]
1184 /* Atomic Operations */
1186 namespace AtomicInt {
1187 public static int get (ref int atomic);
1188 public static void set (ref int atomic, int newval);
1189 public static void add (ref int atomic, int val);
1190 public static int exchange_and_add (ref int atomic, int val);
1191 public static bool compare_and_exchange (ref int atomic, int oldval, int newval);
1192 public static void inc (ref int atomic);
1193 public static bool dec_and_test (ref int atomic);
1196 namespace AtomicPointer {
1197 public static void* get (void** atomic);
1198 public static void set (void** atomic, void* newval);
1199 public static bool compare_and_exchange (void** atomic, void* oldval, void* newval);
1202 /* The Main Event Loop */
1205 [CCode (ref_function = "g_main_loop_ref", unref_function = "g_main_loop_unref")]
1206 public class MainLoop {
1207 public MainLoop (MainContext? context = null, bool is_running = false);
1209 public void quit ();
1210 public bool is_running ();
1211 public weak MainContext get_context ();
1214 namespace Priority {
1215 public const int HIGH;
1216 public const int DEFAULT;
1217 public const int HIGH_IDLE;
1218 public const int DEFAULT_IDLE;
1219 public const int LOW;
1223 [CCode (ref_function = "g_main_context_ref", unref_function = "g_main_context_unref")]
1224 public class MainContext {
1225 public MainContext ();
1226 public static weak MainContext @default ();
1227 public bool iteration (bool may_block);
1228 public bool pending ();
1229 public weak Source find_source_by_id (uint source_id);
1230 public weak Source find_source_by_user_data (void* user_data);
1231 public weak Source find_source_by_funcs_user_data (SourceFuncs funcs, void* user_data);
1232 public void wakeup ();
1233 public bool acquire ();
1234 public void release ();
1235 public bool is_owner ();
1236 public bool wait (Cond cond, Mutex mutex);
1237 public bool prepare (out int priority);
1238 public int query (int max_priority, out int timeout_, PollFD[] fds);
1239 [CCode (array_length = false)]
1240 public int check (int max_priority, PollFD[] fds, int n_fds);
1241 public void dispatch ();
1242 public void set_poll_func (PollFunc func);
1243 public PollFunc get_poll_func ();
1244 public void add_poll (ref PollFD fd, int priority);
1245 public void remove_poll (ref PollFD fd);
1246 public int depth ();
1247 [CCode (cname = "g_main_current_source")]
1248 public static weak Source current_source ();
1251 [CCode (has_target = false)]
1252 public delegate int PollFunc (PollFD[] ufds, uint nfsd, int timeout_);
1254 [CCode (cname = "GSource")]
1255 public class TimeoutSource : Source {
1256 public TimeoutSource (uint interval);
1257 public TimeoutSource.seconds (uint interval);
1261 [CCode (cname = "g_timeout_add_full")]
1262 public static uint add (uint interval, owned SourceFunc function, [CCode (pos = 0.1)] int priority = Priority.DEFAULT);
1263 public static uint add_full (int priority, uint interval, owned SourceFunc function);
1264 [CCode (cname = "g_timeout_add_seconds_full")]
1265 public static uint add_seconds (uint interval, owned SourceFunc function, [CCode (pos = 0.1)] int priority = Priority.DEFAULT);
1266 public static uint add_seconds_full (int priority, uint interval, owned SourceFunc function);
1269 [CCode (cname = "GSource")]
1270 public class IdleSource : Source {
1271 public IdleSource ();
1275 [CCode (cname = "g_idle_add_full")]
1276 public static uint add (owned SourceFunc function, [CCode (pos = 0.1)] int priority = Priority.DEFAULT_IDLE);
1277 public static uint add_full (int priority, owned SourceFunc function);
1278 public static bool remove_by_data (void* data);
1282 [CCode (default_value = "0")]
1286 public delegate void ChildWatchFunc (Pid pid, int status);
1288 public class ChildWatchSource : Source {
1289 public ChildWatchSource (Pid pid, int status, void* data);
1292 namespace ChildWatch {
1293 public static uint add (Pid pid, ChildWatchFunc function);
1294 public static uint add_full (int priority, Pid pid, owned ChildWatchFunc function);
1297 public struct PollFD {
1299 public IOCondition events;
1300 public IOCondition revents;
1304 [CCode (ref_function = "g_source_ref", unref_function = "g_source_unref")]
1305 public class Source {
1306 public Source (SourceFuncs source_funcs, uint struct_size /* = sizeof (Source) */);
1307 public void set_funcs (SourceFuncs funcs);
1308 public uint attach (MainContext? context);
1309 public void destroy ();
1310 public bool is_destroyed ();
1311 public void set_priority (int priority);
1312 public int get_priority ();
1313 public void set_can_recurse (bool can_recurse);
1314 public bool get_can_recurse ();
1315 public uint get_id ();
1316 public weak MainContext get_context ();
1317 public void set_callback (owned SourceFunc func);
1318 public void set_callback_indirect (void* callback_data, SourceCallbackFuncs callback_funcs);
1319 public void add_poll (ref PollFD fd);
1320 public void remove_poll (ref PollFD fd);
1321 public void get_current_time (out TimeVal timeval);
1322 public static bool remove (uint id);
1323 public static bool remove_by_funcs_user_data (void* user_data);
1324 public static bool remove_by_user_data (void* user_data);
1327 [CCode (has_target = false)]
1328 public delegate void SourceDummyMarshal ();
1330 [CCode (has_target = false)]
1331 public delegate bool SourcePrepareFunc (Source source, out int timeout_);
1332 [CCode (has_target = false)]
1333 public delegate bool SourceCheckFunc (Source source);
1334 [CCode (has_target = false)]
1335 public delegate bool SourceDispatchFunc (Source source, SourceFunc _callback);
1336 [CCode (has_target = false)]
1337 public delegate void SourceFinalizeFunc (Source source);
1340 public class SourceFuncs {
1341 public SourcePrepareFunc prepare;
1342 public SourceCheckFunc check;
1343 public SourceDispatchFunc dispatch;
1344 public SourceFinalizeFunc finalize;
1347 [CCode (has_target = false)]
1348 public delegate void SourceCallbackRefFunc (void* cb_data);
1349 [CCode (has_target = false)]
1350 public delegate void SourceCallbackUnrefFunc (void* cb_data);
1351 [CCode (has_target = false)]
1352 public delegate void SourceCallbackGetFunc (void* cb_data, Source source, SourceFunc func);
1355 public class SourceCallbackFuncs {
1356 public SourceCallbackRefFunc @ref;
1357 public SourceCallbackUnrefFunc unref;
1358 public SourceCallbackGetFunc @get;
1361 public delegate bool SourceFunc ();
1363 public errordomain ThreadError {
1367 /* Thread support */
1369 public delegate void* ThreadFunc ();
1370 public delegate void Func (void* data);
1372 [CCode (has_type_id = false)]
1373 public enum ThreadPriority {
1381 public class Thread {
1382 public static bool supported ();
1383 public static weak Thread create (ThreadFunc func, bool joinable) throws ThreadError;
1384 public static weak Thread create_full (ThreadFunc func, ulong stack_size, bool joinable, bool bound, ThreadPriority priority) throws ThreadError;
1385 public static weak Thread self ();
1386 public void* join ();
1387 public void set_priority (ThreadPriority priority);
1388 public static void yield ();
1389 public static void exit (void* retval);
1390 public static void @foreach (Func thread_func);
1392 [CCode (cname = "g_usleep")]
1393 public static void usleep (ulong microseconds);
1397 [CCode (free_function = "g_mutex_free")]
1398 public class Mutex {
1400 public void @lock ();
1401 public bool trylock ();
1402 public void unlock ();
1405 [CCode (destroy_function = "g_static_mutex_free")]
1406 public struct StaticMutex {
1407 public StaticMutex ();
1408 public void lock ();
1409 public bool trylock ();
1410 public void unlock ();
1411 public void lock_full ();
1414 [CCode (destroy_function = "g_static_rec_mutex_free")]
1415 public struct StaticRecMutex {
1416 public StaticRecMutex ();
1417 public void lock ();
1418 public bool trylock ();
1419 public void unlock ();
1420 public void lock_full ();
1423 [CCode (destroy_function = "g_static_rw_lock_free")]
1424 public struct StaticRWLock {
1425 public StaticRWLock ();
1426 public void reader_lock ();
1427 public bool reader_trylock ();
1428 public void reader_unlock ();
1429 public void writer_lock ();
1430 public bool writer_trylock ();
1431 public void writer_unlock ();
1435 [CCode (ref_function = "", unref_function = "")]
1436 public class Private {
1437 public Private (DestroyNotify destroy_func);
1438 public void* get ();
1439 public void set (void* data);
1442 [CCode (destroy_function = "g_static_private_free")]
1443 public struct StaticPrivate {
1444 public StaticPrivate ();
1445 public void* get ();
1446 public void set (void* data, DestroyNotify? destroy_func);
1450 [CCode (free_function = "g_cond_free")]
1453 public void @signal ();
1454 public void broadcast ();
1455 public void wait (Mutex mutex);
1456 public bool timed_wait (Mutex mutex, TimeVal abs_time);
1462 [CCode (free_function = "g_thread_pool_free")]
1463 public class ThreadPool {
1464 public ThreadPool (Func func, int max_threads, bool exclusive) throws ThreadError;
1465 public void push (void* data) throws ThreadError;
1466 public void set_max_threads (int max_threads) throws ThreadError;
1467 public int get_max_threads ();
1468 public uint get_num_threads ();
1469 public uint unprocessed ();
1470 public static void set_max_unused_threads (int max_threads);
1471 public static int get_max_unused_threads ();
1472 public static uint get_num_unused_threads ();
1473 public static void stop_unused_threads ();
1474 public void set_sort_function (CompareDataFunc func);
1475 public static void set_max_idle_time (uint interval);
1476 public static uint get_max_idle_time ();
1479 /* Asynchronous Queues */
1482 [CCode (ref_function = "g_async_queue_ref", unref_function = "g_async_queue_unref")]
1483 public class AsyncQueue<G> {
1484 public AsyncQueue ();
1485 public void push (owned G data);
1486 public void push_sorted (owned G data, CompareDataFunc func);
1488 public G try_pop ();
1489 public G timed_pop (ref TimeVal end_time);
1490 public int length ();
1491 public void sort (CompareDataFunc func);
1492 public void @lock ();
1493 public void unlock ();
1494 public void ref_unlocked ();
1495 public void unref_and_unlock ();
1496 public void push_unlocked (owned G data);
1497 public void push_sorted_unlocked (owned G data, CompareDataFunc func);
1498 public G pop_unlocked ();
1499 public G try_pop_unlocked ();
1500 public G timed_pop_unlocked (ref TimeVal end_time);
1501 public int length_unlocked ();
1502 public void sort_unlocked (CompareDataFunc func);
1505 /* Memory Allocation */
1507 public static void* malloc (ulong n_bytes);
1508 public static void* malloc0 (ulong n_bytes);
1509 public static void* realloc (void* mem, ulong n_bytes);
1511 public static void* try_malloc (ulong n_bytes);
1512 public static void* try_malloc0 (ulong n_bytes);
1513 public static void* try_realloc (void* mem, ulong n_bytes);
1515 public static void free (void* mem);
1517 public class MemVTable {
1520 [CCode (cname = "glib_mem_profiler_table")]
1521 public static MemVTable mem_profiler_table;
1523 public static void mem_set_vtable (MemVTable vtable);
1524 public static void mem_profile ();
1526 [CCode (cheader_filename = "string.h")]
1528 [CCode (cname = "memcmp")]
1529 public static int cmp (void* s1, void* s2, size_t n);
1530 [CCode (cname = "memcpy")]
1531 public static void* copy (void* dest, void* src, size_t n);
1532 [CCode (cname = "memset")]
1533 public static void* set (void* dest, int src, size_t n);
1534 [CCode (cname = "g_memmove")]
1535 public static void* move (void* dest, void* src, size_t n);
1536 [CCode (cname = "g_memdup")]
1537 public static void* dup (void* mem, uint n);
1543 [CCode (ref_function = "g_io_channel_ref", unref_function = "g_io_channel_unref")]
1544 public class IOChannel {
1545 [CCode (cname = "g_io_channel_unix_new")]
1546 public IOChannel.unix_new (int fd);
1547 public int unix_get_fd ();
1548 [CCode (cname = "g_io_channel_win32_new_fd")]
1549 public IOChannel.win32_new_fd (int fd);
1550 public void init ();
1551 public IOChannel.file (string filename, string mode) throws FileError;
1552 public IOStatus read_chars (char[] buf, out size_t bytes_read) throws ConvertError, IOChannelError;
1553 public IOStatus read_unichar (out unichar thechar) throws ConvertError, IOChannelError;
1554 public IOStatus read_line (out string str_return, out size_t length, out size_t terminator_pos) throws ConvertError, IOChannelError;
1555 public IOStatus read_line_string (StringBuilder buffer, out size_t terminator_pos) throws ConvertError, IOChannelError;
1556 public IOStatus read_to_end (out string str_return, out size_t length) throws ConvertError, IOChannelError;
1557 public IOStatus write_chars (char[] buf, out size_t bytes_written) throws ConvertError, IOChannelError;
1558 public IOStatus write_unichar (unichar thechar) throws ConvertError, IOChannelError;
1559 public IOStatus flush () throws IOChannelError;
1560 public IOStatus seek_position (int64 offset, SeekType type) throws IOChannelError;
1561 public IOStatus shutdown (bool flush) throws IOChannelError;
1562 [CCode (cname = "g_io_create_watch")]
1563 public GLib.Source create_watch (IOCondition condition);
1564 [CCode (cname = "g_io_add_watch")]
1565 public uint add_watch (IOCondition condition, IOFunc func);
1566 [CCode (cname = "g_io_add_watch_full")]
1567 public uint add_watch_full (int priority, IOCondition condition, owned IOFunc func);
1568 public size_t get_buffer_size ();
1569 public void set_buffer_size (size_t size);
1570 public IOCondition get_buffer_condition ();
1571 public IOFlags get_flags ();
1572 public IOStatus set_flags (IOFlags flags) throws IOChannelError;
1573 public weak string get_line_term (out int length);
1574 public void set_line_term (string line_term, int length);
1575 public bool get_buffered ();
1576 public void set_buffered (bool buffered);
1577 public weak string get_encoding ();
1578 public IOStatus set_encoding (string? encoding) throws IOChannelError;
1579 public bool get_close_on_unref ();
1580 public void set_close_on_unref (bool do_close);
1583 [CCode (cprefix = "G_SEEK_", has_type_id = false)]
1584 public enum SeekType {
1590 [CCode (has_type_id = false)]
1591 public enum IOStatus {
1598 public errordomain IOChannelError {
1611 [CCode (cprefix = "G_IO_")]
1612 public enum IOCondition {
1621 public delegate bool IOFunc (IOChannel source, IOCondition condition);
1623 [CCode (cprefix = "G_IO_FLAG_", has_type_id = false)]
1624 public enum IOFlags {
1635 /* Error Reporting */
1639 [CCode (copy_function = "g_error_copy", free_function = "g_error_free")]
1640 public class Error {
1641 public Error (Quark domain, int code, string format, ...);
1642 public Error copy ();
1643 public bool matches (Quark domain, int code);
1645 public Quark domain;
1647 public string message;
1650 /* Message Output and Debugging Functions */
1653 public static void print (string format, ...);
1654 public static void set_print_handler (PrintFunc func);
1655 [CCode (has_target = false)]
1656 public delegate void PrintFunc (string text);
1658 public static void printerr (string format, ...);
1659 public static void set_printerr_handler (PrintFunc func);
1661 public static void return_if_fail (bool expr);
1662 [CCode (sentinel = "")]
1663 public static void return_val_if_fail (bool expr, ...);
1665 public static void return_if_reached ();
1667 [CCode (sentinel = "")]
1668 public static void return_val_if_reached (...);
1669 public static void warn_if_fail (bool expr);
1670 public static void warn_if_reached ();
1672 public static void assert (bool expr);
1674 public static void assert_not_reached ();
1676 public static void on_error_query (string? prg_name = null);
1677 public static void on_error_stack_trace (string? prg_name = null);
1678 [CCode (cname = "G_BREAKPOINT")]
1679 public static void breakpoint ();
1681 /* Message Logging */
1683 [CCode (cprefix = "G_LOG_", has_type_id = false)]
1684 public enum LogLevelFlags {
1689 /* GLib log levels */
1702 public void log (string? log_domain, LogLevelFlags log_level, string format, ...);
1706 public void message (string format, ...);
1709 public void warning (string format, ...);
1712 public void critical (string format, ...);
1715 public void error (string format, ...);
1718 public void debug (string format, ...);
1720 public delegate void LogFunc (string? log_domain, LogLevelFlags log_levels, string message);
1723 public static uint set_handler (string? log_domain, LogLevelFlags log_levels, LogFunc log_func);
1724 public static void set_default_handler (LogFunc log_func);
1725 public static void default_handler (string? log_domain, LogLevelFlags log_level, string message, void* unused_data = null);
1727 public const string FILE;
1728 public const int LINE;
1729 public const string METHOD;
1732 /* String Utility Functions */
1734 public uint strv_length ([CCode (array_length = false, array_null_terminated = true)] string[] str_array);
1736 [CCode (cname = "errno", cheader_filename = "errno.h")]
1738 public weak string strerror (int errnum);
1740 /* Character Set Conversions */
1742 public static string convert (string str, long len, string to_codeset, string from_codeset, out int bytes_read = null, out int bytes_written = null) throws ConvertError;
1743 public static bool get_charset (out weak string charset);
1745 public struct IConv {
1746 [CCode (cname = "g_iconv_open")]
1747 public IConv (string to_codeset, string from_codeset);
1748 [CCode (cname = "g_iconv")]
1749 public uint iconv (out string inbuf, out uint inbytes_left, out string outbuf, out uint outbytes_left);
1750 public int close ();
1753 namespace Filename {
1754 public static string to_utf8 (string opsysstring, out ulong bytes_read, out ulong bytes_written) throws ConvertError;
1755 public static string from_utf8 (string utf8string, long len, out ulong bytes_read, out ulong bytes_written) throws ConvertError;
1756 public static string from_uri (string uri, out string hostname = null) throws ConvertError;
1757 public static string to_uri (string filename, string? hostname = null) throws ConvertError;
1758 public static string display_name (string filename);
1759 public static string display_basename (string filename);
1762 public errordomain ConvertError {
1771 /* Base64 Encoding */
1774 public static size_t encode_step (uchar[] _in, bool break_lines, char* _out, ref int state, ref int save);
1775 public static size_t encode_close (bool break_lines, char* _out, ref int state, ref int save);
1776 public static string encode (uchar[] data);
1777 public static size_t decode_step (char[] _in, uchar* _out, ref int state, ref uint save);
1778 [CCode (array_length = false)]
1779 public static uchar[] decode (string text, out size_t out_len);
1782 /* Data Checksums */
1784 [CCode (cprefix = "G_CHECKSUM_", has_type_id = false)]
1785 public enum ChecksumType {
1790 public ssize_t get_length ();
1794 [CCode (free_function = "g_checksum_free")]
1795 public class Checksum {
1796 public Checksum (ChecksumType checksum_type);
1797 public Checksum copy ();
1798 public void update ([CCode (array_length = false)] uchar[] data, size_t length);
1799 public weak string get_string ();
1800 public void get_digest ([CCode (array_length = false)] uint8[] buffer, ref size_t digest_len);
1801 [CCode (cname = "g_compute_checksum_for_data")]
1802 public static string compute_for_data (ChecksumType checksum_type, uchar[] data);
1803 [CCode (cname = "g_compute_checksum_for_string")]
1804 public static string compute_for_string (ChecksumType checksum_type, string str, size_t length = -1);
1807 /* Date and Time Functions */
1809 [CCode (has_type_id = false)]
1810 public struct TimeVal {
1812 public long tv_usec;
1814 [CCode (cname = "g_get_current_time")]
1816 [CCode (cname = "g_get_current_time")]
1817 public void get_current_time ();
1818 public void add (long microseconds);
1819 [CCode (instance_pos = -1)]
1820 public bool from_iso8601 (string iso_date);
1821 [InstanceByReference]
1822 public string to_iso8601 ();
1825 public struct DateDay : uchar {
1826 [CCode (cname = "G_DATE_BAD_DAY")]
1827 public static DateDay BAD_DAY;
1829 [CCode (cname = "g_date_valid_day")]
1830 public bool valid ();
1833 [CCode (cprefix = "G_DATE_", has_type_id = false)]
1834 public enum DateMonth {
1849 [CCode (cname = "g_date_get_days_in_month")]
1850 public uchar get_days_in_month (DateYear year);
1851 [CCode (cname = "g_date_valid_month")]
1852 public bool valid ();
1855 public struct DateYear : ushort {
1856 [CCode (cname = "G_DATE_BAD_YEAR")]
1857 public static DateDay BAD_YEAR;
1859 [CCode (cname = "g_date_is_leap_year")]
1860 public bool is_leap_year ();
1861 [CCode (cname = "g_date_get_monday_weeks_in_year")]
1862 public uchar get_monday_weeks_in_year ();
1863 [CCode (cname = "g_date_get_sunday_weeks_in_year")]
1864 public uchar get_sunday_weeks_in_year ();
1865 [CCode (cname = "g_date_valid_year")]
1866 public bool valid ();
1869 [CCode (cprefix = "G_DATE_", has_type_id = false)]
1870 public enum DateWeekday {
1880 [CCode (cname = "g_date_valid_weekday")]
1881 public bool valid ();
1884 [CCode (cprefix = "G_DATE_", has_type_id = false)]
1885 public enum DateDMY {
1891 public struct Date {
1892 public void clear (uint n_dates = 1);
1893 public void set_day (DateDay day);
1894 public void set_month (DateMonth month);
1895 public void set_year (DateYear year);
1896 public void set_dmy (DateDay day, int month, DateYear y);
1897 public void set_julian (uint julian_day);
1898 public void set_time_val (TimeVal timeval);
1899 public void set_parse (string str);
1900 public void add_days (uint n_days);
1901 public void subtract_days (uint n_days);
1902 public void add_months (uint n_months);
1903 public void subtract_months (uint n_months);
1904 public void add_years (uint n_years);
1905 public void subtract_years (uint n_years);
1906 public int days_between (Date date2);
1907 public int compare (Date rhs);
1908 public void clamp (Date min_date, Date max_date);
1909 public void order (Date date2);
1910 public DateDay get_day ();
1911 public DateMonth get_month ();
1912 public DateYear get_year ();
1913 public uint get_julian ();
1914 public DateWeekday get_weekday ();
1915 public uint get_day_of_year ();
1916 public bool is_first_of_month ();
1917 public bool is_last_of_month ();
1918 public uint get_monday_week_of_year ();
1919 public uint get_sunday_week_of_year ();
1920 public uint get_iso8601_week_of_year ();
1921 [CCode (instance_pos = -1)]
1922 public size_t strftime (char[] s, string format);
1923 [CCode (cname = "g_date_to_struct_tm")]
1924 public void to_time (out Time tm);
1925 public bool valid ();
1926 public static uchar get_days_in_month (DateMonth month, DateYear year);
1927 public static bool valid_day (DateDay day);
1928 public static bool valid_dmy (DateDay day, DateMonth month, DateYear year);
1929 public static bool valid_julian (uint julian_date);
1930 public static bool valid_weekday (DateWeekday weekday);
1933 [CCode (cname = "struct tm", cheader_filename = "time.h", has_type_id = false)]
1934 public struct Time {
1935 [CCode (cname = "tm_sec")]
1937 [CCode (cname = "tm_min")]
1939 [CCode (cname = "tm_hour")]
1941 [CCode (cname = "tm_mday")]
1943 [CCode (cname = "tm_mon")]
1945 [CCode (cname = "tm_year")]
1947 [CCode (cname = "tm_wday")]
1949 [CCode (cname = "tm_yday")]
1950 public int day_of_year;
1951 [CCode (cname = "tm_isdst")]
1954 [CCode (cname = "gmtime_r")]
1955 static void gmtime_r (ref time_t time, out Time result);
1956 [CCode (cname = "localtime_r")]
1957 static void localtime_r (ref time_t time, out Time result);
1959 public static Time gm (time_t time) {
1961 gmtime_r (ref time, out result);
1964 public static Time local (time_t time) {
1966 localtime_r (ref time, out result);
1970 public string to_string () {
1971 return "%04d-%02d-%02d %02d:%02d:%02d".printf (year + 1900, month + 1, day, hour, minute, second);
1974 public string format (string format) {
1975 var buffer = new char[64];
1976 this.strftime (buffer, format);
1977 return (string) buffer;
1980 [CCode (cname = "mktime")]
1981 public time_t mktime ();
1983 [CCode (cname = "strftime", instance_pos = -1)]
1984 public size_t strftime (char[] s, string format);
1985 [CCode (cname = "strptime", instance_pos = -1)]
1986 public weak string? strptime (string buf, string format);
1989 /* Random Numbers */
1992 [CCode (copy_function = "g_rand_copy", free_function = "g_rand_free")]
1994 public Rand.with_seed (uint32 seed);
1995 public Rand.with_seed_array ([CCode (array_length = false)] uint32[] seed, uint seed_length);
1997 public void set_seed (uint32 seed);
1998 public void set_seed_array ([CCode (array_length = false)] uint32[] seed, uint seed_length);
1999 public bool boolean ();
2000 [CCode (cname = "g_rand_int")]
2001 public uint32 next_int ();
2002 public int32 int_range (int32 begin, int32 end);
2003 [CCode (cname = "g_rand_double")]
2004 public double next_double ();
2005 public double double_range (double begin, double end);
2009 public static void set_seed (uint32 seed);
2010 public static bool boolean ();
2011 [CCode (cname = "g_random_int")]
2012 public static uint32 next_int ();
2013 public static int32 int_range (int32 begin, int32 end);
2014 [CCode (cname = "g_random_double")]
2015 public static double next_double ();
2016 public static double double_range (double begin, double end);
2019 /* Miscellaneous Utility Functions */
2021 namespace Environment {
2022 [CCode (cname = "g_get_application_name")]
2023 public static weak string? get_application_name ();
2024 [CCode (cname = "g_set_application_name")]
2025 public static void set_application_name (string application_name);
2026 [CCode (cname = "g_get_prgname")]
2027 public static weak string get_prgname ();
2028 [CCode (cname = "g_set_prgname")]
2029 public static void set_prgname (string application_name);
2030 [CCode (cname = "g_getenv")]
2031 public static weak string? get_variable (string variable);
2032 [CCode (cname = "g_setenv")]
2033 public static bool set_variable (string variable, string value, bool overwrite);
2034 [CCode (cname = "g_unsetenv")]
2035 public static void unset_variable (string variable);
2036 [CCode (cname = "g_listenv", array_length = false, array_null_terminated = true)]
2037 public static string[] list_variables ();
2038 [CCode (cname = "g_get_user_name")]
2039 public static weak string get_user_name ();
2040 [CCode (cname = "g_get_real_name")]
2041 public static weak string get_real_name ();
2042 [CCode (cname = "g_get_user_cache_dir")]
2043 public static weak string get_user_cache_dir ();
2044 [CCode (cname = "g_get_user_data_dir")]
2045 public static weak string get_user_data_dir ();
2046 [CCode (cname = "g_get_user_config_dir")]
2047 public static weak string get_user_config_dir ();
2048 [CCode (cname = "g_get_user_special_dir")]
2049 public static weak string get_user_special_dir (UserDirectory directory);
2050 [CCode (cname = "g_get_system_data_dirs", array_length = false, array_null_terminated = true)]
2052 public static weak string[] get_system_data_dirs ();
2053 [CCode (cname = "g_get_system_config_dirs", array_length = false, array_null_terminated = true)]
2055 public static weak string[] get_system_config_dirs ();
2056 [CCode (cname = "g_get_host_name")]
2057 public static weak string get_host_name ();
2058 [CCode (cname = "g_get_home_dir")]
2059 public static weak string get_home_dir ();
2060 [CCode (cname = "g_get_tmp_dir")]
2061 public static weak string get_tmp_dir ();
2062 [CCode (cname = "g_get_current_dir")]
2063 public static string get_current_dir ();
2064 [CCode (cname = "g_find_program_in_path")]
2065 public static string? find_program_in_path (string program);
2066 [CCode (cname = "g_atexit")]
2067 public static void atexit (VoidFunc func);
2068 [CCode (cname = "g_chdir")]
2069 public static int set_current_dir (string path);
2072 [CCode (has_type_id = false)]
2073 public enum UserDirectory {
2085 public static bool is_absolute (string file_name);
2086 public static weak string skip_root (string file_name);
2087 public static string get_basename (string file_name);
2088 public static string get_dirname (string file_name);
2089 [CCode (cname = "g_build_filename")]
2090 public static string build_filename (string first_element, ...);
2092 [CCode (cname = "G_DIR_SEPARATOR")]
2093 public const char DIR_SEPARATOR;
2094 [CCode (cname = "G_DIR_SEPARATOR_S")]
2095 public const string DIR_SEPARATOR_S;
2096 [CCode (cname = "G_IS_DIR_SEPARATOR")]
2097 public static bool is_dir_separator (unichar c);
2098 [CCode (cname = "G_SEARCHPATH_SEPARATOR")]
2099 public const char SEARCHPATH_SEPARATOR;
2100 [CCode (cname = "G_SEARCHPATH_SEPARATOR_S")]
2101 public const string SEARCHPATH_SEPARATOR_S;
2105 public static int nth_lsf (ulong mask, int nth_bit);
2106 public static int nth_msf (ulong mask, int nth_bit);
2107 public static uint storage (ulong number);
2110 namespace SpacedPrimes {
2111 public static uint closest (uint num);
2114 [CCode (has_target = false)]
2115 public delegate void FreeFunc (void* data);
2116 [CCode (has_target = false)]
2117 public delegate void VoidFunc ();
2119 public string format_size_for_display (int64 size);
2121 /* Lexical Scanner */
2122 [CCode (has_target = false)]
2123 public delegate void ScannerMsgFunc (Scanner scanner, string message, bool error);
2126 [CCode (free_function = "g_scanner_destroy")]
2127 public class Scanner {
2128 public weak string input_name;
2129 public TokenType token;
2130 public TokenValue value;
2132 public uint position;
2133 public TokenType next_token;
2134 public TokenValue next_value;
2135 public uint next_line;
2136 public uint next_position;
2137 public ScannerMsgFunc msg_handler;
2138 public Scanner (ScannerConfig? config_templ);
2139 public void input_file (int input_fd);
2140 public void sync_file_offset ();
2141 public void input_text (string text, uint text_len);
2142 public TokenType peek_next_token ();
2143 public TokenType get_next_token ();
2145 public uint set_scope (uint scope_id);
2146 public void scope_add_symbol (uint scope_id, string symbol, void* value);
2147 public void scope_foreach_symbol (uint scope_id, HFunc func);
2148 public void* scope_lookup_symbol (uint scope_id, string symbol);
2149 public void scope_remove_symbol (uint scope_id, string symbol);
2150 public void* lookup_symbol (string symbol);
2152 public void warn (string format, ...);
2154 public void error (string format, ...);
2155 public void unexp_token (TokenType expected_token, string? identifier_spec, string? symbol_spec, string? symbol_name, string? message, bool is_error);
2158 public struct ScannerConfig {
2159 public string* cset_skip_characters;
2160 public string* cset_identifier_first;
2161 public string* cset_identifier_nth;
2162 public string* cpair_comment_single;
2163 public bool case_sensitive;
2164 public bool skip_comment_multi;
2165 public bool skip_comment_single;
2166 public bool scan_comment_multi;
2167 public bool scan_identifier;
2168 public bool scan_identifier_1char;
2169 public bool scan_identifier_NULL;
2170 public bool scan_symbols;
2171 public bool scan_binary;
2172 public bool scan_octal;
2173 public bool scan_float;
2174 public bool scan_hex;
2175 public bool scan_hex_dollar;
2176 public bool scan_string_sq;
2177 public bool scan_string_dq;
2178 public bool numbers_2_int;
2179 public bool int_2_float;
2180 public bool identifier_2_string;
2181 public bool char_2_token;
2182 public bool symbol_2_token;
2183 public bool scope_0_fallback;
2184 public bool store_int64;
2187 [CCode (lower_case_cprefix="G_CSET_")]
2188 namespace CharacterSet {
2189 public const string A_2_Z;
2190 public const string a_2_z;
2191 public const string DIGITS;
2192 public const string LATINC;
2193 public const string LATINS;
2196 [CCode (cprefix = "G_TOKEN_", has_type_id = false)]
2197 public enum TokenType
2226 public struct TokenValue {
2227 [CCode (cname="v_symbol")]
2228 public void* symbol;
2229 [CCode (cname="v_identifier")]
2230 public string identifier;
2231 [CCode (cname="v_binary")]
2232 public ulong binary;
2233 [CCode (cname="v_octal")]
2235 [CCode (cname="v_int")]
2237 [CCode (cname="v_int64")]
2239 [CCode (cname="v_float")]
2240 public double float;
2241 [CCode (cname="v_hex")]
2243 [CCode (cname="v_string")]
2244 public string string;
2245 [CCode (cname="v_comment")]
2246 public string comment;
2247 [CCode (cname="v_char")]
2249 [CCode (cname="v_error")]
2253 [CCode (cprefix = "G_ERR_", has_type_id = false)]
2254 public enum ErrorType
2258 UNEXP_EOF_IN_STRING,
2259 UNEXP_EOF_IN_COMMENT,
2266 /* Automatic String Completion */
2269 [CCode (free_function = "g_completion_free")]
2270 public class Completion {
2271 public Completion (CompletionFunc? func = null);
2272 public List<void*> items;
2273 public CompletionFunc func;
2274 public string prefix;
2275 public List<void*> cache;
2276 public CompletionStrncmpFunc strncmp_func;
2277 public void add_items (List<void*> items);
2278 public void remove_items (List<void*> items);
2279 public void clear_items ();
2280 public weak List<void*> complete (string prefix, out string? new_prefix = null);
2281 public weak List<void*> complete_utf8 (string prefix, out string? new_prefix = null);
2284 [CCode (has_target = false)]
2285 public delegate string CompletionFunc (void* item);
2286 [CCode (has_target = false)]
2287 public delegate int CompletionStrncmpFunc (string s1, string s2, size_t n);
2292 [CCode (free_function = "g_timer_destroy")]
2293 public class Timer {
2295 public void start ();
2296 public void stop ();
2297 public void @continue ();
2298 public double elapsed (out ulong microseconds = null);
2299 public void reset ();
2302 /* Spawning Processes */
2304 public errordomain SpawnError {
2327 [CCode (cprefix = "G_SPAWN_", has_type_id = false)]
2328 public enum SpawnFlags {
2329 LEAVE_DESCRIPTORS_OPEN,
2334 CHILD_INHERITS_STDIN,
2338 public delegate void SpawnChildSetupFunc ();
2340 [CCode (lower_case_cprefix = "g_")]
2342 public static bool spawn_async_with_pipes (string? working_directory, [CCode (array_length = false, array_null_terminated = true)] string[] argv, [CCode (array_length = false, array_null_terminated = true)] string[]? envp, SpawnFlags _flags, SpawnChildSetupFunc? child_setup, out Pid child_pid, out int standard_input = null, out int standard_output = null, out int standard_error = null) throws SpawnError;
2343 public static bool spawn_async (string? working_directory, [CCode (array_length = false, array_null_terminated = true)] string[] argv, [CCode (array_length = false, array_null_terminated = true)] string[]? envp, SpawnFlags _flags, SpawnChildSetupFunc? child_setup, out Pid child_pid) throws SpawnError;
2344 public static bool spawn_sync (string? working_directory, [CCode (array_length = false, array_null_terminated = true)] string[] argv, [CCode (array_length = false, array_null_terminated = true)] string[]? envp, SpawnFlags _flags, SpawnChildSetupFunc? child_setup, out string standard_output = null, out string standard_error = null, out int exit_status = null) throws SpawnError;
2345 public static bool spawn_command_line_async (string command_line) throws SpawnError;
2346 public static bool spawn_command_line_sync (string command_line, out string standard_output = null, out string standard_error = null, out int exit_status = null) throws SpawnError;
2347 [CCode (cname = "g_spawn_close_pid")]
2348 public static void close_pid (Pid pid);
2350 /* these macros are required to examine the exit status of a process */
2351 [CCode (cname = "WIFEXITED", cheader_filename = "sys/wait.h")]
2352 public static bool if_exited (int status);
2353 [CCode (cname = "WEXITSTATUS", cheader_filename = "sys/wait.h")]
2354 public static int exit_status (int status);
2355 [CCode (cname = "WIFSIGNALED", cheader_filename = "sys/wait.h")]
2356 public static bool if_signaled (int status);
2357 [CCode (cname = "WTERMSIG", cheader_filename = "sys/wait.h")]
2358 public static ProcessSignal term_sig (int status);
2359 [CCode (cname = "WCOREDUMP", cheader_filename = "sys/wait.h")]
2360 public static bool core_dump (int status);
2361 [CCode (cname = "WIFSTOPPED", cheader_filename = "sys/wait.h")]
2362 public static bool if_stopped (int status);
2363 [CCode (cname = "WSTOPSIG", cheader_filename = "sys/wait.h")]
2364 public static ProcessSignal stop_sig (int status);
2365 [CCode (cname = "WIFCONTINUED", cheader_filename = "sys/wait.h")]
2366 public static bool if_continued (int status);
2369 [CCode (cname = "int", has_type_id = false, cheader_filename = "signal.h", cprefix = "SIG")]
2370 public enum ProcessSignal {
2395 /* File Utilities */
2397 public errordomain FileError {
2425 [CCode (has_type_id = false)]
2426 public enum FileTest {
2434 [CCode (cprefix = "SEEK_", has_type_id = false)]
2435 public enum FileSeek {
2442 [CCode (cname = "FILE", free_function = "fclose", cheader_filename = "stdio.h")]
2443 public class FileStream {
2444 [CCode (cname = "EOF", cheader_filename = "stdio.h")]
2445 public const int EOF;
2447 [CCode (cname = "fopen")]
2448 public static FileStream? open (string path, string mode);
2449 [CCode (cname = "fdopen")]
2450 public static FileStream? fdopen (int fildes, string mode);
2451 [CCode (cname = "fprintf")]
2453 public void printf (string format, ...);
2454 [CCode (cname = "fputc", instance_pos = -1)]
2455 public void putc (char c);
2456 [CCode (cname = "fputs", instance_pos = -1)]
2457 public void puts (string s);
2458 [CCode (cname = "fgetc")]
2460 [CCode (cname = "fgets", instance_pos = -1)]
2461 public weak string gets (char[] s);
2462 [CCode (cname = "feof")]
2464 [CCode (cname = "fscanf"), ScanfFormat]
2465 public int scanf (string format, ...);
2466 [CCode (cname = "fflush")]
2467 public int flush ();
2468 [CCode (cname = "fseek")]
2469 public int seek (long offset, FileSeek whence);
2470 [CCode (cname = "ftell")]
2471 public long tell ();
2472 [CCode (cname = "rewind")]
2473 public void rewind ();
2474 [CCode (cname = "fileno")]
2475 public int fileno ();
2476 [CCode (cname = "ferror")]
2477 public int error ();
2478 [CCode (cname = "clearerr")]
2479 public void clearerr ();
2481 public string? read_line () {
2483 StringBuilder ret = null;
2484 while ((c = getc ()) != EOF) {
2486 ret = new StringBuilder ();
2491 ret.append_c ((char) c);
2493 return ret == null ? null : ret.str;
2497 [CCode (lower_case_cprefix = "g_file_", cheader_filename = "glib/gstdio.h")]
2498 namespace FileUtils {
2499 public static bool get_contents (string filename, out string contents, out ulong length = null) throws FileError;
2500 public static bool set_contents (string filename, string contents, long length = -1) throws FileError;
2501 public static bool test (string filename, FileTest test);
2502 public static int open_tmp (string tmpl, out string name_used) throws FileError;
2503 public static string read_link (string filename) throws FileError;
2505 [CCode (cname = "g_mkstemp")]
2506 public static int mkstemp (string tmpl);
2507 [CCode (cname = "g_rename")]
2508 public static int rename (string oldfilename, string newfilename);
2509 [CCode (cname = "g_remove")]
2510 public static int remove (string filename);
2511 [CCode (cname = "g_unlink")]
2512 public static int unlink (string filename);
2513 [CCode (cname = "g_chmod")]
2514 public static int chmod (string filename, int mode);
2516 [CCode (cname = "symlink")]
2517 public static int symlink (string oldpath, string newpath);
2520 [CCode (cname = "stat")]
2521 public struct Stat {
2525 [CCode (free_function = "g_dir_close")]
2527 public static Dir open (string filename, uint _flags = 0) throws FileError;
2528 public weak string read_name ();
2529 public void rewind ();
2532 namespace DirUtils {
2533 [CCode (cname = "g_mkdir")]
2534 public static int create (string pathname, int mode);
2535 [CCode (cname = "g_mkdir_with_parents")]
2536 public static int create_with_parents (string pathname, int mode);
2537 [CCode (cname = "mkdtemp")]
2538 public static weak string mkdtemp (string template);
2539 [CCode (cname = "g_rmdir")]
2540 public static int remove (string filename);
2544 [CCode (free_function = "g_mapped_file_free")]
2545 public class MappedFile {
2546 public MappedFile (string filename, bool writable) throws FileError;
2547 public void free ();
2548 public long get_length ();
2549 public char* get_contents ();
2552 [CCode (cname = "stdin", cheader_filename = "stdio.h")]
2553 public static FileStream stdin;
2555 [CCode (cname = "stdout", cheader_filename = "stdio.h")]
2556 public static FileStream stdout;
2558 [CCode (cname = "stderr", cheader_filename = "stdio.h")]
2559 public static FileStream stderr;
2564 public const string RESERVED_CHARS_ALLOWED_IN_PATH;
2565 public const string RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT;
2566 public const string RESERVED_CHARS_ALLOWED_IN_USERINFO;
2567 public const string RESERVED_CHARS_GENERIC_DELIMITERS;
2568 public const string RESERVED_CHARS_SUBCOMPONENT_DELIMITERS;
2570 public static string parse_scheme (string uri);
2571 public static string escape_string (string unescaped, string reserved_chars_allowed, bool allow_utf8);
2572 public static string unescape_string (string escaped_string, string? illegal_characters = null);
2573 public static string unescape_segment (string escaped_string, string escaped_string_end, string? illegal_characters = null);
2574 [CCode (array_length = false, array_null_terminated = true)]
2575 public static string[] list_extract_uris (string uri_list);
2578 /* Shell-related Utilities */
2580 public errordomain ShellError {
2587 public static bool parse_argv (string command_line, [CCode (array_length_pos = 1.9)] out string[] argvp) throws ShellError;
2588 public static string quote (string unquoted_string);
2589 public static string unquote (string quoted_string) throws ShellError;
2592 /* Commandline option parser */
2594 public errordomain OptionError {
2601 [CCode (free_function = "g_option_context_free")]
2602 public class OptionContext {
2603 public OptionContext (string parameter_string);
2604 public void set_summary (string summary);
2605 public weak string get_summary ();
2606 public void set_description (string description);
2607 public void get_description ();
2608 public void set_translate_func (TranslateFunc func, DestroyNotify? destroy_notify);
2609 public void set_translation_domain (string domain);
2610 public bool parse ([CCode (array_length_pos = 0.9)] ref weak string[] argv) throws OptionError;
2611 public void set_help_enabled (bool help_enabled);
2612 public bool get_help_enabled ();
2613 public void set_ignore_unknown_options (bool ignore_unknown);
2614 public bool get_ignore_unknown_options ();
2615 public string get_help (bool main_help, OptionGroup? group);
2617 public void add_main_entries ([CCode (array_length = false)] OptionEntry[] entries, string? translation_domain);
2618 public void add_group (owned OptionGroup group);
2619 public void set_main_group (owned OptionGroup group);
2620 public weak OptionGroup get_main_group ();
2623 public delegate weak string TranslateFunc (string str);
2625 [CCode (has_type_id = false)]
2626 public enum OptionArg {
2639 [CCode (cprefix = "G_OPTION_FLAG_", has_type_id = false)]
2640 public enum OptionFlags {
2650 public struct OptionEntry {
2651 public weak string long_name;
2652 public char short_name;
2655 public OptionArg arg;
2656 public void* arg_data;
2658 public weak string description;
2659 public weak string arg_description;
2663 [CCode (free_function = "g_option_group_free")]
2664 public class OptionGroup {
2665 public OptionGroup (string name, string description, string help_description, void* user_data = null, DestroyNotify? destroy = null);
2666 public void add_entries ([CCode (array_length = false)] OptionEntry[] entries);
2667 public void set_parse_hooks (OptionParseFunc pre_parse_func, OptionParseFunc post_parse_hook);
2668 public void set_error_hook (OptionErrorFunc error_func);
2669 public void set_translate_func (TranslateFunc func, DestroyNotify? destroy_notify);
2670 public void set_translation_domain (string domain);
2673 [CCode (has_target = false)]
2674 public delegate bool OptionParseFunc (OptionContext context, OptionGroup group, void* data) throws OptionError;
2675 [CCode (has_target = false)]
2676 public delegate void OptionErrorFunc (OptionContext context, OptionGroup group, void* data, ref Error error);
2678 /* Perl-compatible regular expressions */
2680 public errordomain RegexError {
2687 [CCode (cprefix = "G_REGEX_", has_type_id = false)]
2688 public enum RegexCompileFlags {
2705 [CCode (cprefix = "G_REGEX_MATCH_", has_type_id = false)]
2706 public enum RegexMatchFlags {
2719 [CCode (ref_function = "g_regex_ref", unref_function = "g_regex_unref")]
2720 public class Regex {
2721 public Regex (string pattern, RegexCompileFlags compile_options = 0, RegexMatchFlags match_options = 0) throws RegexError;
2722 public unowned string get_pattern ();
2723 public int get_max_backref ();
2724 public int get_capture_count ();
2725 public int get_string_number (string name);
2726 public static string escape_string (string str, int length = -1);
2727 public static bool match_simple (string pattern, string str, RegexCompileFlags compile_options = 0, RegexMatchFlags match_options = 0);
2728 public bool match (string str, RegexMatchFlags match_options = 0, out MatchInfo match_info = null);
2729 public bool match_full (string str, long string_len = -1, int start_position = 0, RegexMatchFlags match_options = 0, out MatchInfo match_info = null) throws RegexError;
2730 public bool match_all (string str, RegexMatchFlags match_options = 0, out MatchInfo match_info = null);
2731 public bool match_all_full (string str, long string_len = -1, int start_position = 0, RegexMatchFlags match_options = 0, out MatchInfo match_info = null) throws RegexError;
2732 [CCode (array_length = false, array_null_terminated = true)]
2733 public static string[] split_simple (string pattern, string str, RegexCompileFlags compile_options = 0, RegexMatchFlags match_options = 0);
2734 [CCode (array_length = false, array_null_terminated = true)]
2735 public string[] split (string str, RegexMatchFlags match_options = 0);
2736 [CCode (array_length = false, array_null_terminated = true)]
2737 public string[] split_full (string str, long string_len = -1, int start_position = 0, RegexMatchFlags match_options = 0, int max_tokens = 0) throws RegexError;
2738 public string replace (string str, long string_len, int start_position, string replacement, RegexMatchFlags match_options = 0) throws RegexError;
2739 public string replace_literal (string str, long string_len, int start_position, string replacement, RegexMatchFlags match_options = 0) throws RegexError;
2740 public string replace_eval (string str, long string_len, int start_position, RegexMatchFlags match_options = 0, RegexEvalCallback eval, void* user_data) throws RegexError;
2741 public static bool check_replacement (out bool has_references = null) throws RegexError;
2744 [CCode (has_target = false)]
2745 public delegate bool RegexEvalCallback (MatchInfo match_info, StringBuilder result, void* user_data);
2748 [CCode (free_function = "g_match_info_free")]
2749 public class MatchInfo {
2750 public weak Regex get_regex ();
2751 public weak string get_string ();
2752 public bool matches ();
2753 public bool next () throws RegexError;
2754 public int get_match_count ();
2755 public bool is_partial_match ();
2756 public string expand_references (string string_to_expand) throws RegexError;
2757 public string? fetch (int match_num);
2758 public bool fetch_pos (int match_num, out int start_pos, out int end_pos);
2759 public string? fetch_named (string name);
2760 public bool fetch_named_pos (string name, out int start_pos, out int end_pos);
2761 [CCode (array_length = false, array_null_terminated = true)]
2762 public string[] fetch_all ();
2765 /* Simple XML Subset Parser */
2767 public errordomain MarkupError {
2777 [CCode (cprefix = "G_MARKUP_", has_type_id = false)]
2778 public enum MarkupParseFlags {
2783 [CCode (free_function = "g_markup_parse_context_free")]
2784 public class MarkupParseContext {
2785 public MarkupParseContext (MarkupParser parser, MarkupParseFlags _flags, void* user_data, DestroyNotify? user_data_dnotify);
2786 public bool parse (string text, long text_len) throws MarkupError;
2787 public bool end_parse () throws MarkupError;
2788 public weak string get_element ();
2789 public weak SList<string> get_element_stack ();
2790 public void get_position (out int line_number, out int char_number);
2791 public void push (MarkupParser parser, void* user_data);
2792 public void* pop (MarkupParser parser);
2795 public delegate void MarkupParserStartElementFunc (MarkupParseContext context, string element_name, [CCode (array_length = false, array_null_terminated = true)] string[] attribute_names, [CCode (array_length = false, array_null_terminated = true)] string[] attribute_values) throws MarkupError;
2797 public delegate void MarkupParserEndElementFunc (MarkupParseContext context, string element_name) throws MarkupError;
2799 public delegate void MarkupParserTextFunc (MarkupParseContext context, string text, ulong text_len) throws MarkupError;
2801 public delegate void MarkupParserPassthroughFunc (MarkupParseContext context, string passthrough_text, ulong text_len) throws MarkupError;
2803 public delegate void MarkupParserErrorFunc (MarkupParseContext context, Error error);
2805 public struct MarkupParser {
2806 public MarkupParserStartElementFunc start_element;
2807 public MarkupParserEndElementFunc end_element;
2808 public MarkupParserTextFunc text;
2809 public MarkupParserPassthroughFunc passthrough;
2810 public MarkupParserErrorFunc error;
2814 [CCode (cprefix = "G_MARKUP_COLLECT_", has_type_id = false)]
2815 public enum CollectType {
2824 public static string escape_text (string text, long length = -1);
2826 public static string printf_escaped (string format, ...);
2827 [CCode (sentinel = "G_MARKUP_COLLECT_INVALID")]
2828 public static bool collect_attributes (string element_name, string[] attribute_names, string[] attribute_values, ...) throws MarkupError;
2831 /* Key-value file parser */
2833 public errordomain KeyFileError {
2843 [CCode (free_function = "g_key_file_free")]
2844 public class KeyFile {
2846 public void set_list_separator (char separator);
2847 public bool load_from_file (string file, KeyFileFlags @flags) throws KeyFileError, FileError;
2848 public bool load_from_dirs (string file, [CCode (array_length = false, array_null_terminated = true)] string[] search_dirs, out string full_path, KeyFileFlags @flags) throws KeyFileError, FileError;
2849 public bool load_from_data (string data, ulong length, KeyFileFlags @flags) throws KeyFileError;
2850 public bool load_from_data_dirs (string file, out string full_path, KeyFileFlags @flags) throws KeyFileError, FileError;
2851 // g_key_file_to_data never throws an error according to the documentation
2852 public string to_data (out size_t length = null, out GLib.Error error = null);
2853 public string get_start_group ();
2854 [CCode (array_length_type = "gsize")]
2855 public string[] get_groups ();
2856 [CCode (array_length_type = "gsize")]
2857 public string[] get_keys (string group_name) throws KeyFileError;
2858 public bool has_group (string group_name);
2859 public bool has_key (string group_name, string key) throws KeyFileError;
2860 public string get_value (string group_name, string key) throws KeyFileError;
2861 public string get_string (string group_name, string key) throws KeyFileError;
2862 public string get_locale_string (string group_name, string key, string locale) throws KeyFileError;
2863 public bool get_boolean (string group_name, string key) throws KeyFileError;
2864 public int get_integer (string group_name, string key) throws KeyFileError;
2865 public double get_double (string group_name, string key) throws KeyFileError;
2866 [CCode (array_length_type = "gsize")]
2867 public string[] get_string_list (string group_name, string key) throws KeyFileError;
2868 [CCode (array_length_type = "gsize")]
2869 public string[] get_locale_string_list (string group_name, string key, string locale) throws KeyFileError;
2870 [CCode (array_length_type = "gsize")]
2871 public bool[] get_boolean_list (string group_name, string key) throws KeyFileError;
2872 [CCode (array_length_type = "gsize")]
2873 public int[] get_integer_list (string group_name, string key) throws KeyFileError;
2874 [CCode (array_length_type = "gsize")]
2875 public double[] get_double_list (string group_name, string key) throws KeyFileError;
2876 public string get_comment (string group_name, string key) throws KeyFileError;
2877 public void set_value (string group_name, string key, string value);
2878 public void set_string (string group_name, string key, string str);
2879 public void set_locale_string (string group_name, string key, string locale, string str);
2880 public void set_boolean (string group_name, string key, bool value);
2881 public void set_integer (string group_name, string key, int value);
2882 public void set_double (string group_name, string key, double value);
2883 public void set_string_list (string group_name, string key, string[] list);
2884 public void set_locale_string_list (string group_name, string key, string locale, string[] list);
2885 public void set_boolean_list (string group_name, string key, bool[] list);
2886 public void set_integer_list (string group_name, string key, int[] list);
2887 public void set_double_list (string group_name, string key, double[] list);
2888 public void set_comment (string group_name, string key, string comment) throws KeyFileError;
2889 public void remove_group (string group_name) throws KeyFileError;
2890 public void remove_key (string group_name, string key) throws KeyFileError;
2891 public void remove_comment (string group_name, string key) throws KeyFileError;
2894 [CCode (cprefix = "G_KEY_FILE_", has_type_id = false)]
2895 public enum KeyFileFlags {
2901 /* Bookmark file parser */
2904 [CCode (free_function = "g_bookmark_file_free")]
2905 public class BookmarkFile {
2906 public BookmarkFile ();
2907 public bool load_from_file (string file) throws BookmarkFileError;
2908 public bool load_from_data (string data, size_t length) throws BookmarkFileError;
2909 public bool load_from_data_dirs (string file, out string full_path) throws BookmarkFileError;
2910 public string to_data (out size_t length) throws BookmarkFileError;
2911 public bool to_file (string filename) throws BookmarkFileError;
2912 public bool has_item (string uri);
2913 public bool has_group (string uri, string group) throws BookmarkFileError;
2914 public bool has_application (string uri, string name) throws BookmarkFileError;
2915 public int get_size ();
2916 public string[] get_uris ();
2917 public string get_title (string uri) throws BookmarkFileError;
2918 public string get_description (string uri) throws BookmarkFileError;
2919 public string get_mime_type (string uri) throws BookmarkFileError;
2920 public bool get_is_private (string uri) throws BookmarkFileError;
2921 public bool get_icon (string uri, out string href, out string mime_type) throws BookmarkFileError;
2922 public long get_added (string uri) throws BookmarkFileError;
2923 public long get_modified (string uri) throws BookmarkFileError;
2924 public long get_visited (string uri) throws BookmarkFileError;
2925 public string[] get_groups (string uri) throws BookmarkFileError;
2926 public string[] get_applications (string uri) throws BookmarkFileError;
2927 public bool get_app_info (string uri, string name, out string exec, out uint count, out long stamp) throws BookmarkFileError;
2928 public void set_title (string uri, string title);
2929 public void set_description (string uri, string description);
2930 public void set_mime_type (string uri, string mime_type);
2931 public void set_is_private (string uri, bool is_private);
2932 public void set_icon (string uri, string href, string mime_type);
2933 public void set_added (string uri, long time_);
2934 public void set_groups (string uri, string[] groups);
2935 public void set_modified (string uri, long time_);
2936 public void set_visited (string uri, long time_);
2937 public bool set_app_info (string uri, string name, string exec, int count, long time_) throws BookmarkFileError;
2938 public void add_group (string uri, string group);
2939 public void add_application (string uri, string name, string exec);
2940 public bool remove_group (string uri, string group) throws BookmarkFileError;
2941 public bool remove_application (string uri, string name) throws BookmarkFileError;
2942 public bool remove_item (string uri) throws BookmarkFileError;
2943 public bool move_item (string old_uri, string new_uri) throws BookmarkFileError;
2946 public errordomain BookmarkFileError {
2961 public static void minimized_result (double minimized_quantity, string format, ...);
2963 public static void maximized_result (double maximized_quantity, string format, ...);
2964 public static void init ([CCode (array_length_pos = 0.9)] ref weak string[] args, ...);
2965 public static bool quick ();
2966 public static bool slow ();
2967 public static bool thorough ();
2968 public static bool perf ();
2969 public static bool verbose ();
2970 public static bool quiet ();
2971 public static int run ();
2972 public static void add_func (string testpath, Callback test_funcvoid);
2973 public static void add_data_func (string testpath, [CCode (delegate_target_pos = 1.9)] DataTestFunc test_funcvoid);
2975 public static void message (string format, ...);
2976 public static void bug_base (string uri_pattern);
2977 public static void bug (string bug_uri_snippet);
2978 public static void timer_start ();
2979 public static double timer_elapsed ();
2980 public static double timer_last ();
2981 public static bool trap_fork (uint64 usec_timeout, TestTrapFlags test_trap_flags);
2982 public static bool trap_has_passed ();
2983 public static bool trap_reached_timeout ();
2984 public static void trap_assert_passed ();
2985 public static void trap_assert_failed ();
2986 public static void trap_assert_stdout (string soutpattern);
2987 public static void trap_assert_stdout_unmatched (string soutpattern);
2988 public static void trap_assert_stderr (string serrpattern);
2989 public static void trap_assert_stderr_unmatched (string serrpattern);
2990 public static bool rand_bit ();
2991 public static int32 rand_int ();
2992 public static int32 rand_int_range (int32 begin, int32 end);
2993 public static double rand_double ();
2994 public static double rand_double_range ();
2998 [CCode (cname = "GTestCase", ref_function = "", unref_function = "")]
2999 public class TestCase {
3000 [CCode (cname = "g_test_create_case")]
3001 public TestCase (string test_name, [CCode (delegate_target_pos = 1.9, type = "void (*) ()")] TestFunc data_setup, [CCode (delegate_target_pos = 1.9, type = "void (*) ()")] TestFunc data_func, [CCode (delegate_target_pos = 1.9, type = "void (*) ()")] TestFunc data_teardown, [CCode (pos = 1.8)] size_t data_size = 0);
3005 [CCode (cname = "GTestSuite", ref_function = "", unref_function = "")]
3006 public class TestSuite {
3007 [CCode (cname = "g_test_create_suite")]
3008 public TestSuite (string name);
3009 [CCode (cname = "g_test_get_root")]
3010 public static TestSuite get_root ();
3011 [CCode (cname = "g_test_suite_add")]
3012 public void add (TestCase test_case);
3013 [CCode (cname = "g_test_suite_add_suite")]
3014 public void add_suite (TestSuite test_suite);
3017 public delegate void TestFunc (void* fixture);
3018 public delegate void DataTestFunc ();
3021 [CCode (cprefix = "G_TEST_TRAP_", has_type_id = false)]
3022 public enum TestTrapFlags {
3028 /* Doubly-Linked Lists */
3031 [CCode (dup_function = "g_list_copy", free_function = "g_list_free")]
3032 public class List<G> {
3035 [ReturnsModifiedPointer ()]
3036 public void append (owned G data);
3037 [ReturnsModifiedPointer ()]
3038 public void prepend (owned G data);
3039 [ReturnsModifiedPointer ()]
3040 public void insert (owned G data, int position);
3041 [ReturnsModifiedPointer ()]
3042 public void insert_before (List<G> sibling, owned G data);
3043 [ReturnsModifiedPointer ()]
3044 public void insert_sorted (owned G data, CompareFunc compare_func);
3045 [ReturnsModifiedPointer ()]
3046 public void remove (G data);
3047 [ReturnsModifiedPointer ()]
3048 public void remove_link (List<G> llink);
3049 [ReturnsModifiedPointer ()]
3050 public void delete_link (List<G> link_);
3051 [ReturnsModifiedPointer ()]
3052 public void remove_all (G data);
3054 public uint length ();
3055 public List<weak G> copy ();
3056 [ReturnsModifiedPointer ()]
3057 public void reverse ();
3058 [ReturnsModifiedPointer ()]
3059 public void sort (CompareFunc compare_func);
3060 [ReturnsModifiedPointer ()]
3061 public void insert_sorted_with_data (owned G data, CompareDataFunc compare_func);
3062 [ReturnsModifiedPointer ()]
3063 public void sort_with_data (CompareDataFunc compare_func);
3064 [ReturnsModifiedPointer ()]
3065 public void concat (owned List<G> list2);
3066 public void @foreach (Func func);
3068 public weak List<G> first ();
3069 public weak List<G> last ();
3070 public weak List<G> nth (uint n);
3071 public weak G nth_data (uint n);
3072 public weak List<G> nth_prev (uint n);
3074 public weak List<G> find (G data);
3075 public weak List<G> find_custom (G data, CompareFunc func);
3076 public int position (List<G> llink);
3077 public int index (G data);
3080 public List<G> next;
3081 public weak List<G> prev;
3084 /* Singly-Linked Lists */
3087 [CCode (dup_function = "g_slist_copy", free_function = "g_slist_free")]
3088 public class SList<G> {
3091 [ReturnsModifiedPointer ()]
3092 public void append (owned G data);
3093 [ReturnsModifiedPointer ()]
3094 public void prepend (owned G data);
3095 [ReturnsModifiedPointer ()]
3096 public void insert (owned G data, int position);
3097 [ReturnsModifiedPointer ()]
3098 public void insert_before (SList<G> sibling, owned G data);
3099 [ReturnsModifiedPointer ()]
3100 public void insert_sorted (owned G data, CompareFunc compare_func);
3101 [ReturnsModifiedPointer ()]
3102 public void remove (G data);
3103 [ReturnsModifiedPointer ()]
3104 public void remove_link (SList<G> llink);
3105 [ReturnsModifiedPointer ()]
3106 public void delete_link (SList<G> link_);
3107 [ReturnsModifiedPointer ()]
3108 public void remove_all (G data);
3110 public uint length ();
3111 public SList<weak G> copy ();
3112 [ReturnsModifiedPointer ()]
3113 public void reverse ();
3114 [ReturnsModifiedPointer ()]
3115 public void insert_sorted_with_data (owned G data, CompareDataFunc compare_func);
3116 [ReturnsModifiedPointer ()]
3117 public void sort (CompareFunc compare_func);
3118 [ReturnsModifiedPointer ()]
3119 public void sort_with_data (CompareDataFunc compare_func);
3120 [ReturnsModifiedPointer ()]
3121 public void concat (owned SList<G> list2);
3122 public void @foreach (Func func);
3124 public weak SList<G> last ();
3125 public weak SList<G> nth (uint n);
3126 public weak G nth_data (uint n);
3128 public weak SList<G> find (G data);
3129 public weak SList<G> find_custom (G data, CompareFunc func);
3130 public int position (SList<G> llink);
3131 public int index (G data);
3134 public SList<G> next;
3137 [CCode (has_target = false)]
3138 public delegate int CompareFunc (void* a, void* b);
3140 public delegate int CompareDataFunc (void* a, void* b);
3142 [CCode (cname = "strcmp")]
3143 public static GLib.CompareFunc strcmp;
3145 /* Double-ended Queues */
3148 [CCode (dup_function = "g_queue_copy", free_function = "g_queue_free")]
3149 public class Queue<G> {
3150 public weak List<G> head;
3151 public weak List<G> tail;
3156 public void clear ();
3157 public bool is_empty ();
3158 public uint get_length ();
3159 public void reverse ();
3160 public Queue copy ();
3161 public weak List<G> find (G data);
3162 public weak List<G> find_custom (G data, CompareFunc func);
3163 public void sort (CompareDataFunc compare_func);
3164 public void push_head (owned G data);
3165 public void push_tail (owned G data);
3166 public void push_nth (owned G data, int n);
3167 public G pop_head ();
3168 public G pop_tail ();
3169 public G pop_nth (uint n);
3170 public weak G peek_head ();
3171 public weak G peek_tail ();
3172 public weak G peek_nth (uint n);
3173 public int index (G data);
3174 public void remove (G data);
3175 public void remove_all (G data);
3176 public void insert_before (List<G> sibling, owned G data);
3177 public void insert_after (List<G> sibling, owned G data);
3178 public void insert_sorted (owned G data, CompareDataFunc func);
3184 [CCode (free_function = "g_sequence_free")]
3185 public class Sequence<G> {
3186 public Sequence (DestroyNotify? data_destroy);
3187 public int get_length ();
3188 public void @foreach (Func func);
3189 public static void foreach_range (SequenceIter<G> begin, SequenceIter<G> end, Func func);
3190 public void sort (CompareDataFunc cmp_func);
3191 public void sort_iter (SequenceIterCompareFunc<G> func);
3192 public SequenceIter<G> get_begin_iter ();
3193 public SequenceIter<G> get_end_iter ();
3194 public SequenceIter<G> get_iter_at_pos (int pos);
3195 public SequenceIter<G> append (owned G data);
3196 public SequenceIter<G> prepend (owned G data);
3197 public static SequenceIter<G> insert_before (SequenceIter<G> iter, owned G data);
3198 public static void move (SequenceIter<G> src, SequenceIter<G> dest);
3199 public static void swap (SequenceIter<G> src, SequenceIter<G> dest);
3200 public SequenceIter<G> insert_sorted (owned G data, CompareDataFunc cmp_func);
3201 public SequenceIter<G> insert_sorted_iter (owned G data, SequenceIterCompareFunc<G> iter_cmp);
3202 public static void sort_changed (SequenceIter<G> iter, CompareDataFunc cmp_func);
3203 public static void sort_changed_iter (SequenceIter<G> iter, SequenceIterCompareFunc<G> iter_cmp);
3204 public static void remove (SequenceIter<G> iter);
3205 public static void remove_range (SequenceIter<G> begin, SequenceIter<G> end);
3206 public static void move_range (SequenceIter<G> dest, SequenceIter<G> begin, SequenceIter<G> end);
3207 public SequenceIter<G> search (G data, CompareDataFunc cmp_func);
3208 public SequenceIter<G> search_iter (G data, SequenceIterCompareFunc<G> iter_cmp);
3209 public static weak G get (SequenceIter<G> iter);
3210 public static void set (SequenceIter<G> iter, owned G data);
3211 public static SequenceIter<G> range_get_midpoint (SequenceIter<G> begin, SequenceIter<G> end);
3215 [CCode (ref_function = "", unref_function = "")]
3216 public class SequenceIter<G> {
3217 public bool is_begin ();
3218 public bool is_end ();
3219 public SequenceIter<G> next ();
3220 public SequenceIter<G> prev ();
3221 public int get_position ();
3222 public SequenceIter<G> move (int delta);
3223 public Sequence<G> get_sequence ();
3224 public int compare (SequenceIter<G> other);
3226 [CCode (cname = "g_sequence_get")]
3227 public weak G get ();
3230 public delegate int SequenceIterCompareFunc<G> (SequenceIter<G> a, SequenceIter<G> b);
3235 [CCode (ref_function = "g_hash_table_ref", unref_function = "g_hash_table_unref", type_id = "G_TYPE_HASH_TABLE", type_signature = "a{%s}")]
3236 public class HashTable<K,V> {
3237 public HashTable (HashFunc? hash_func, EqualFunc? key_equal_func);
3238 public HashTable.full (HashFunc? hash_func, EqualFunc? key_equal_func, DestroyNotify? key_destroy_func, DestroyNotify? value_destroy_func);
3239 public void insert (owned K key, owned V value);
3240 public void replace (owned K key, owned V value);
3241 public weak V lookup (K key);
3242 public bool remove (K key);
3243 public void remove_all ();
3244 public List<weak K> get_keys ();
3245 public List<weak V> get_values ();
3246 public void @foreach (HFunc func);
3247 [CCode (cname = "g_hash_table_foreach")]
3248 public void for_each (HFunc func);
3249 public uint size ();
3250 public bool steal (K key);
3251 public void steal_all ();
3254 public struct HashTableIter<K,V> {
3255 public HashTableIter (GLib.HashTable<K,V> table);
3256 public bool next (out unowned K key, out unowned V value);
3257 public void remove ();
3258 public void steal ();
3259 public unowned GLib.HashTable<K,V> get_hash_table ();
3262 [CCode (has_target = false)]
3263 public static delegate uint HashFunc (void* key);
3264 [CCode (has_target = false)]
3265 public static delegate bool EqualFunc (void* a, void* b);
3266 public delegate void HFunc (void* key, void* value);
3268 [CCode (has_target = false)]
3269 public static delegate void DestroyNotify (void* data);
3271 [CCode (cname = "g_direct_hash")]
3272 public static GLib.HashFunc direct_hash;
3273 [CCode (cname = "g_direct_equal")]
3274 public static GLib.EqualFunc direct_equal;
3275 [CCode (cname = "g_int_hash")]
3276 public static GLib.HashFunc int_hash;
3277 [CCode (cname = "g_int_equal")]
3278 public static GLib.EqualFunc int_equal;
3279 [CCode (cname = "g_str_hash")]
3280 public static GLib.HashFunc str_hash;
3281 [CCode (cname = "g_str_equal")]
3282 public static GLib.EqualFunc str_equal;
3283 [CCode (cname = "g_free")]
3284 public static GLib.DestroyNotify g_free;
3285 [CCode (cname = "g_object_unref")]
3286 public static GLib.DestroyNotify g_object_unref;
3287 [CCode (cname = "g_list_free")]
3288 public static GLib.DestroyNotify g_list_free;
3289 [CCode (cname = "((GDestroyNotify) g_variant_unref)")]
3290 public static GLib.DestroyNotify g_variant_unref;
3295 [CCode (cname = "GString", cprefix = "g_string_", free_function = "g_string_free", type_id = "G_TYPE_GSTRING")]
3296 public class StringBuilder {
3297 public StringBuilder (string init = "");
3298 [CCode (cname = "g_string_sized_new")]
3299 public StringBuilder.sized (ulong dfl_size);
3300 public weak StringBuilder assign (string rval);
3301 public weak StringBuilder append (string val);
3302 public weak StringBuilder append_c (char c);
3303 public weak StringBuilder append_unichar (unichar wc);
3304 public weak StringBuilder append_len (string val, long len);
3305 public weak StringBuilder prepend (string val);
3306 public weak StringBuilder prepend_c (char c);
3307 public weak StringBuilder prepend_unichar (unichar wc);
3308 public weak StringBuilder prepend_len (string val, long len);
3309 public weak StringBuilder insert (long pos, string val);
3310 public weak StringBuilder erase (long pos, long len);
3311 public weak StringBuilder truncate (size_t len);
3314 public void printf (string format, ...);
3316 public void append_printf (string format, ...);
3320 public long allocated_len;
3326 [CCode (free_function = "g_string_chunk_free")]
3327 public class StringChunk {
3328 public StringChunk (size_t size);
3329 public weak string insert (string str);
3330 public weak string insert_const (string str);
3331 public weak string insert_len (string str, ssize_t len);
3332 public void clear ();
3335 /* Pointer Arrays */
3338 [CCode (free_function = "g_ptr_array_free")]
3339 public class PtrArray {
3341 [CCode (cname = "g_ptr_array_sized_new")]
3342 public PtrArray.sized (uint reserved_size);
3343 public void add (void* data);
3344 public bool remove (void* data);
3345 public void* remove_index (uint index);
3346 public bool remove_fast (void *data);
3347 public void remove_range (uint index, uint length);
3348 public void sort (CompareFunc compare_func);
3349 public void sort_with_data (CompareDataFunc compare_func);
3350 public void set_size (uint length);
3353 public void** pdata;
3359 [CCode (cprefix = "g_byte_array_", free_function = "g_byte_array_free")]
3360 public class ByteArray {
3361 public ByteArray ();
3362 [CCode (cname = "g_byte_array_sized_new")]
3363 public ByteArray.sized (uint reserved_size);
3364 public void append (uint8[] data);
3365 public void prepend (uint8[] data);
3366 public void remove_index (uint index);
3367 public void remove_index_fast (uint index);
3368 public void remove_range (uint index, uint length);
3369 public void sort (CompareFunc compare_func);
3370 public void sort_with_data (CompareDataFunc compare_func);
3371 public void set_size (uint length);
3374 [CCode (array_length_cname = "len", array_length_type = "guint")]
3375 public uint8[] data;
3381 [CCode (free_function = "g_node_destroy")]
3382 public class Node<G> {
3387 public Node children;
3392 [CCode (type_id = "G_TYPE_UINT")]
3393 public struct Quark : uint32 {
3394 public static Quark from_string (string str);
3395 public static Quark try_string (string str);
3396 public weak string to_string ();
3399 /* Keyed Data Lists */
3401 [CCode (cname = "GData*")]
3402 public struct Datalist<G> {
3404 public void clear ();
3405 public weak G id_get_data (Quark key_id);
3406 public void id_set_data (Quark key_id, owned G data);
3407 public void id_set_data_full (Quark key_id, owned G data, DestroyNotify? destroy_func);
3408 public void id_remove_data (Quark key_id);
3409 public G id_remove_no_notify (Quark key_id);
3410 public void @foreach (DataForeachFunc func);
3411 public weak G get_data (string key);
3412 public void set_data_full (string key, owned G data, DestroyNotify? destry_func);
3413 public G remove_no_notify (string key);
3414 public void set_data (string key, owned G data);
3415 public void remove_data (string key);
3418 public delegate void DataForeachFunc<G> (Quark key_id, G data);
3423 public class Array<G> {
3424 [CCode (cname = "len")]
3427 public Array (bool zero_terminated, bool clear, uint element_size);
3428 [CCode (cname = "g_array_sized_new")]
3429 public Array.sized (bool zero_terminated, bool clear, uint element_size, uint reserved_size);
3430 public void append_val (G value);
3431 public void append_vals (void* data, uint len);
3432 public void prepend_val (G value);
3433 public void prepend_vals (void* data, uint len);
3434 public void insert_val (uint index, G value);
3435 public void insert_vals (uint index, void* data, uint len);
3436 public void remove_index (uint index);
3437 public void remove_index_fast (uint index);
3438 public void remove_range (uint index, uint length);
3439 public void sort (CompareFunc compare_func);
3440 public void sort_with_data (CompareDataFunc compare_func);
3441 [CCode (generic_type_pos = 0.1)]
3442 public G index (uint index);
3443 public void set_size (uint length);
3448 public delegate int TraverseFunc (void* key, void* value);
3450 [CCode (c_prefix="C_", has_type_id = false)]
3451 public enum TraverseType {
3460 [CCode (ref_function = "g_tree_ref", unref_function = "g_tree_unref")]
3462 [CCode (free_function = "g_tree_destroy")]
3464 public class Tree<K,V> {
3465 public Tree (CompareFunc key_compare_func);
3466 public Tree.with_data (CompareDataFunc key_compare_func);
3467 public Tree.full (CompareDataFunc key_compare_func, DestroyNotify? key_destroy_func, DestroyNotify? value_destroy_func);
3468 public void insert (owned K key, owned V value);
3469 public void replace (owned K key, owned V value);
3470 public int nnodes ();
3471 public int height ();
3472 public weak V lookup (K key);
3473 public bool lookup_extended (K lookup_key, K orig_key, V value);
3474 public void foreach (TraverseFunc traverse_func);
3475 public weak V search (CompareFunc search_func, void* user_data);
3476 public bool remove (K key);
3477 public bool steal (K key);
3480 /* Internationalization */
3482 [CCode (cname = "_", cheader_filename = "glib.h,glib/gi18n-lib.h")]
3483 public static weak string _ (string str);
3484 [CCode (cname = "Q_", cheader_filename = "glib.h,glib/gi18n-lib.h")]
3485 public static weak string Q_ (string str);
3486 [CCode (cname = "N_", cheader_filename = "glib.h,glib/gi18n-lib.h")]
3487 public static weak string N_ (string str);
3488 [CCode (cname = "ngettext", cheader_filename = "glib.h,glib/gi18n-lib.h")]
3489 public static weak string ngettext (string msgid, string msgid_plural, ulong n);
3491 [CCode (cname = "int", cprefix = "LC_", cheader_filename = "locale.h", has_type_id = false)]
3492 public enum LocaleCategory {
3503 [CCode (cname = "setlocale", cheader_filename = "locale.h")]
3504 public static weak string? setlocale (LocaleCategory category, string? locale);
3505 [CCode (cname = "bindtextdomain", cheader_filename = "glib/gi18n-lib.h")]
3506 public static weak string? bindtextdomain (string domainname, string? dirname);
3507 [CCode (cname = "textdomain", cheader_filename = "glib/gi18n-lib.h")]
3508 public static weak string? textdomain (string? domainname);
3509 [CCode (cname = "bind_textdomain_codeset", cheader_filename = "glib/gi18n-lib.h")]
3510 public static weak string? bind_textdomain_codeset (string domainname, string? codeset);
3511 [CCode (cname = "g_get_language_names", array_length = false, array_null_terminated = true)]
3512 public static weak string[] get_language_names ();
3516 public class PatternSpec {
3517 public PatternSpec (string pattern);
3518 public bool equal (PatternSpec pspec);
3519 [CCode (cname = "g_pattern_match")]
3520 public bool match (uint string_length, string str, string? str_reversed);
3521 [CCode (cname = "g_pattern_match_string")]
3522 public bool match_string (string str);
3523 [CCode (cname = "g_pattern_match_simple")]
3524 public static bool match_simple (string pattern, string str);
3528 public string error_message (int error);
3529 public string getlocale ();
3530 public string get_package_installation_directory_of_module (void* hmodule);
3531 public uint get_windows_version ();
3532 public string locale_filename_from_utf8 (string utf8filename);
3533 [CCode (cname = "G_WIN32_HAVE_WIDECHAR_API")]
3534 public bool have_widechar_api ();
3535 [CCode (cname = "G_WIN32_IS_NT_BASED")]
3536 public bool is_nt_based ();
3540 public enum VariantTypeClass {
3562 public bool is_container ();
3563 public bool is_basic ();
3567 [CCode (copy_function = "g_variant_type_copy", free_function = "g_variant_type_free")]
3568 public class VariantType {
3569 [CCode (cname = "G_VARIANT_TYPE_BOOLEAN")]
3570 public static VariantType BOOLEAN;
3571 [CCode (cname = "G_VARIANT_TYPE_BYTE")]
3572 public static VariantType BYTE;
3573 [CCode (cname = "G_VARIANT_TYPE_INT16")]
3574 public static VariantType INT16;
3575 [CCode (cname = "G_VARIANT_TYPE_UINT16")]
3576 public static VariantType UINT16;
3577 [CCode (cname = "G_VARIANT_TYPE_INT32")]
3578 public static VariantType INT32;
3579 [CCode (cname = "G_VARIANT_TYPE_UINT32")]
3580 public static VariantType UINT32;
3581 [CCode (cname = "G_VARIANT_TYPE_INT64")]
3582 public static VariantType INT64;
3583 [CCode (cname = "G_VARIANT_TYPE_UINT64")]
3584 public static VariantType UINT64;
3585 [CCode (cname = "G_VARIANT_TYPE_DOUBLE")]
3586 public static VariantType DOUBLE;
3587 [CCode (cname = "G_VARIANT_TYPE_STRING")]
3588 public static VariantType STRING;
3589 [CCode (cname = "G_VARIANT_TYPE_OBJECT_PATH")]
3590 public static VariantType OBJECT_PATH;
3591 [CCode (cname = "G_VARIANT_TYPE_SIGNATURE")]
3592 public static VariantType SIGNATURE;
3593 [CCode (cname = "G_VARIANT_TYPE_VARIANT")]
3594 public static VariantType VARIANT;
3595 [CCode (cname = "G_VARIANT_TYPE_UNIT")]
3596 public static VariantType UNIT;
3597 [CCode (cname = "G_VARIANT_TYPE_ANY")]
3598 public static VariantType ANY;
3599 [CCode (cname = "G_VARIANT_TYPE_ANY_BASIC")]
3600 public static VariantType ANY_BASIC;
3601 [CCode (cname = "G_VARIANT_TYPE_ANY_MAYBE")]
3602 public static VariantType ANY_MAYBE;
3603 [CCode (cname = "G_VARIANT_TYPE_ANY_ARRAY")]
3604 public static VariantType ANY_ARRAY;
3605 [CCode (cname = "G_VARIANT_TYPE_ANY_STRUCT")]
3606 public static VariantType ANY_STRUCT;
3607 [CCode (cname = "G_VARIANT_TYPE_ANY_DICT_ENTRY")]
3608 public static VariantType ANY_DICT_ENTRY;
3609 [CCode (cname = "G_VARIANT_TYPE_ANY_DICTIONARY")]
3610 public static VariantType ANY_DICTIONARY;
3612 public static bool string_is_valid (string type_string);
3613 public static bool string_scan (string type_string, char *limit = null, out char* endptr = null);
3615 public VariantType (string type_string);
3617 size_t get_string_length ();
3618 weak string peek_string ();
3619 string[] dup_string ();
3621 public bool is_concrete ();
3622 public bool is_container ();
3623 public bool is_basic ();
3625 public uint hash ();
3626 public bool equal (VariantType other);
3627 public bool matches (VariantType pattern);
3628 public bool is_in_class (VariantTypeClass class);
3629 public VariantTypeClass get_class ();
3631 public weak VariantType element ();
3632 public weak VariantType first ();
3633 public weak VariantType next ();
3634 public uint n_items ();
3635 public weak VariantType key ();
3636 public weak VariantType value ();
3638 public VariantType.array (VariantType element);
3639 public VariantType.maybe (VariantType element);
3640 public VariantType.dict_entry (VariantType key, VariantType value);
3644 [CCode (ref_function = "g_variant_ref", unref_function = "g_variant_unref", ref_sink_function = "g_variant_ref_sink", type_id = "G_TYPE_VARIANT", type_signature = "v")]
3645 public class Variant {
3646 public void flatten ();
3648 public VariantTypeClass get_type_class ();
3649 public weak VariantType get_type ();
3650 public weak string get_type_string ();
3651 public bool is_basic ();
3652 public bool is_container ();
3653 public bool matches (VariantType type);
3655 public Variant (string format_string, ...);
3656 public void get (string format_string, ...);
3657 public static bool format_string_scan (string string, char* limit = null, out char* endptr = null);
3658 public static VariantType format_string_scan_type (string string, char* limit = null, out char* endptr = null);
3660 public Variant.boolean (bool value);
3661 public Variant.byte (uint8 value);
3662 public Variant.int16 (int16 value);
3663 public Variant.uint16 (uint16 value);
3664 public Variant.int32 (int32 value);
3665 public Variant.uint32 (uint32 value);
3666 public Variant.int64 (int64 value);
3667 public Variant.uint64 (uint64 value);
3668 public Variant.double (double value);
3669 public Variant.string (string value);
3670 public Variant.strv (string[] value);
3671 public static bool is_object_path (string object_path);
3672 public Variant.object_path (string object_path);
3673 public static bool is_signature (string signature);
3674 public Variant.signature (string signature);
3675 public Variant.variant (Variant value);
3677 public bool get_boolean ();
3678 public uint8 get_byte ();
3679 public int16 get_int16 ();
3680 public uint16 get_uint16 ();
3681 public int32 get_int32 ();
3682 public uint32 get_uint32 ();
3683 public int64 get_int64 ();
3684 public uint64 get_uint64 ();
3685 public double get_double ();
3686 public weak string get_string (out size_t length);
3687 public string dup_string (out size_t length);
3688 public string*[] get_strv ();
3689 public string[] dup_strv ();
3690 public Variant get_variant ();
3692 public void* get_fixed (size_t size);
3693 public void* get_fixed_array (size_t elem_size, out uint length);
3695 public uint n_children ();
3696 public Variant get_child_value (uint index);
3697 public void get_child (uint index, string format_string, ...);
3699 public Variant lookup_value (string key);
3700 public Variant lookup (string key, string format_string, ...);
3702 public string print (bool type_annotate);
3703 public StringBuilder print_string (StringBuilder ?string, bool type_annotate);
3704 public static Variant parse (string text, int text_length, VariantType? type) throws Error;
3705 public Variant.parsed (string format_string, ...);
3707 public string markup_print (bool newlines, int indentation, int tabstop);
3708 public StringBuilder markup_print_string (StringBuilder ?string, bool newlines, int indentation, int tabstop);