alternative to assert
[gtkD.git] / gtkD / src / gtkc / glibtypes.d
blob5ebdce7df2e8c94f7c7fa25dce9d53d904eaf5f3
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
23 module gtkc.glibtypes;
25 /* The GLib Basic Types */
26 public alias int gint;
27 public alias uint guint;
28 public alias int gboolean;
29 public alias void* gpointer;
30 public alias void* gconstpointer;
31 public alias char gchar;
32 public alias char guchar;
33 public alias short gshort;
34 public alias ushort gushort;
35 public alias int glong;
36 public alias uint gulong;
37 public alias byte gint8;
38 public alias byte guint8;
39 public alias short gint16;
40 public alias ushort guint16;
41 public alias int gint32;
42 public alias long gint64;
43 public alias uint guint32;
44 public alias ulong guint64;
45 public alias float gfloat;
46 public alias double gdouble;
47 public alias uint gsize;
48 public alias int gssize;
49 public alias void* va_list;
50 public alias dchar unichar;
51 public alias wchar unichar2;
52 //public alias dchar gunichar;
53 //public alias wchar gunichar2;
54 public alias int time_t;
57 const uint G_MAXUINT = 4294967295;
60 /**
61 * typedef int GPid;
62 * A type which is used to hold a process identification.
63 * On Unix, processes are identified by a process id (an
64 * integer), while Windows uses process handles (which are
65 * pointers).
67 public alias int GPid;
69 /**
70 * typedef guint32 gunichar;
71 * A type which can hold any UCS-4 character code.
73 public alias uint gunichar;
75 /**
76 * typedef guint16 gunichar2;
77 * A type which can hold any UTF-16 code
78 * point[3].
80 public alias ushort gunichar2;
82 /**
83 * typedef gint32 GTime;
84 * Simply a replacement for time_t. It has been deprected
85 * since it is not equivalent to time_t
86 * on 64-bit platforms with a 64-bit time_t.
87 * Unrelated to GTimer.
88 * Note that GTime is defined to always be a 32bit integer,
89 * unlike time_t which may be 64bit on some systems.
90 * Therefore, GTime will overflow in the year 2038, and
91 * you cannot use the address of a GTime variable as argument
92 * to the UNIX time() function. Instead, do the following:
93 * time_t ttime;
94 * GTime gtime;
95 * time (ttime);
96 * gtime = (GTime)ttime;
98 public alias int GTime;
101 * typedef guint8 GDateDay; /+* day of the month +/
102 * Integer representing a day of the month; between 1 and
103 * 31. G_DATE_BAD_DAY represents an invalid day of the month.
105 public alias byte GDateDay;
108 * typedef guint16 GDateYear;
109 * Integer representing a year; G_DATE_BAD_YEAR is the invalid
110 * value. The year must be 1 or higher; negative (BC) years are not
111 * allowed. The year is represented with four digits.
113 public alias ushort GDateYear;
116 * typedef guint32 GQuark;
117 * A GQuark is an integer which uniquely identifies a particular string.
119 public alias uint GQuark;
121 * Flags passed to g_module_open(). Note that these flags are
122 * not supported on all platforms.
123 * G_MODULE_BIND_LAZY
124 * specifies that symbols are only resolved when needed.
126 public enum GModuleFlags
128 BIND_LAZY = 1 << 0,
129 BIND_LOCAL = 1 << 1,
130 BIND_MASK = 0x03
132 alias GModuleFlags ModuleFlags;
135 * An enumeration specifying the base position for a g_io_channel_seek_position()
136 * operation.
137 * G_SEEK_CUR
138 * the current position in the file.
139 * G_SEEK_SET
140 * the start of the file.
141 * G_SEEK_END
142 * the end of the file.
144 public enum GSeekType
146 CUR,
147 SET,
150 alias GSeekType SeekType;
153 * Stati returned by most of the GIOFuncs functions.
154 * G_IO_STATUS_ERROR
155 * An error occurred.
156 * G_IO_STATUS_NORMAL
157 * Success.
158 * G_IO_STATUS_EOF
159 * End of file.
160 * G_IO_STATUS_AGAIN
161 * Resource temporarily unavailable.
163 public enum GIOStatus
165 ERROR,
166 NORMAL,
167 EOF,
168 AGAIN
170 alias GIOStatus IOStatus;
173 * Error codes returned by GIOChannel operations.
174 * G_IO_CHANNEL_ERROR_FBIG
175 * File too large.
176 * G_IO_CHANNEL_ERROR_INVAL
177 * Invalid argument.
178 * G_IO_CHANNEL_ERROR_IO
179 * IO error.
180 * G_IO_CHANNEL_ERROR_ISDIR
181 * File is a directory.
182 * G_IO_CHANNEL_ERROR_NOSPC
183 * No space left on device.
184 * G_IO_CHANNEL_ERROR_NXIO
185 * No such device or address.
186 * G_IO_CHANNEL_ERROR_OVERFLOW
187 * Value too large for defined datatype.
188 * G_IO_CHANNEL_ERROR_PIPE
189 * Broken pipe.
190 * G_IO_CHANNEL_ERROR_FAILED
191 * Some other error.
193 public enum GIOChannelError
195 /+* Derived from errno +/
196 G_IO_CHANNEL_ERROR_FBIG,
197 G_IO_CHANNEL_ERROR_INVAL,
198 G_IO_CHANNEL_ERROR_IO,
199 G_IO_CHANNEL_ERROR_ISDIR,
200 G_IO_CHANNEL_ERROR_NOSPC,
201 G_IO_CHANNEL_ERROR_NXIO,
202 G_IO_CHANNEL_ERROR_OVERFLOW,
203 G_IO_CHANNEL_ERROR_PIPE,
204 /+* Other +/
205 G_IO_CHANNEL_ERROR_FAILED
207 alias GIOChannelError IOChannelError;
210 * A bitwise combination representing a condition to watch for on an event
211 * source.
212 * G_IO_IN
213 * There is data to read.
214 * G_IO_OUT
215 * Data can be written (without blocking).
216 * G_IO_PRI
217 * There is urgent data to read.
218 * G_IO_ERR
219 * Error condition.
220 * G_IO_HUP
221 * Hung up (the connection has been broken, usually for pipes
223 public enum GIOCondition
225 IN =1,
226 OUT =4,
227 PRI =2,
228 ERR =8,
229 HUP =16,
230 NVAL =32
232 alias GIOCondition IOCondition;
235 * Specifies properties of a GIOChannel. Some of the flags can only
236 * be read with g_io_channel_get_flags(), but not changed with
237 * g_io_channel_set_flags().
238 * G_IO_FLAG_APPEND
239 * turns on append mode, corresponds to O_APPEND (see the
241 public enum GIOFlags
243 APPEND = 1 << 0,
244 NONBLOCK = 1 << 1,
245 IS_READABLE = 1 << 2, /+* Read only flag +/
246 IS_WRITEABLE = 1 << 3, /+* Read only flag +/
247 IS_SEEKABLE = 1 << 4, /+* Read only flag +/
248 MASK = (1 << 5) - 1,
249 GET_MASK = MASK,
250 SET_MASK = APPEND | NONBLOCK
252 alias GIOFlags IOFlags;
255 * GIOError is only used by the deprecated functions g_io_channel_read(),
256 * g_io_channel_write(), and g_io_channel_seek().
257 * G_IO_ERROR_NONE
258 * no error
259 * G_IO_ERROR_AGAIN
260 * an EAGAIN error occurred
261 * G_IO_ERROR_INVAL
262 * an EINVAL error occurred
263 * G_IO_ERROR_UNKNOWN
264 * another error occurred
266 public enum GIOError
268 NONE,
269 AGAIN,
270 INVAL,
271 UNKNOWN
273 alias GIOError IOError;
276 * Flags specifying the level of log messages.
278 public enum GLogLevelFlags
280 /+* log flags +/
281 G_LOG_FLAG_RECURSION = 1 << 0,
282 G_LOG_FLAG_FATAL = 1 << 1,
283 /+* GLib log levels +/
284 G_LOG_LEVEL_ERROR = 1 << 2, /+* always fatal +/
285 G_LOG_LEVEL_CRITICAL = 1 << 3,
286 G_LOG_LEVEL_WARNING = 1 << 4,
287 G_LOG_LEVEL_MESSAGE = 1 << 5,
288 G_LOG_LEVEL_INFO = 1 << 6,
289 G_LOG_LEVEL_DEBUG = 1 << 7,
290 G_LOG_LEVEL_MASK = ~(G_LOG_FLAG_RECURSION | G_LOG_FLAG_FATAL)
292 alias GLogLevelFlags LogLevelFlags;
295 * Error codes returned by character set conversion routines.
296 * G_CONVERT_ERROR_NO_CONVERSION
297 * Conversion between the requested character sets
298 * is not supported.
299 * G_CONVERT_ERROR_ILLEGAL_SEQUENCE
300 * Invalid byte sequence in conversion input.
301 * G_CONVERT_ERROR_FAILED
302 * Conversion failed for some reason.
303 * G_CONVERT_ERROR_PARTIAL_INPUT
304 * Partial character sequence at end of input.
305 * G_CONVERT_ERROR_BAD_URI
306 * URI is invalid.
307 * G_CONVERT_ERROR_NOT_ABSOLUTE_PATH
308 * Pathname is not an absolute path.
310 public enum GConvertError
312 NO_CONVERSION,
313 ILLEGAL_SEQUENCE,
314 FAILED,
315 PARTIAL_INPUT,
316 BAD_URI,
317 NOT_ABSOLUTE_PATH
319 alias GConvertError ConvertError;
322 * These are the possible character classifications from the
323 * Unicode specification.
324 * See http://www.unicode.org/Public/UNIDATA/UnicodeData.html.
325 * G_UNICODE_CONTROL
326 * General category "Other, Control" (Cc)
327 * G_UNICODE_FORMAT
328 * General category "Other, Format" (Cf)
329 * G_UNICODE_UNASSIGNED
330 * General category "Other, Not Assigned" (Cn)
331 * G_UNICODE_PRIVATE_USE
332 * General category "Other, Private Use" (Co)
333 * G_UNICODE_SURROGATE
334 * General category "Other, Surrogate" (Cs)
335 * G_UNICODE_LOWERCASE_LETTER
336 * General category "Letter, Lowercase" (Ll)
337 * G_UNICODE_MODIFIER_LETTER
338 * General category "Letter, Modifier" (Lm)
339 * G_UNICODE_OTHER_LETTER
340 * General category "Letter, Other" (Lo)
341 * G_UNICODE_TITLECASE_LETTER
342 * General category "Letter, Titlecase" (Lt)
343 * G_UNICODE_UPPERCASE_LETTER
344 * General category "Letter, Uppercase" (Lu)
345 * G_UNICODE_COMBINING_MARK
346 * General category "Mark, Spacing Combining" (Mc)
347 * G_UNICODE_ENCLOSING_MARK
348 * General category "Mark, Enclosing" (Me)
349 * G_UNICODE_NON_SPACING_MARK
350 * General category "Mark, Nonspacing" (Mn)
351 * G_UNICODE_DECIMAL_NUMBER
352 * General category "Number, Decimal Digit" (Nd)
353 * G_UNICODE_LETTER_NUMBER
354 * General category "Number, Letter" (Nl)
355 * G_UNICODE_OTHER_NUMBER
356 * General category "Number, Other" (No)
357 * G_UNICODE_CONNECT_PUNCTUATION
358 * General category "Punctuation, Connector" (Pc)
359 * G_UNICODE_DASH_PUNCTUATION
360 * General category "Punctuation, Dash" (Pd)
361 * G_UNICODE_CLOSE_PUNCTUATION
362 * General category "Punctuation, Close" (Pe)
363 * G_UNICODE_FINAL_PUNCTUATION
364 * General category "Punctuation, Final quote" (Pf)
365 * G_UNICODE_INITIAL_PUNCTUATION
366 * General category "Punctuation, Initial quote" (Pi)
367 * G_UNICODE_OTHER_PUNCTUATION
368 * General category "Punctuation, Other" (Po)
369 * G_UNICODE_OPEN_PUNCTUATION
370 * General category "Punctuation, Open" (Ps)
371 * G_UNICODE_CURRENCY_SYMBOL
372 * General category "Symbol, Currency" (Sc)
373 * G_UNICODE_MODIFIER_SYMBOL
374 * General category "Symbol, Modifier" (Sk)
375 * G_UNICODE_MATH_SYMBOL
376 * General category "Symbol, Math" (Sm)
377 * G_UNICODE_OTHER_SYMBOL
378 * General category "Symbol, Other" (So)
379 * G_UNICODE_LINE_SEPARATOR
380 * General category "Separator, Line" (Zl)
381 * G_UNICODE_PARAGRAPH_SEPARATOR
382 * General category "Separator, Paragraph" (Zp)
383 * G_UNICODE_SPACE_SEPARATOR
384 * General category "Separator, Space" (Zs)
386 public enum GUnicodeType
388 CONTROL,
389 FORMAT,
390 UNASSIGNED,
391 PRIVATE_USE,
392 SURROGATE,
393 LOWERCASE_LETTER,
394 MODIFIER_LETTER,
395 OTHER_LETTER,
396 TITLECASE_LETTER,
397 UPPERCASE_LETTER,
398 COMBINING_MARK,
399 ENCLOSING_MARK,
400 NON_SPACING_MARK,
401 DECIMAL_NUMBER,
402 LETTER_NUMBER,
403 OTHER_NUMBER,
404 CONNECT_PUNCTUATION,
405 DASH_PUNCTUATION,
406 CLOSE_PUNCTUATION,
407 FINAL_PUNCTUATION,
408 INITIAL_PUNCTUATION,
409 OTHER_PUNCTUATION,
410 OPEN_PUNCTUATION,
411 CURRENCY_SYMBOL,
412 MODIFIER_SYMBOL,
413 MATH_SYMBOL,
414 OTHER_SYMBOL,
415 LINE_SEPARATOR,
416 PARAGRAPH_SEPARATOR,
417 SPACE_SEPARATOR
419 alias GUnicodeType UnicodeType;
422 * These are the possible line break classifications.
423 * The five Hangul types were added in Unicode 4.1, so, has been
424 * introduced in GLib 2.10. Note that new types may be added in the future.
425 * Applications should be ready to handle unknown values.
426 * They may be regarded as G_UNICODE_BREAK_UNKNOWN.
427 * See http://www.unicode.org/unicode/reports/tr14/.
429 public enum GUnicodeBreakType
431 MANDATORY,
432 CARRIAGE_RETURN,
433 LINE_FEED,
434 COMBINING_MARK,
435 SURROGATE,
436 ZERO_WIDTH_SPACE,
437 INSEPARABLE,
438 NON_BREAKING_GLUE,
439 CONTINGENT,
440 SPACE,
441 AFTER,
442 BEFORE,
443 BEFORE_AND_AFTER,
444 HYPHEN,
445 NON_STARTER,
446 OPEN_PUNCTUATION,
447 CLOSE_PUNCTUATION,
448 QUOTATION,
449 EXCLAMATION,
450 IDEOGRAPHIC,
451 NUMERIC,
452 INFIX_SEPARATOR,
453 SYMBOL,
454 ALPHABETIC,
455 PREFIX,
456 POSTFIX,
457 COMPLEX_CONTEXT,
458 AMBIGUOUS,
459 UNKNOWN,
460 NEXT_LINE,
461 WORD_JOINER,
462 HANGUL_L_JAMO,
463 HANGUL_V_JAMO,
464 HANGUL_T_JAMO,
465 HANGUL_LV_SYLLABLE,
466 HANGUL_LVT_SYLLABLE
468 alias GUnicodeBreakType UnicodeBreakType;
471 * The GUnicodeScript enumeration identifies different writing
472 * systems. The values correspond to the names as defined in the
473 * Unicode standard. The enumeration has been added in GLib 2.14.
474 * Note that new types may be added in the future. Applications
475 * should be ready to handle unknown values.
476 * See Unicode Standard Annex
477 * 24: Script names.
478 * G_UNICODE_SCRIPT_INVALID_CODE
479 * a value never returned from g_unichar_get_script()
480 * G_UNICODE_SCRIPT_COMMON
482 public enum GUnicodeScript
484 INVALID_CODE = -1,
485 COMMON = 0, /+* Zyyy +/
486 INHERITED, /+* Qaai +/
487 ARABIC, /+* Arab +/
488 ARMENIAN, /+* Armn +/
489 BENGALI, /+* Beng +/
490 BOPOMOFO, /+* Bopo +/
491 CHEROKEE, /+* Cher +/
492 COPTIC, /+* Qaac +/
493 CYRILLIC, /+* Cyrl (Cyrs) +/
494 DESERET, /+* Dsrt +/
495 DEVANAGARI, /+* Deva +/
496 ETHIOPIC, /+* Ethi +/
497 GEORGIAN, /+* Geor (Geon, Geoa) +/
498 GOTHIC, /+* Goth +/
499 GREEK, /+* Grek +/
500 GUJARATI, /+* Gujr +/
501 GURMUKHI, /+* Guru +/
502 HAN, /+* Hani +/
503 HANGUL, /+* Hang +/
504 HEBREW, /+* Hebr +/
505 HIRAGANA, /+* Hira +/
506 KANNADA, /+* Knda +/
507 KATAKANA, /+* Kana +/
508 KHMER, /+* Khmr +/
509 LAO, /+* Laoo +/
510 LATIN, /+* Latn (Latf, Latg) +/
511 MALAYALAM, /+* Mlym +/
512 MONGOLIAN, /+* Mong +/
513 MYANMAR, /+* Mymr +/
514 OGHAM, /+* Ogam +/
515 OLD_ITALIC, /+* Ital +/
516 ORIYA, /+* Orya +/
517 RUNIC, /+* Runr +/
518 SINHALA, /+* Sinh +/
519 SYRIAC, /+* Syrc (Syrj, Syrn, Syre) +/
520 TAMIL, /+* Taml +/
521 TELUGU, /+* Telu +/
522 THAANA, /+* Thaa +/
523 THAI, /+* Thai +/
524 TIBETAN, /+* Tibt +/
525 CANADIAN_ABORIGINAL, /+* Cans +/
526 YI, /+* Yiii +/
527 TAGALOG, /+* Tglg +/
528 HANUNOO, /+* Hano +/
529 BUHID, /+* Buhd +/
530 TAGBANWA, /+* Tagb +/
531 /+* Unicode-4.0 additions +/
532 BRAILLE, /+* Brai +/
533 CYPRIOT, /+* Cprt +/
534 LIMBU, /+* Limb +/
535 OSMANYA, /+* Osma +/
536 SHAVIAN, /+* Shaw +/
537 LINEAR_B, /+* Linb +/
538 TAI_LE, /+* Tale +/
539 UGARITIC, /+* Ugar +/
540 /+* Unicode-4.1 additions +/
541 NEW_TAI_LUE, /+* Talu +/
542 BUGINESE, /+* Bugi +/
543 GLAGOLITIC, /+* Glag +/
544 TIFINAGH, /+* Tfng +/
545 SYLOTI_NAGRI, /+* Sylo +/
546 OLD_PERSIAN, /+* Xpeo +/
547 KHAROSHTHI, /+* Khar +/
548 /+* Unicode-5.0 additions +/
549 UNKNOWN, /+* Zzzz +/
550 BALINESE, /+* Bali +/
551 CUNEIFORM, /+* Xsux +/
552 PHOENICIAN, /+* Phnx +/
553 PHAGS_PA, /+* Phag +/
554 NKO /+* Nkoo +/
556 alias GUnicodeScript UnicodeScript;
559 * Defines how a Unicode string is transformed in a canonical
560 * form, standardizing such issues as whether a character with an accent is
561 * represented as a base character and combining accent or as a single precomposed
562 * character. Unicode strings should generally be normalized before comparing them.
563 * G_NORMALIZE_DEFAULT
564 * standardize differences that do not affect the
566 public enum GNormalizeMode
568 DEFAULT,
569 NFD = DEFAULT,
570 DEFAULT_COMPOSE,
571 NFC = DEFAULT_COMPOSE,
572 ALL,
573 NFKD = ALL,
574 ALL_COMPOSE,
575 NFKC = ALL_COMPOSE
577 alias GNormalizeMode NormalizeMode;
580 * This enumeration isn't used in the API, but may be useful if you need
581 * to mark a number as a day, month, or year.
582 * G_DATE_DAY
583 * a day
584 * G_DATE_MONTH
585 * a month
586 * G_DATE_YEAR
587 * a year
589 public enum GDateDMY
591 DAY = 0,
592 MONTH = 1,
593 YEAR = 2
595 alias GDateDMY DateDMY;
598 * Enumeration representing a month; values are G_DATE_JANUARY,
599 * G_DATE_FEBRUARY, etc. G_DATE_BAD_MONTH is the invalid value.
600 * G_DATE_BAD_MONTH
601 * invalid value.
602 * G_DATE_JANUARY
603 * January.
604 * G_DATE_FEBRUARY
605 * February.
606 * G_DATE_MARCH
607 * March.
608 * G_DATE_APRIL
609 * April.
610 * G_DATE_MAY
611 * May.
612 * G_DATE_JUNE
613 * June.
614 * G_DATE_JULY
615 * July.
616 * G_DATE_AUGUST
617 * August.
618 * G_DATE_SEPTEMBER
619 * September.
620 * G_DATE_OCTOBER
621 * October.
622 * G_DATE_NOVEMBER
623 * November.
624 * G_DATE_DECEMBER
625 * December.
627 public enum GDateMonth
629 BAD_MONTH = 0,
630 JANUARY = 1,
631 FEBRUARY = 2,
632 MARCH = 3,
633 APRIL = 4,
634 MAY = 5,
635 JUNE = 6,
636 JULY = 7,
637 AUGUST = 8,
638 SEPTEMBER = 9,
639 OCTOBER = 10,
640 NOVEMBER = 11,
641 DECEMBER = 12
643 alias GDateMonth DateMonth;
646 * Enumeration representing a day of the week; G_DATE_MONDAY,
647 * G_DATE_TUESDAY, etc. G_DATE_BAD_WEEKDAY is an invalid weekday.
648 * G_DATE_BAD_WEEKDAY
649 * invalid value.
650 * G_DATE_MONDAY
651 * Monday.
652 * G_DATE_TUESDAY
653 * Tuesday.
654 * G_DATE_WEDNESDAY
655 * Wednesday.
656 * G_DATE_THURSDAY
657 * Thursday.
658 * G_DATE_FRIDAY
659 * Friday.
660 * G_DATE_SATURDAY
661 * Saturday.
662 * G_DATE_SUNDAY
663 * Sunday.
665 public enum GDateWeekday
667 BAD_WEEKDAY = 0,
668 MONDAY = 1,
669 TUESDAY = 2,
670 WEDNESDAY = 3,
671 THURSDAY = 4,
672 FRIDAY = 5,
673 SATURDAY = 6,
674 SUNDAY = 7
676 alias GDateWeekday DateWeekday;
679 * The possible types of token returned from each g_scanner_get_next_token() call.
680 * G_TOKEN_EOF
681 * the end of the file.
682 * G_TOKEN_LEFT_PAREN
683 * a '(' character.
684 * G_TOKEN_LEFT_CURLY
685 * a '{' character.
686 * G_TOKEN_RIGHT_CURLY
687 * a '}' character.
689 public enum GTokenType
691 EOF = 0,
692 LEFT_PAREN = '(',
693 RIGHT_PAREN = ')',
694 LEFT_CURLY = '{',
695 RIGHT_CURLY = '}',
696 LEFT_BRACE = '[',
697 RIGHT_BRACE = ']',
698 EQUAL_SIGN = '=',
699 COMMA = ',',
700 NONE = 256,
701 ERROR,
702 CHAR,
703 BINARY,
704 OCTAL,
705 INT,
706 HEX,
707 FLOAT,
708 STRING,
709 SYMBOL,
710 IDENTIFIER,
711 IDENTIFIER_NULL,
712 COMMENT_SINGLE,
713 COMMENT_MULTI,
714 LAST
716 alias GTokenType TokenType;
719 * The possible errors, used in the v_error field
720 * of GTokenValue, when the token is a G_TOKEN_ERROR.
721 * G_ERR_UNKNOWN
722 * unknown error.
723 * G_ERR_UNEXP_EOF
724 * unexpected end of file.
725 * G_ERR_UNEXP_EOF_IN_STRING
726 * unterminated string constant.
727 * G_ERR_UNEXP_EOF_IN_COMMENT
728 * unterminated comment.
729 * G_ERR_NON_DIGIT_IN_CONST
730 * non-digit character in a number.
731 * G_ERR_DIGIT_RADIX
732 * digit beyond radix in a number.
733 * G_ERR_FLOAT_RADIX
734 * non-decimal floating point number.
735 * G_ERR_FLOAT_MALFORMED
736 * malformed floating point number.
738 public enum GErrorType
740 UNKNOWN,
741 UNEXP_EOF,
742 UNEXP_EOF_IN_STRING,
743 UNEXP_EOF_IN_COMMENT,
744 NON_DIGIT_IN_CONST,
745 DIGIT_RADIX,
746 FLOAT_RADIX,
747 FLOAT_MALFORMED
749 alias GErrorType ErrorType;
752 * Error codes returned by spawning processes.
753 * G_SPAWN_ERROR_FORK
754 * Fork failed due to lack of memory.
755 * G_SPAWN_ERROR_READ
756 * Read or select on pipes failed.
757 * G_SPAWN_ERROR_CHDIR
758 * Changing to working directory failed.
759 * G_SPAWN_ERROR_ACCES
760 * execv() returned EACCES.
761 * G_SPAWN_ERROR_PERM
762 * execv() returned EPERM.
763 * G_SPAWN_ERROR_2BIG
764 * execv() returned E2BIG.
765 * G_SPAWN_ERROR_NOEXEC
766 * execv() returned ENOEXEC.
767 * G_SPAWN_ERROR_NAMETOOLONG
768 * execv() returned ENAMETOOLONG.
769 * G_SPAWN_ERROR_NOENT
770 * execv() returned ENOENT.
771 * G_SPAWN_ERROR_NOMEM
772 * execv() returned ENOMEM.
773 * G_SPAWN_ERROR_NOTDIR
774 * execv() returned ENOTDIR.
775 * G_SPAWN_ERROR_LOOP
776 * execv() returned ELOOP.
777 * G_SPAWN_ERROR_TXTBUSY
778 * execv() returned ETXTBUSY.
779 * G_SPAWN_ERROR_IO
780 * execv() returned EIO.
781 * G_SPAWN_ERROR_NFILE
782 * execv() returned ENFILE.
783 * G_SPAWN_ERROR_MFILE
784 * execv() returned EMFILE.
785 * G_SPAWN_ERROR_INVAL
786 * execv() returned EINVAL.
787 * G_SPAWN_ERROR_ISDIR
788 * execv() returned EISDIR.
789 * G_SPAWN_ERROR_LIBBAD
790 * execv() returned ELIBBAD.
791 * G_SPAWN_ERROR_FAILED
792 * Some other fatal failure, error->message should explain.
794 public enum GSpawnError
796 FORK, /+* fork failed due to lack of memory +/
797 READ, /+* read or select on pipes failed +/
798 CHDIR, /+* changing to working dir failed +/
799 ACCES, /+* execv() returned EACCES +/
800 PERM, /+* execv() returned EPERM +/
801 TOO_BIG, /+* execv() returned E2BIG +/
802 NOEXEC, /+* execv() returned ENOEXEC +/
803 NAMETOOLONG, /+* "" "" ENAMETOOLONG +/
804 NOENT, /+* "" "" ENOENT +/
805 NOMEM, /+* "" "" ENOMEM +/
806 NOTDIR, /+* "" "" ENOTDIR +/
807 LOOP, /+* "" "" ELOOP +/
808 TXTBUSY, /+* "" "" ETXTBUSY +/
809 IO, /+* "" "" EIO +/
810 NFILE, /+* "" "" ENFILE +/
811 MFILE, /+* "" "" EMFLE +/
812 INVAL, /+* "" "" EINVAL +/
813 ISDIR, /+* "" "" EISDIR +/
814 LIBBAD, /+* "" "" ELIBBAD +/
815 FAILED /+* other fatal failure, error->message
816 * should explain
819 alias GSpawnError SpawnError;
822 * Flags passed to g_spawn_sync(), g_spawn_async() and g_spawn_async_with_pipes().
823 * G_SPAWN_LEAVE_DESCRIPTORS_OPEN
824 * the parent's open file descriptors will be
826 public enum GSpawnFlags
828 LEAVE_DESCRIPTORS_OPEN = 1 << 0,
829 DO_NOT_REAP_CHILD = 1 << 1,
830 /+* look for argv[0] inn the path i.e. use execvp() +/
831 SEARCH_PATH = 1 << 2,
832 /+* Dump output to /dev/null +/
833 STDOUT_TO_DEV_NULL = 1 << 3,
834 STDERR_TO_DEV_NULL = 1 << 4,
835 CHILD_INHERITS_STDIN = 1 << 5,
836 FILE_AND_ARGV_ZERO = 1 << 6
838 alias GSpawnFlags SpawnFlags;
841 * Values corresponding to errno codes returned from file operations
842 * on UNIX. Unlike errno codes, GFileError values are available on
843 * all systems, even Windows. The exact meaning of each code depends on what
844 * sort of file operation you were performing; the UNIX documentation
845 * gives more details. The following error code descriptions come
846 * from the GNU C Library manual, and are under the copyright
847 * of that manual.
848 * It's not very portable to make detailed assumptions about exactly
849 * which errors will be returned from a given operation. Some errors
850 * don't occur on some systems, etc., sometimes there are subtle
851 * differences in when a system will report a given error, etc.
852 * G_FILE_ERROR_EXIST
853 * Operation not permitted; only the owner of the
855 public enum GFileError
857 EXIST,
858 ISDIR,
859 ACCES,
860 NAMETOOLONG,
861 NOENT,
862 NOTDIR,
863 NXIO,
864 NODEV,
865 ROFS,
866 TXTBSY,
867 FAULT,
868 LOOP,
869 NOSPC,
870 NOMEM,
871 MFILE,
872 NFILE,
873 BADF,
874 INVAL,
875 PIPE,
876 AGAIN,
877 INTR,
879 PERM,
880 NOSYS,
881 FAILED
883 alias GFileError FileError;
886 * A test to perform on a file using g_file_test().
887 * G_FILE_TEST_IS_REGULAR
888 * TRUE if the file is a regular file (not a symlink or directory)
889 * G_FILE_TEST_IS_SYMLINK
890 * TRUE if the file is a symlink.
891 * G_FILE_TEST_IS_DIR
892 * TRUE if the file is a directory.
893 * G_FILE_TEST_IS_EXECUTABLE
894 * TRUE if the file is executable.
895 * G_FILE_TEST_EXISTS
896 * TRUE if the file exists. It may or may not be a regular file.
898 public enum GFileTest
900 IS_REGULAR = 1 << 0,
901 IS_SYMLINK = 1 << 1,
902 IS_DIR = 1 << 2,
903 IS_EXECUTABLE = 1 << 3,
904 EXISTS = 1 << 4
906 alias GFileTest FileTest;
909 * Error codes returned by shell functions.
910 * G_SHELL_ERROR_BAD_QUOTING
911 * Mismatched or otherwise mangled quoting.
912 * G_SHELL_ERROR_EMPTY_STRING
913 * String to be parsed was empty.
914 * G_SHELL_ERROR_FAILED
915 * Some other error.
917 public enum GShellError
919 /+* mismatched or otherwise mangled quoting +/
920 G_SHELL_ERROR_BAD_QUOTING,
921 /+* string to be parsed was empty +/
922 G_SHELL_ERROR_EMPTY_STRING,
923 G_SHELL_ERROR_FAILED
925 alias GShellError ShellError;
928 * Error codes returned by option parsing.
929 * G_OPTION_ERROR_UNKNOWN_OPTION
930 * An option was not known to the parser.
932 public enum GOptionError
934 UNKNOWN_OPTION,
935 BAD_VALUE,
936 FAILED
938 alias GOptionError OptionError;
941 * The GOptionArg enum values determine which type of extra argument the
942 * options expect to find. If an option expects an extra argument, it
943 * can be specified in several ways; with a short option:
944 * -x arg, with a long option: --name arg
945 * or combined in a single argument: --name=arg.
946 * G_OPTION_ARG_NONE
947 * No extra argument. This is useful for simple flags.
948 * G_OPTION_ARG_STRING
949 * The option takes a string argument.
950 * G_OPTION_ARG_INT
951 * The option takes an integer argument.
952 * G_OPTION_ARG_CALLBACK
953 * The option provides a callback to parse the
955 public enum GOptionArg
957 NONE,
958 STRING,
959 INT,
960 CALLBACK,
961 FILENAME,
962 STRING_ARRAY,
963 FILENAME_ARRAY,
964 DOUBLE,
965 INT64
967 alias GOptionArg OptionArg;
970 * Flags which modify individual options.
971 * G_OPTION_FLAG_HIDDEN
972 * The option doesn't appear in --help
974 public enum GOptionFlags
976 HIDDEN = 1 << 0,
977 IN_MAIN = 1 << 1,
978 REVERSE = 1 << 2,
979 NO_ARG = 1 << 3,
980 FILENAME = 1 << 4,
981 OPTIONAL_ARG = 1 << 5,
982 NOALIAS = 1 << 6
984 alias GOptionFlags OptionFlags;
987 * Error codes returned by markup parsing.
988 * G_MARKUP_ERROR_BAD_UTF8
989 * text being parsed was not valid UTF-8
990 * G_MARKUP_ERROR_EMPTY
991 * document contained nothing, or only whitespace
992 * G_MARKUP_ERROR_PARSE
993 * document was ill-formed
994 * G_MARKUP_ERROR_UNKNOWN_ELEMENT
995 * error should be set by GMarkupParser functions; element wasn't known
996 * G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE
997 * error should be set by GMarkupParser functions; attribute wasn't known
998 * G_MARKUP_ERROR_INVALID_CONTENT
999 * error should be set by GMarkupParser functions; something was wrong with contents of the document, e.g. invalid attribute value
1001 public enum GMarkupError
1003 BAD_UTF8,
1004 EMPTY,
1005 PARSE,
1006 /+* These three are primarily intended for specific GMarkupParser
1007 * implementations to set.
1009 UNKNOWN_ELEMENT,
1010 UNKNOWN_ATTRIBUTE,
1011 INVALID_CONTENT
1013 alias GMarkupError MarkupError;
1016 * Flags that affect the behaviour of the parser.
1017 * G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG
1018 * flag you should not use.
1019 * G_MARKUP_TREAT_CDATA_AS_TEXT
1020 * When this flag is set, CDATA marked
1022 public enum GMarkupParseFlags
1024 DO_NOT_USE_THIS_UNSUPPORTED_FLAG = 1 << 0,
1025 TREAT_CDATA_AS_TEXT = 1 << 1
1027 alias GMarkupParseFlags MarkupParseFlags;
1030 * Error codes returned by key file parsing.
1031 * G_KEY_FILE_ERROR_UNKNOWN_ENCODING
1032 * the text being parsed was in an unknown encoding
1033 * G_KEY_FILE_ERROR_PARSE
1034 * document was ill-formed
1035 * G_KEY_FILE_ERROR_NOT_FOUND
1036 * the file was not found
1037 * G_KEY_FILE_ERROR_KEY_NOT_FOUND
1038 * a requested key was not found
1039 * G_KEY_FILE_ERROR_GROUP_NOT_FOUND
1040 * a requested group was not found
1041 * G_KEY_FILE_ERROR_INVALID_VALUE
1042 * a value could not be parsed
1044 public enum GKeyFileError
1046 UNKNOWN_ENCODING,
1047 PARSE,
1048 NOT_FOUND,
1049 KEY_NOT_FOUND,
1050 GROUP_NOT_FOUND,
1051 INVALID_VALUE
1053 alias GKeyFileError KeyFileError;
1056 * Flags which influence the parsing.
1057 * G_KEY_FILE_NONE
1058 * No flags, default behaviour
1059 * G_KEY_FILE_KEEP_COMMENTS
1060 * Use this flag if you plan to write the (possibly modified)
1062 public enum GKeyFileFlags
1064 NONE = 0,
1065 KEEP_COMMENTS = 1 << 0,
1066 KEEP_TRANSLATIONS = 1 << 1
1068 alias GKeyFileFlags KeyFileFlags;
1071 * Specifies the type of traveral performed by g_tree_traverse(),
1072 * g_node_traverse() and g_node_find().
1073 * G_IN_ORDER
1074 * vists a node's left child first, then the node itself, then its
1076 public enum GTraverseType
1078 IN_ORDER,
1079 PRE_ORDER,
1080 POST_ORDER,
1081 LEVEL_ORDER
1083 alias GTraverseType TraverseType;
1086 * Specifies which nodes are visited during several of the tree functions,
1087 * including g_node_traverse() and g_node_find().
1088 * G_TRAVERSE_LEAVES
1089 * only leaf nodes should be visited. This name has been
1091 public enum GTraverseFlags
1093 LEAVES = 1 << 0,
1094 NON_LEAVES = 1 << 1,
1095 ALL = LEAVES | NON_LEAVES,
1096 MASK = 0x03,
1097 LEAFS = LEAVES,
1098 NON_LEAFS = NON_LEAVES
1100 alias GTraverseFlags TraverseFlags;
1104 * Main Gtk struct.
1105 * The GMainLoop struct is an opaque data type
1106 * representing the main event loop of a GLib or GTK+ application.
1108 public struct GMainLoop{}
1112 * The GMainContext struct is an opaque data type
1113 * representing a set of sources to be handled in a main loop.
1115 public struct GMainContext{}
1119 * gint fd;
1120 * the file descriptor to poll (or a HANDLE on Win32 platforms).
1121 * gushort events;
1122 * a bitwise combination of flags from GIOCondition, specifying which
1123 * events should be polled for. Typically for reading from a file descriptor
1124 * you would use G_IO_IN | G_IO_HUP | G_IO_ERR, and for writing you would use
1125 * G_IO_OUT | G_IO_ERR.
1126 * gushort revents;
1127 * a bitwise combination of flags from GIOCondition, returned from the
1128 * poll() function to indicate which events occurred.
1130 public struct GPollFD{}
1131 // #if defined (G_OS_WIN32) GLIB_SIZEOF_VOID_P == 8
1132 // glib-The-Main-Event-Loop.html
1133 // long fd;
1134 // glib-The-Main-Event-Loop.html
1135 // #else
1136 // glib-The-Main-Event-Loop.html
1137 // int fd;
1138 // glib-The-Main-Event-Loop.html
1139 // #endif
1140 // glib-The-Main-Event-Loop.html
1141 // ushort events;
1142 // glib-The-Main-Event-Loop.html
1143 // ushort revents;
1144 // glib-The-Main-Event-Loop.html
1148 * The GSource struct is an opaque data type representing
1149 * an event source.
1151 public struct GSource{}
1155 * The GSourceFuncs struct contains a table of functions used to handle
1156 * event sources in a generic manner.
1157 * prepare
1158 * Called before all the file descriptors are polled.
1159 * If the source can determine that it is ready here (without waiting for the
1160 * results of the poll() call) it should return TRUE.
1161 * It can also return a timeout_ value which should be the maximum timeout
1162 * (in milliseconds) which should be passed to the poll() call.
1163 * The actual timeout used will be -1 if all sources returned -1, or it will
1164 * be the minimum of all the timeout_ values returned which were >= 0.
1165 * check
1166 * Called after all the file descriptors are polled.
1167 * The source should return TRUE if it is ready to be dispatched.
1168 * Note that some time may have passed since the previous prepare function was
1169 * called, so the source should be checked again here.
1170 * dispatch
1171 * Called to dispatch the event source, after it has returned TRUE in
1172 * either its prepare or its check function. The dispatch function is
1173 * passed in a callback function and data. The callback function may be
1174 * NULL if the source was never connected to a callback using
1175 * g_source_set_callback(). The dispatch function should call the
1176 * callback function with user_data and whatever additional parameters are
1177 * needed for this type of event source.
1178 * finalize
1179 * Called when the source is finalized.
1180 * For idle sources, the prepare and check functions always return TRUE to
1181 * indicate that the source is always ready to be processed.
1182 * The prepare function also returns a timeout value of 0 to ensure that the
1183 * poll() call doesn't block (since that would be time
1184 * wasted which could have been spent running the idle function).
1185 * For timeout sources, the prepare and check functions both return TRUE if the
1186 * timeout interval has expired. The prepare function also returns a timeout
1187 * value to ensure that the poll() call doesn't block too
1188 * long and miss the next timeout.
1189 * For file descriptor sources, the prepare function typically returns FALSE,
1190 * since it must wait until poll() has been called before
1191 * it knows whether any events need to be processed. It sets the returned
1192 * timeout to -1 to indicate that it doesn't mind how long the
1193 * poll() call blocks.
1194 * In the check function, it tests the results of the poll()
1195 * call to see if the required condition has been met, and returns TRUE if so.
1197 public struct GSourceFuncs{}
1198 // int (*prepare) (GSource *source,
1199 // glib-The-Main-Event-Loop.html
1200 // int *timeout);
1201 // glib-The-Main-Event-Loop.html
1202 // int (*check) (GSource *source);
1203 // glib-The-Main-Event-Loop.html
1204 // int (*dispatch) (GSource *source,
1205 // glib-The-Main-Event-Loop.html
1206 // GSourceFunc callback,
1207 // glib-The-Main-Event-Loop.html
1208 // void* userData);
1209 // glib-The-Main-Event-Loop.html
1210 // void (*finalize) (GSource *source); /+* Can be NULL +/
1211 // glib-The-Main-Event-Loop.html
1212 // /+* For use by gSourceSetClosure +/
1213 // glib-The-Main-Event-Loop.html
1214 // GSourceFunc closureCallback;
1215 // glib-The-Main-Event-Loop.html
1216 // GSourceDummyMarshal closureMarshal; /+* Really is of type GClosureMarshal +/
1217 // glib-The-Main-Event-Loop.html
1221 * The GSourceCallbackFuncs struct contains
1222 * functions for managing callback objects.
1223 * ref()
1224 * Called when a reference is added to the callback object.
1225 * unref()
1226 * Called when a reference to the callback object is dropped.
1227 * get()
1228 * Called to extract the callback function and data from the callback object.
1230 public struct GSourceCallbackFuncs{}
1231 // void (*doref) (void* cbData);
1232 // glib-The-Main-Event-Loop.html
1233 // void (*unref) (void* cbData);
1234 // glib-The-Main-Event-Loop.html
1235 // void (*get) (void* cbData,
1236 // glib-The-Main-Event-Loop.html
1237 // GSource *source,
1238 // glib-The-Main-Event-Loop.html
1239 // GSourceFunc *func,
1240 // glib-The-Main-Event-Loop.html
1241 // void* *data);
1242 // glib-The-Main-Event-Loop.html
1246 * Main Gtk struct.
1247 * The GThreadPool struct represents a thread pool. It has six public
1248 * read-only members, but the underlying struct is bigger, so you must not copy
1249 * this struct.
1250 * GFuncfunc;
1251 * the function to execute in the threads of this pool
1252 * gpointeruser_data;
1253 * the user data for the threads of this pool
1254 * gbooleanexclusive;
1255 * are all threads exclusive to this pool
1257 public struct GThreadPool{}
1258 // GFunc func;
1259 // glib-Thread-Pools.html
1260 // void* userData;
1261 // glib-Thread-Pools.html
1262 // int exclusive;
1263 // glib-Thread-Pools.html
1267 * Main Gtk struct.
1268 * The GAsyncQueue struct is an opaque data structure, which represents
1269 * an asynchronous queue. It should only be accessed through the
1270 * g_async_queue_* functions.
1272 public struct GAsyncQueue{}
1276 * Main Gtk struct.
1277 * The GModule struct is an opaque data structure to represent a
1278 * Dynamically-Loaded Module.
1279 * It should only be accessed via the following functions.
1281 public struct GModule{}
1285 * A set of functions used to perform memory allocation. The same GMemVTable must
1286 * be used for all allocations in the same program; a call to g_mem_set_vtable(),
1287 * if it exists, should be prior to any use of GLib.
1288 * malloc()
1289 * function to use for allocating memory.
1290 * realloc()
1291 * function to use for reallocating memory.
1292 * free()
1293 * function to use to free memory.
1294 * calloc()
1295 * function to use for allocating zero-filled memory.
1296 * try_malloc()
1297 * function to use for allocating memory without a default error handler.
1298 * try_realloc()
1299 * function to use for reallocating memory without a default error handler.
1301 public struct GMemVTable{}
1302 // void* (*malloc) (uint nBytes);
1303 // glib-Memory-Allocation.html
1304 // void* (*realloc) (void* mem,
1305 // glib-Memory-Allocation.html
1306 // uint nBytes);
1307 // glib-Memory-Allocation.html
1308 // void (*free) (void* mem);
1309 // glib-Memory-Allocation.html
1310 // /+* optional; set to NULL if not used ! +/
1311 // glib-Memory-Allocation.html
1312 // void* (*calloc) (uint nBlocks,
1313 // glib-Memory-Allocation.html
1314 // uint nBlockBytes);
1315 // glib-Memory-Allocation.html
1316 // void* (*tryMalloc) (uint nBytes);
1317 // glib-Memory-Allocation.html
1318 // void* (*tryRealloc) (void* mem,
1319 // glib-Memory-Allocation.html
1320 // uint nBytes);
1321 // glib-Memory-Allocation.html
1325 * Main Gtk struct.
1326 * A data structure representing an IO Channel. The fields should be considered
1327 * private and should only be accessed with the following functions.
1329 public struct GIOChannel{}
1333 * A table of functions used to handle different types of GIOChannel in a
1334 * generic way.
1336 public struct GIOFuncs{}
1337 // GIOStatus (*ioRead) (GIOChannel *channel,
1338 // glib-IO-Channels.html
1339 // char *buf,
1340 // glib-IO-Channels.html
1341 // uint count,
1342 // glib-IO-Channels.html
1343 // uint *bytesRead,
1344 // glib-IO-Channels.html
1345 // GError **err);
1346 // glib-IO-Channels.html
1347 // GIOStatus (*ioWrite) (GIOChannel *channel,
1348 // glib-IO-Channels.html
1349 // char *buf,
1350 // glib-IO-Channels.html
1351 // uint count,
1352 // glib-IO-Channels.html
1353 // uint *bytesWritten,
1354 // glib-IO-Channels.html
1355 // GError **err);
1356 // glib-IO-Channels.html
1357 // GIOStatus (*ioSeek) (GIOChannel *channel,
1358 // glib-IO-Channels.html
1359 // long offset,
1360 // glib-IO-Channels.html
1361 // GSeekType type,
1362 // glib-IO-Channels.html
1363 // GError **err);
1364 // glib-IO-Channels.html
1365 // GIOStatus (*ioClose) (GIOChannel *channel,
1366 // glib-IO-Channels.html
1367 // GError **err);
1368 // glib-IO-Channels.html
1369 // GSource* (*ioCreateWatch) (GIOChannel *channel,
1370 // glib-IO-Channels.html
1371 // GIOCondition condition);
1372 // glib-IO-Channels.html
1373 // void (*ioFree) (GIOChannel *channel);
1374 // glib-IO-Channels.html
1375 // GIOStatus (*ioSetFlags) (GIOChannel *channel,
1376 // glib-IO-Channels.html
1377 // GIOFlags flags,
1378 // glib-IO-Channels.html
1379 // GError **err);
1380 // glib-IO-Channels.html
1381 // GIOFlags (*ioGetFlags) (GIOChannel *channel);
1382 // glib-IO-Channels.html
1386 * Main Gtk struct.
1387 * The GError structure contains
1388 * information about an error that has occurred.
1389 * GQuarkdomain;
1390 * error domain, e.g. G_FILE_ERROR.
1391 * gintcode;
1392 * error code, e.g. G_FILE_ERROR_NOENT.
1393 * gchar*message;
1394 * human-readable informative error message.
1396 public struct GError
1398 GQuark domain;
1399 int code;
1400 char *message;
1405 * The GIConv struct wraps an
1406 * iconv() conversion descriptor. It contains private data
1407 * and should only be accessed using the following functions.
1409 public struct GIConv{}
1413 * Represents a precise time, with seconds and microseconds.
1414 * Similar to the struct timeval returned by
1415 * the gettimeofday() UNIX call.
1416 * glongtv_sec;
1417 * seconds.
1418 * glongtv_usec;
1419 * microseconds.
1421 public struct GTimeVal
1423 int tvSec;
1424 int tvUsec;
1429 * Main Gtk struct.
1430 * Represents a day between January 1, Year 1 and a few thousand years in
1431 * the future. None of its members should be accessed directly. If the
1432 * GDate is obtained from g_date_new(), it will
1433 * be safe to mutate but invalid and thus not safe for calendrical computations.
1434 * If it's declared on the stack, it will contain garbage so must be
1435 * initialized with g_date_clear(). g_date_clear() makes the date invalid
1436 * but sane. An invalid date doesn't represent a day, it's "empty." A
1437 * date becomes valid after you set it to a Julian day or you set a day,
1438 * month, and year.
1439 * guintjulian_days:32;
1440 * the Julian representation of the date
1441 * guintjulian:1;
1442 * this bit is set if julian_days is valid
1443 * guintdmy:1;
1444 * this is set if day, month and year are valid
1445 * guintday:6;
1446 * the day of the day-month-year representation of the date, as
1448 public struct GDate{}
1449 // uint julianDays : 32; /+* julian days representation - we use a
1450 // glib-Date-and-Time-Functions.html
1451 // * bitfield hoping that 64 bit platforms
1452 // glib-Date-and-Time-Functions.html
1453 // * will pack this whole struct inn one big
1454 // glib-Date-and-Time-Functions.html
1455 // * int
1456 // glib-Date-and-Time-Functions.html
1457 // +/
1458 // glib-Date-and-Time-Functions.html
1459 // uint julian : 1; /+* julian is valid +/
1460 // glib-Date-and-Time-Functions.html
1461 // uint dmy : 1; /+* dmy is valid +/
1462 // glib-Date-and-Time-Functions.html
1463 // /+* DMY representation +/
1464 // glib-Date-and-Time-Functions.html
1465 // uint day : 6;
1466 // glib-Date-and-Time-Functions.html
1467 // uint month : 4;
1468 // glib-Date-and-Time-Functions.html
1469 // uint year : 16;
1470 // glib-Date-and-Time-Functions.html
1474 * Main Gtk struct.
1475 * The GRand struct is an opaque data structure. It should only be
1476 * accessed through the g_rand_* functions.
1478 public struct GRand{}
1482 * Associates a string with a bit flag.
1483 * Used in g_parse_debug_string().
1484 * gchar*key;
1485 * the string
1486 * guintvalue;
1487 * the flag
1489 public struct GDebugKey
1491 char *key;
1492 uint value;
1497 * Main Gtk struct.
1498 * The data structure representing a lexical scanner.
1499 * You should set input_name after creating
1500 * the scanner, since it is used by the default message handler when
1501 * displaying warnings and errors. If you are scanning a file, the file
1502 * name would be a good choice.
1503 * The user_data and
1504 * max_parse_errors fields are not used.
1505 * If you need to associate extra data with the scanner you can place them here.
1506 * If you want to use your own message handler you can set the
1507 * msg_handler field. The type of the message
1508 * handler function is declared by GScannerMsgFunc.
1510 public struct GScanner{}
1511 // /+* unused fields +/
1512 // glib-Lexical-Scanner.html
1513 // void* userData;
1514 // glib-Lexical-Scanner.html
1515 // uint maxParseErrors;
1516 // glib-Lexical-Scanner.html
1517 // /+* _Error() increments this field +/
1518 // glib-Lexical-Scanner.html
1519 // uint parseErrors;
1520 // glib-Lexical-Scanner.html
1521 // /+* name of input stream, featured by the defaulx message handler +/
1522 // glib-Lexical-Scanner.html
1523 // char *inputName;
1524 // glib-Lexical-Scanner.html
1525 // /+* quarked data +/
1526 // glib-Lexical-Scanner.html
1527 // GData *qdata;
1528 // glib-Lexical-Scanner.html
1529 // /+* link into the scanner configuration +/
1530 // glib-Lexical-Scanner.html
1531 // GScannerConfig *config;
1532 // glib-Lexical-Scanner.html
1533 // /+* fields filled inn after _GetNextToken() +/
1534 // glib-Lexical-Scanner.html
1535 // GTokenType token;
1536 // glib-Lexical-Scanner.html
1537 // GTokenValue value;
1538 // glib-Lexical-Scanner.html
1539 // uint line;
1540 // glib-Lexical-Scanner.html
1541 // uint position;
1542 // glib-Lexical-Scanner.html
1543 // /+* fields filled inn after _PeekNextToken() +/
1544 // glib-Lexical-Scanner.html
1545 // GTokenType nextToken;
1546 // glib-Lexical-Scanner.html
1547 // GTokenValue nextValue;
1548 // glib-Lexical-Scanner.html
1549 // uint nextLine;
1550 // glib-Lexical-Scanner.html
1551 // uint nextPosition;
1552 // glib-Lexical-Scanner.html
1553 // /+* to be considered private +/
1554 // glib-Lexical-Scanner.html
1555 // GHashTable *symbolTable;
1556 // glib-Lexical-Scanner.html
1557 // int inputFd;
1558 // glib-Lexical-Scanner.html
1559 // char *text;
1560 // glib-Lexical-Scanner.html
1561 // char *textEnd;
1562 // glib-Lexical-Scanner.html
1563 // char *buffer;
1564 // glib-Lexical-Scanner.html
1565 // uint scopeId;
1566 // glib-Lexical-Scanner.html
1567 // /+* handler funct for _Warn and _Error +/
1568 // glib-Lexical-Scanner.html
1569 // GScannerMsgFunc msgHandler;
1570 // glib-Lexical-Scanner.html
1574 * Specifies the GScanner settings.
1575 * cset_skip_characters specifies which characters
1576 * should be skipped by the scanner (the default is the whitespace characters:
1577 * space, tab, carriage-return and line-feed).
1578 * cset_identifier_first specifies the characters
1579 * which can start identifiers (the default is G_CSET_a_2_z, "_", and
1580 * G_CSET_A_2_Z).
1581 * cset_identifier_nth specifies the characters
1582 * which can be used in identifiers, after the first character (the default
1583 * is G_CSET_a_2_z, "_0123456789", G_CSET_A_2_Z, G_CSET_LATINS,
1584 * G_CSET_LATINC).
1585 * cpair_comment_single specifies the characters
1586 * at the start and end of single-line comments. The default is "#\n" which
1587 * means that single-line comments start with a '#' and continue until a '\n'
1588 * (end of line).
1589 * case_sensitive specifies if symbols are
1590 * case sensitive (the default is FALSE).
1591 * skip_comment_multi specifies if multi-line
1592 * comments are skipped and not returned as tokens (the default is TRUE).
1593 * skip_comment_single specifies if single-line
1594 * comments are skipped and not returned as tokens (the default is TRUE).
1595 * scan_comment_multi specifies if multi-line
1596 * comments are recognized (the default is TRUE).
1597 * scan_identifier specifies if identifiers
1598 * are recognized (the default is TRUE).
1599 * scan_identifier_1char specifies if single-character
1600 * identifiers are recognized (the default is FALSE).
1601 * scan_identifier_NULL specifies if
1602 * NULL is reported as G_TOKEN_IDENTIFIER_NULL.
1603 * (the default is FALSE).
1604 * scan_symbols specifies if symbols are
1605 * recognized (the default is TRUE).
1606 * scan_binary specifies if binary numbers
1607 * are recognized (the default is FALSE).
1608 * scan_octal specifies if octal numbers
1609 * are recognized (the default is TRUE).
1610 * scan_float specifies if floating point numbers
1611 * are recognized (the default is TRUE).
1612 * scan_hex specifies if hexadecimal numbers
1613 * are recognized (the default is TRUE).
1614 * scan_hex_dollar specifies if '$' is recognized
1615 * as a prefix for hexadecimal numbers (the default is FALSE).
1616 * scan_string_sq specifies if strings can be
1617 * enclosed in single quotes (the default is TRUE).
1618 * scan_string_dq specifies if strings can be
1619 * enclosed in double quotes (the default is TRUE).
1620 * numbers_2_int specifies if binary, octal and
1621 * hexadecimal numbers are reported as G_TOKEN_INT (the default is TRUE).
1622 * int_2_float specifies if all numbers are
1623 * reported as G_TOKEN_FLOAT (the default is FALSE).
1624 * identifier_2_string specifies if identifiers
1625 * are reported as strings (the default is FALSE).
1626 * char_2_token specifies if characters
1627 * are reported by setting token = ch or as G_TOKEN_CHAR
1628 * (the default is TRUE).
1629 * symbol_2_token specifies if symbols
1630 * are reported by setting token = v_symbol or as
1631 * G_TOKEN_SYMBOL (the default is FALSE).
1632 * scope_0_fallback specifies if a symbol
1633 * is searched for in the default scope in addition to the current scope
1634 * (the default is FALSE).
1636 public struct GScannerConfig{}
1637 // /+* Character sets
1638 // glib-Lexical-Scanner.html
1639 // +/
1640 // glib-Lexical-Scanner.html
1641 // char *csetSkipCharacters; /+* default: " \t\n" +/
1642 // glib-Lexical-Scanner.html
1643 // char *csetIdentifierFirst;
1644 // glib-Lexical-Scanner.html
1645 // char *csetIdentifierNth;
1646 // glib-Lexical-Scanner.html
1647 // char *cpairCommentSingle; /+* default: "#\n" +/
1648 // glib-Lexical-Scanner.html
1649 // /+* Should symbol lookup work case sensitive?
1650 // glib-Lexical-Scanner.html
1651 // +/
1652 // glib-Lexical-Scanner.html
1653 // uint caseSensitive : 1;
1654 // glib-Lexical-Scanner.html
1655 // /+* Boolean values to be adjusted "on the fly"
1656 // glib-Lexical-Scanner.html
1657 // * to configure scanning behaviour.
1658 // glib-Lexical-Scanner.html
1659 // +/
1660 // glib-Lexical-Scanner.html
1661 // uint skipCommentMulti : 1; /+* C like comment +/
1662 // glib-Lexical-Scanner.html
1663 // uint skipCommentSingle : 1; /+* single line comment +/
1664 // glib-Lexical-Scanner.html
1665 // uint scanCommentMulti : 1; /+* scan multi line comments? +/
1666 // glib-Lexical-Scanner.html
1667 // uint scanIdentifier : 1;
1668 // glib-Lexical-Scanner.html
1669 // uint scanIdentifier1char : 1;
1670 // glib-Lexical-Scanner.html
1671 // uint scanIdentifierNULL : 1;
1672 // glib-Lexical-Scanner.html
1673 // uint scanSymbols : 1;
1674 // glib-Lexical-Scanner.html
1675 // uint scanBinary : 1;
1676 // glib-Lexical-Scanner.html
1677 // uint scanOctal : 1;
1678 // glib-Lexical-Scanner.html
1679 // uint scanFloat : 1;
1680 // glib-Lexical-Scanner.html
1681 // uint scanHex : 1; /+* `0x0ff0' +/
1682 // glib-Lexical-Scanner.html
1683 // uint scanHexDollar : 1; /+* `$0ff0' +/
1684 // glib-Lexical-Scanner.html
1685 // uint scanStringSq : 1; /+* string: 'anything' +/
1686 // glib-Lexical-Scanner.html
1687 // uint scanStringDq : 1; /+* string: "\\-escapes!\n" +/
1688 // glib-Lexical-Scanner.html
1689 // uint numbers2_Int : 1; /+* bin, octal, hex => int +/
1690 // glib-Lexical-Scanner.html
1691 // uint int2_Float : 1; /+* int => G_TOKEN_FLOAT? +/
1692 // glib-Lexical-Scanner.html
1693 // uint identifier2_String : 1;
1694 // glib-Lexical-Scanner.html
1695 // uint char2_Token : 1; /+* return G_TOKEN_CHAR? +/
1696 // glib-Lexical-Scanner.html
1697 // uint symbol2_Token : 1;
1698 // glib-Lexical-Scanner.html
1699 // uint scope0_Fallback : 1; /+* try scope 0 on lookups? +/
1700 // glib-Lexical-Scanner.html
1701 // uint storeInt64 : 1; /+* use value.vInt64 rather than vInt +/
1702 // glib-Lexical-Scanner.html
1703 // uint paddingDummy;
1704 // glib-Lexical-Scanner.html
1708 * Main Gtk struct.
1709 * The data structure used for automatic completion.
1710 * GList*items;
1711 * list of target items (strings or data structures).
1712 * GCompletionFuncfunc;
1713 * function which is called to get the string associated with a target
1715 public struct GCompletion{}
1716 // GList* items;
1717 // glib-Automatic-String-Completion.html
1718 // GCompletionFunc func;
1719 // glib-Automatic-String-Completion.html
1720 // char* prefix;
1721 // glib-Automatic-String-Completion.html
1722 // GList* cache;
1723 // glib-Automatic-String-Completion.html
1724 // GCompletionStrncmpFunc strncmpFunc;
1725 // glib-Automatic-String-Completion.html
1729 * Main Gtk struct.
1730 * Opaque datatype that records a start time.
1732 public struct GTimer{}
1736 * An opaque structure representing an opened directory.
1738 public struct GDir{}
1742 * The GMappedFile represents a file mapping created with
1743 * g_mapped_file_new(). It has only private members and should
1744 * not be accessed directly.
1746 public struct GMappedFile{}
1750 * Main Gtk struct.
1751 * A GOptionContext struct defines which options
1752 * are accepted by the commandline option parser. The struct has only private
1753 * fields and should not be directly accessed.
1755 public struct GOptionContext{}
1759 * A GOptionEntry defines a single option.
1760 * To have an effect, they must be added to a GOptionGroup with
1761 * g_option_context_add_main_entries() or g_option_group_add_entries().
1762 * constgchar*long_name;
1763 * The long name of an option can be used to specify it
1765 public struct GOptionEntry{}
1766 // char *longName;
1767 // glib-Commandline-option-parser.html
1768 // char shortName;
1769 // glib-Commandline-option-parser.html
1770 // int flags;
1771 // glib-Commandline-option-parser.html
1772 // GOptionArg arg;
1773 // glib-Commandline-option-parser.html
1774 // void* argData;
1775 // glib-Commandline-option-parser.html
1776 // char *description;
1777 // glib-Commandline-option-parser.html
1778 // char *argDescription;
1779 // glib-Commandline-option-parser.html
1783 * A GOptionGroup struct defines the options in a single
1784 * group. The struct has only private fields and should not be directly accessed.
1785 * All options in a group share the same translation function. Libaries which
1786 * need to parse commandline options are expected to provide a function for
1787 * getting a GOptionGroup holding their options, which
1788 * the application can then add to its GOptionContext.
1790 public struct GOptionGroup{}
1794 * Main Gtk struct.
1795 * A GPatternSpec is the 'compiled' form of a pattern.
1796 * This structure is opaque and its fields cannot be accessed directly.
1798 public struct GPatternSpec{}
1802 * Main Gtk struct.
1803 * A parse context is used to parse a stream of bytes that you expect to
1804 * contain marked-up text. See g_markup_parse_context_new(),
1805 * GMarkupParser, and so on for more details.
1807 public struct GMarkupParseContext{}
1811 * Any of the fields in GMarkupParser can be NULL, in which case they
1812 * will be ignored. Except for the error function, any of these
1813 * callbacks can set an error; in particular the
1814 * G_MARKUP_ERROR_UNKNOWN_ELEMENT, G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE,
1815 * and G_MARKUP_ERROR_INVALID_CONTENT errors are intended to be set
1816 * from these callbacks. If you set an error from a callback,
1817 * g_markup_parse_context_parse() will report that error back to its caller.
1818 * start_element()
1819 * Callback to invoke when the opening tag of an element
1821 public struct GMarkupParser{}
1822 // /+* Called for open tags <foo bar="baz"> +/
1823 // glib-Simple-XML-Subset-Parser.html
1824 // void (*startElement) (GMarkupParseContext *context,
1825 // glib-Simple-XML-Subset-Parser.html
1826 // char *elementName,
1827 // glib-Simple-XML-Subset-Parser.html
1828 // char **attributeNames,
1829 // glib-Simple-XML-Subset-Parser.html
1830 // char **attributeValues,
1831 // glib-Simple-XML-Subset-Parser.html
1832 // void* userData,
1833 // glib-Simple-XML-Subset-Parser.html
1834 // GError **error);
1835 // glib-Simple-XML-Subset-Parser.html
1836 // /+* Called for close tags </foo> +/
1837 // glib-Simple-XML-Subset-Parser.html
1838 // void (*endElement) (GMarkupParseContext *context,
1839 // glib-Simple-XML-Subset-Parser.html
1840 // char *elementName,
1841 // glib-Simple-XML-Subset-Parser.html
1842 // void* userData,
1843 // glib-Simple-XML-Subset-Parser.html
1844 // GError **error);
1845 // glib-Simple-XML-Subset-Parser.html
1846 // /+* Called for character data +/
1847 // glib-Simple-XML-Subset-Parser.html
1848 // /+* text is not nul-terminated +/
1849 // glib-Simple-XML-Subset-Parser.html
1850 // void (*text) (GMarkupParseContext *context,
1851 // glib-Simple-XML-Subset-Parser.html
1852 // char *text,
1853 // glib-Simple-XML-Subset-Parser.html
1854 // uint textLen,
1855 // glib-Simple-XML-Subset-Parser.html
1856 // void* userData,
1857 // glib-Simple-XML-Subset-Parser.html
1858 // GError **error);
1859 // glib-Simple-XML-Subset-Parser.html
1860 // /+* Called for strings that should be re-saved verbatim inn this same
1861 // glib-Simple-XML-Subset-Parser.html
1862 // * position, but are not otherwise interpretable. At the moment
1863 // glib-Simple-XML-Subset-Parser.html
1864 // * this includes comments and processing instructions.
1865 // glib-Simple-XML-Subset-Parser.html
1866 // +/
1867 // glib-Simple-XML-Subset-Parser.html
1868 // /+* text is not nul-terminated. +/
1869 // glib-Simple-XML-Subset-Parser.html
1870 // void (*passthrough) (GMarkupParseContext *context,
1871 // glib-Simple-XML-Subset-Parser.html
1872 // char *passthroughText,
1873 // glib-Simple-XML-Subset-Parser.html
1874 // uint textLen,
1875 // glib-Simple-XML-Subset-Parser.html
1876 // void* userData,
1877 // glib-Simple-XML-Subset-Parser.html
1878 // GError **error);
1879 // glib-Simple-XML-Subset-Parser.html
1880 // /+* Called on error, including one set by other
1881 // glib-Simple-XML-Subset-Parser.html
1882 // * methods inn the vtable. The GError should not be freed.
1883 // glib-Simple-XML-Subset-Parser.html
1884 // +/
1885 // glib-Simple-XML-Subset-Parser.html
1886 // void (*error) (GMarkupParseContext *context,
1887 // glib-Simple-XML-Subset-Parser.html
1888 // GError *error,
1889 // glib-Simple-XML-Subset-Parser.html
1890 // void* userData);
1891 // glib-Simple-XML-Subset-Parser.html
1895 * Main Gtk struct.
1896 * The GKeyFile struct contains only private fields
1897 * and should not be used directly.
1899 public struct GKeyFile{}
1903 * Main Gtk struct.
1904 * Warning
1905 * GMemChunk is deprecated and should not be used in newly-written code.
1906 * The GMemChunk struct is an opaque data structure representing a memory
1907 * chunk. It should be accessed only through the use of the following functions.
1909 public struct GMemChunk{}
1913 * Main Gtk struct.
1914 * The GList struct is used for each element in a doubly-linked list.
1915 * gpointerdata;
1916 * holds the element's data, which can be a pointer to any kind of data,
1918 public struct GList{}
1919 // void* data;
1920 // glib-Doubly-Linked-Lists.html
1921 // GList *next;
1922 // glib-Doubly-Linked-Lists.html
1923 // GList *prev;
1924 // glib-Doubly-Linked-Lists.html
1928 * Main Gtk struct.
1929 * The GSList struct is used for each element in the singly-linked list.
1930 * gpointerdata;
1931 * holds the element's data, which can be a pointer to any kind of data,
1933 public struct GSList{}
1934 // void* data;
1935 // glib-Singly-Linked-Lists.html
1936 // GSList *next;
1937 // glib-Singly-Linked-Lists.html
1941 * Main Gtk struct.
1942 * Contains the public fields of a Queue.
1943 * GList*head;
1944 * a pointer to the first element of the queue.
1945 * GList*tail;
1946 * a pointer to the last element of the queue.
1947 * guintlength;
1948 * the number of elements in the queue.
1950 public struct GQueue{}
1951 // GList *head;
1952 // glib-Double-ended-Queues.html
1953 // GList *tail;
1954 // glib-Double-ended-Queues.html
1955 // uint length;
1956 // glib-Double-ended-Queues.html
1960 * Main Gtk struct.
1961 * Each piece of memory that is pushed onto the stack
1962 * is cast to a GTrashStack*.
1963 * GTrashStack*next;
1964 * pointer to the previous element of the stack,
1965 * gets stored in the first sizeof (gpointer)
1966 * bytes of the element.
1968 public struct GTrashStack{}
1969 // GTrashStack *next;
1970 // glib-Trash-Stacks.html
1974 * Main Gtk struct.
1975 * The GHashTable struct is an opaque data structure to represent a
1976 * Hash Table.
1977 * It should only be accessed via the following functions.
1979 public struct GHashTable{}
1983 * Main Gtk struct.
1984 * The GString struct contains the public fields of a GString.
1985 * The str field points to the character data.
1986 * It may move as text is added.
1987 * The len field contains the length of the string,
1988 * not including the terminating nul byte.
1989 * The str field is nul-terminated and so can be used as an ordinary C
1990 * string. But it may be moved when text is appended or inserted into the
1991 * string.
1993 public struct GString
1995 char *str;
1996 uint len;
1997 uint allocatedLen;
2002 * Main Gtk struct.
2003 * An opaque data structure representing String Chunks.
2004 * It should only be accessed by using the following functions.
2006 public struct GStringChunk{}
2010 * Main Gtk struct.
2011 * Contains the public fields of an Array.
2012 * gchar*data;
2013 * a pointer to the element data. The data may be moved as elements are
2014 * added to the GArray.
2015 * guintlen;
2016 * the number of elements in the GArray.
2018 public struct GArray
2020 char *data;
2021 uint len;
2026 * Main Gtk struct.
2027 * Contains the public fields of a pointer array.
2028 * gpointer*pdata;
2029 * points to the array of pointers, which may be moved when the array grows.
2030 * guintlen;
2031 * number of pointers in the array.
2033 public struct GPtrArray
2035 void* *pdata;
2036 uint len;
2041 * Main Gtk struct.
2042 * The GByteArray struct allows access to the public fields of a GByteArray.
2043 * guint8*data;
2044 * a pointer to the element data. The data may be moved as elements are
2045 * added to the GByteArray.
2046 * guintlen;
2047 * the number of elements in the GByteArray.
2049 public struct GByteArray
2051 byte *data;
2052 uint len;
2057 * Main Gtk struct.
2058 * The GTree struct is an opaque data structure representing a
2059 * Balanced Binary Tree.
2060 * It should be accessed only by using the following functions.
2062 public struct GTree{}
2066 * Main Gtk struct.
2067 * The GNode struct represents one node in a
2068 * N-ary Tree.
2069 * The data field contains the actual data of the node.
2070 * The next and prev
2071 * fields point to the node's siblings (a sibling is another GNode with the
2072 * same parent).
2073 * The parent field points to the parent of the GNode,
2074 * or is NULL if the GNode is the root of the tree.
2075 * The children field points to the first child of the
2076 * GNode. The other children are accessed by using the
2077 * next pointer of each child.
2079 public struct GNode{}
2080 // void* data;
2081 // glib-N-ary-Trees.html
2082 // GNode *next;
2083 // glib-N-ary-Trees.html
2084 // GNode *prev;
2085 // glib-N-ary-Trees.html
2086 // GNode *parent;
2087 // glib-N-ary-Trees.html
2088 // GNode *children;
2089 // glib-N-ary-Trees.html
2093 * Main Gtk struct.
2094 * The GData struct is an opaque data structure to represent a
2095 * Keyed Data List.
2096 * It should only be accessed via the following functions.
2098 public struct GData{}
2102 * Main Gtk struct.
2103 * The GRelation struct is an opaque data structure to represent a
2104 * Relation.
2105 * It should only be accessed via the following functions.
2107 public struct GRelation{}
2111 * The GTuples struct is used to return records (or tuples) from the
2112 * GRelation by g_relation_select().
2113 * It only contains one public member - the number of records that matched.
2114 * To access the matched records, you must use g_tuples_index().
2115 * guintlen;
2116 * the number of records that matched.
2118 public struct GTuples
2120 uint len;
2125 * Main Gtk struct.
2126 * The GCache struct is an opaque data structure containing information about
2127 * a GCache. It should only be accessed via the following functions.
2129 public struct GCache{}
2133 * Main Gtk struct.
2134 * Warning
2135 * GAllocator is deprecated and should not be used in newly-written code.
2136 * The GAllocator struct contains private data. and
2137 * should only be accessed using the following functions.
2139 public struct GAllocator{}
2143 * Checks the version of the GLib library.
2144 * Returns TRUE if the version of the GLib header files is the same
2145 * as or newer than the passed-in version.
2146 * Example1.Checking the version of the GLib library
2147 * if (!GLIB_CHECK_VERSION (1, 2, 0))
2148 * g_error ("GLib version 1.2.0 or above is needed");
2149 * major:
2150 * the major version number.
2151 * minor:
2152 * the minor version number.
2153 * micro:
2154 * the micro version number.
2156 // TODO
2157 // #define GLIB_CHECK_VERSION(major,minor,micro)
2160 * Warning
2161 * g_main_new has been deprecated since version 2.2 and should not be used in newly-written code. Use g_main_loop_new() instead.
2162 * Creates a new GMainLoop for the default main loop.
2163 * is_running:
2164 * set to TRUE to indicate that the loop is running. This is not
2165 * very important since calling g_main_run() will set this to TRUE anyway.
2166 * Returns:
2167 * a new GMainLoop.
2169 // TODO
2170 // #define g_main_new(is_running)
2173 * Warning
2174 * g_main_destroy has been deprecated since version 2.2 and should not be used in newly-written code. Use g_main_loop_unref() instead.
2175 * Frees the memory allocated for the GMainLoop.
2176 * loop:
2177 * a GMainLoop.
2179 // TODO
2180 // #define g_main_destroy(loop)
2183 * Warning
2184 * g_main_run has been deprecated since version 2.2 and should not be used in newly-written code. Use g_main_loop_run() instead.
2185 * Runs a main loop until it stops running.
2186 * loop:
2187 * a GMainLoop.
2189 // TODO
2190 // #define g_main_run(loop)
2193 * Warning
2194 * g_main_quit has been deprecated since version 2.2 and should not be used in newly-written code. Use g_main_loop_quit() instead.
2195 * Stops the GMainLoop. If g_main_run() was called to run the GMainLoop,
2196 * it will now return.
2197 * loop:
2198 * a GMainLoop.
2200 // TODO
2201 // #define g_main_quit(loop)
2204 * Warning
2205 * g_main_is_running has been deprecated since version 2.2 and should not be used in newly-written code. USe g_main_loop_is_running() instead.
2206 * Checks if the main loop is running.
2207 * loop:
2208 * a GMainLoop.
2209 * Returns:
2210 * TRUE if the main loop is running.
2212 // TODO
2213 // #define g_main_is_running(loop)
2216 * Warning
2217 * g_main_iteration has been deprecated since version 2.2 and should not be used in newly-written code. Use g_main_context_iteration() instead.
2218 * Runs a single iteration for the default GMainContext.
2219 * may_block:
2220 * set to TRUE if it should block (i.e. wait) until an event source
2221 * becomes ready. It will return after an event source has been processed.
2222 * If set to FALSE it will return immediately if no event source is ready to be
2223 * processed.
2224 * Returns:
2225 * TRUE if more events are pending.
2227 // TODO
2228 // #define g_main_iteration(may_block)
2231 * Warning
2232 * g_main_pending has been deprecated since version 2.2 and should not be used in newly-written code. Use g_main_context_pending() instead.
2233 * Checks if any events are pending for the default GMainContext
2234 * (i.e. ready to be processed).
2235 * Returns:
2236 * TRUE if any events are pending.
2238 // TODO
2239 // #define g_main_pending()
2242 * Warning
2243 * g_main_set_poll_func has been deprecated since version 2.2 and should not be used in newly-written code. Use g_main_context_set_poll_func() instead.
2244 * Sets the function to use for the handle polling of file descriptors
2245 * for the default main context.
2246 * func:
2247 * the function to call to poll all file descriptors.
2249 // TODO
2250 // #define g_main_set_poll_func(func)
2253 * Allocates n_structs elements of type struct_type.
2254 * The returned pointer is cast to a pointer to the given type.
2255 * If n_structs is 0 it returns NULL.
2256 * Since the returned pointer is already casted to the right type,
2257 * it is normally unnecessary to cast it explicitly, and doing
2258 * so might hide memory allocation errors.
2259 * struct_type:
2260 * the type of the elements to allocate.
2261 * n_structs:
2262 * the number of elements to allocate.
2263 * Returns:
2264 * a pointer to the allocated memory, cast to a pointer to struct_type.
2266 // TODO
2267 // #define g_new(struct_type, n_structs)
2270 * Allocates n_structs elements of type struct_type, initialized to 0's.
2271 * The returned pointer is cast to a pointer to the given type.
2272 * If n_structs is 0 it returns NULL.
2273 * Since the returned pointer is already casted to the right type,
2274 * it is normally unnecessary to cast it explicitly, and doing
2275 * so might hide memory allocation errors.
2276 * struct_type:
2277 * the type of the elements to allocate.
2278 * n_structs:
2279 * the number of elements to allocate.
2280 * Returns:
2281 * a pointer to the allocated memory, cast to a pointer to struct_type.
2283 // TODO
2284 // #define g_new0(struct_type, n_structs)
2287 * Reallocates the memory pointed to by mem, so that it now has space for
2288 * n_structs elements of type struct_type. It returns the new address of
2289 * the memory, which may have been moved.
2290 * struct_type:
2291 * the type of the elements to allocate.
2292 * mem:
2293 * the currently allocated memory.
2294 * n_structs:
2295 * the number of elements to allocate.
2296 * Returns:
2297 * a pointer to the new allocated memory, cast to a pointer to struct_type.
2299 // TODO
2300 // #define g_renew(struct_type, mem, n_structs)
2303 * Attempts to allocate n_structs elements of type struct_type, and returns
2304 * NULL on failure. Contrast with g_new(), which aborts the program on failure.
2305 * The returned pointer is cast to a pointer to the given type.
2306 * If n_structs is 0 it returns NULL.
2307 * struct_type:
2308 * the type of the elements to allocate.
2309 * n_structs:
2310 * the number of elements to allocate.
2311 * Returns:
2312 * a pointer to the allocated memory, cast to a pointer to struct_type.
2313 * Since 2.8
2315 // TODO
2316 // #define g_try_new(struct_type, n_structs)
2319 * Attempts to allocate n_structs elements of type struct_type, initialized
2320 * to 0's, and returns NULL on failure. Contrast with g_new0(), which aborts
2321 * the program on failure.
2322 * The returned pointer is cast to a pointer to the given type.
2323 * If n_counts is 0 it returns NULL.
2324 * struct_type:
2325 * the type of the elements to allocate.
2326 * n_structs:
2327 * the number of elements to allocate.
2328 * Returns:
2329 * a pointer to the allocated memory, cast to a pointer to struct_type.
2330 * Since 2.8
2332 // TODO
2333 // #define g_try_new0(struct_type, n_structs)
2336 * Attempts to reallocate the memory pointed to by mem, so that it now has
2337 * space for n_structs elements of type struct_type, and returns NULL on
2338 * failure. Contrast with g_renew(), which aborts the program on failure.
2339 * It returns the new address of the memory, which may have been moved.
2340 * struct_type:
2341 * the type of the elements to allocate.
2342 * mem:
2343 * the currently allocated memory.
2344 * n_structs:
2345 * the number of elements to allocate.
2346 * Returns:
2347 * a pointer to the new allocated memory, cast to a pointer to struct_type.
2348 * Since 2.8
2350 // TODO
2351 // #define g_try_renew(struct_type, mem, n_structs)
2354 * Allocates size bytes on the stack; these bytes will be freed when the current
2355 * stack frame is cleaned up. This macro essentially just wraps the
2356 * alloca() function present on most UNIX variants.
2357 * Thus it provides the same advantages and pitfalls as alloca():
2358 * + alloca() is very fast, as on most systems it's implemented by just adjusting
2359 * the stack pointer register.
2360 * + It doesn't cause any memory fragmentation, within its scope, separate alloca()
2361 * blocks just build up and are released together at function end.
2362 * - Allocation sizes have to fit into the current stack frame. For instance in a
2363 * threaded environment on Linux, the per-thread stack size is limited to 2 Megabytes,
2364 * so be sparse with alloca() uses.
2365 * - Allocation failure due to insufficient stack space is not indicated with a NULL
2366 * return like e.g. with malloc(). Instead, most systems probably handle it the same
2367 * way as out of stack space situations from infinite function recursion, i.e.
2368 * with a segmentation fault.
2369 * - Special care has to be taken when mixing alloca() with GNU C variable sized arrays.
2370 * Stack space allocated with alloca() in the same scope as a variable sized array
2371 * will be freed together with the variable sized array upon exit of that scope, and
2372 * not upon exit of the enclosing function scope.
2373 * size:
2374 * number of bytes to allocate.
2375 * Returns:
2376 * space for size bytes, allocated on the stack
2378 // TODO
2379 // #define g_alloca(size)
2382 * Wraps g_alloca() in a more typesafe manner.
2383 * struct_type:
2384 * Type of memory chunks to be allocated
2385 * n_structs:
2386 * Number of chunks to be allocated
2387 * Returns:
2388 * Pointer to stack space for n_structs chunks of type struct_type
2390 // TODO
2391 // #define g_newa(struct_type, n_structs)
2394 * Copies a block of memory len bytes long, from src to dest.
2395 * The source and destination areas may overlap.
2396 * In order to use this function, you must include
2397 * string.h yourself, because this macro will
2398 * typically simply resolve to memmove() and GLib does not include
2399 * string.h for you.
2400 * dest:
2401 * the destination address to copy the bytes to.
2402 * src:
2403 * the source address to copy the bytes from.
2404 * len:
2405 * the number of bytes to copy.
2407 // TODO
2408 // #define g_memmove(dest,src,len)
2411 * Returns from the current function if the expression is not true.
2412 * If the expression evaluates to FALSE, a critical message is logged and
2413 * the function returns. This can only be used in functions which do not return
2414 * a value.
2415 * expr:
2416 * the expression to check.
2418 // TODO
2419 // #define g_return_if_fail(expr)
2422 * Returns from the current function, returning the value val, if the expression
2423 * is not true.
2424 * If the expression evaluates to FALSE, a critical message is logged and
2425 * val is returned.
2426 * expr:
2427 * the expression to check.
2428 * val:
2429 * the value to return from the current function if the expression is not
2430 * true.
2432 // TODO
2433 // #define g_return_val_if_fail(expr,val)
2436 * Logs a critical message and returns from the current function.
2437 * This can only be used in functions which do not return a value.
2439 // TODO
2440 // #define g_return_if_reached()
2443 * Logs a critical message and returns val.
2444 * val:
2445 * the value to return from the current function.
2447 // TODO
2448 // #define g_return_val_if_reached(val)
2451 * Debugging macro to terminate the application if the assertion fails.
2452 * If the assertion fails (i.e. the expression is not true), an error message
2453 * is logged and the application is terminated.
2454 * The macro can be turned off in final releases of code by defining
2455 * G_DISABLE_ASSERT when compiling the application.
2456 * expr:
2457 * the expression to check.
2459 // TODO
2460 // #define g_assert(expr)
2463 * Debugging macro to terminate the application if it is ever reached.
2464 * If it is reached, an error message is logged and the application is terminated.
2465 * The macro can be turned off in final releases of code by defining
2466 * G_DISABLE_ASSERT when compiling the application.
2468 // TODO
2469 // #define g_assert_not_reached()
2472 * Inserts a breakpoint instruction into the code (on x86 machines only).
2474 // TODO
2475 // #define G_BREAKPOINT()
2478 * A convenience function/macro to log a normal message.
2479 * ...:
2480 * format string, followed by parameters to insert into the format string (as with printf())
2482 // TODO
2483 // #define g_message(...)
2486 * A convenience function/macro to log a warning message.
2487 * You can make warnings fatal at runtime by setting the G_DEBUG environment
2488 * variable (see Running GLib Applications).
2489 * ...:
2490 * format string, followed by parameters to insert into the format string (as with printf())
2492 // TODO
2493 // #define g_warning(...)
2496 * Logs a "critical warning" (G_LOG_LEVEL_CRITICAL). It's more or less
2497 * application-defined what constitutes a critical vs. a regular
2498 * warning. You could call g_log_set_always_fatal() to make critical
2499 * warnings exit the program, then use g_critical() for fatal errors, for
2500 * example.
2501 * You can also make critical warnings fatal at runtime by setting
2502 * the G_DEBUG environment variable (see
2503 * Running GLib Applications).
2504 * ...:
2505 * format string, followed by parameters to insert into the format string (as with printf())
2507 // TODO
2508 // #define g_critical(...)
2511 * A convenience function/macro to log an error message.
2512 * Error messages are always fatal, resulting in a call to
2513 * abort() to terminate the application.
2514 * This function will result in a core dump; don't use it for errors you
2515 * expect. Using this function indicates a bug in your program, i.e. an
2516 * assertion failure.
2517 * ...:
2518 * format string, followed by parameters to insert into the format string (as with printf())
2520 // TODO
2521 // #define g_error(...)
2524 * A convenience function/macro to log a debug message.
2525 * ...:
2526 * format string, followed by parameters to insert into the format string (as with printf())
2527 * Since 2.6
2529 // TODO
2530 // #define g_debug(...)
2533 * Removes leading and trailing whitespace from a string. See g_strchomp() and
2534 * g_strchug().
2535 * string:
2536 * a string to remove the leading and trailing whitespace from.
2538 // TODO
2539 // #define g_strstrip( string )
2542 * Skips to the next character in a UTF-8 string. The string must be
2543 * valid; this macro is as fast as possible, and has no error-checking.
2544 * You would use this macro to iterate over a string character by
2545 * character. The macro returns the start of the next UTF-8 character.
2546 * Before using this macro, use g_utf8_validate() to validate strings
2547 * that may contain invalid UTF-8.
2548 * p:
2549 * Pointer to the start of a valid UTF-8 character.
2551 // TODO
2552 // #define g_utf8_next_char(p)
2555 * Marks a string for translation, gets replaced with the translated string
2556 * at runtime.
2557 * String:
2558 * the string to be translated
2559 * Since 2.4
2561 // TODO
2562 // #define _(String)
2565 * Like _(), but applies g_strip_context() to the translation. This has the
2566 * advantage that the string can be adorned with a prefix to guarantee
2567 * uniqueness and provide context to the translator.
2568 * One use case given in the gettext manual is GUI translation, where one could
2569 * e.g. disambiguate two "Open" menu entries as "File|Open" and "Printer|Open".
2570 * Another use case is the string "Russian" which may have to be translated
2571 * differently depending on whether it's the name of a character set or a
2572 * language. This could be solved by using "charset|Russian" and
2573 * "language|Russian".
2574 * String:
2575 * the string to be translated, with a '|'-separated prefix which
2576 * must not be translated
2577 * Since 2.4
2579 // TODO
2580 // #define Q_(String)
2583 * Marks a string for translation, gets replaced with the untranslated string
2584 * at runtime. This is useful in situations where the translated strings can't
2585 * be directly used, e.g. in string array initializers.
2587 * static const char *messages[] = {
2588 * N_("some very meaningful message"),
2589 * N_("and another one")
2590 * };
2591 * const char *string;
2592 * ...
2593 * string
2594 * = index > 1 ? _("a default message") : gettext (messages[index]);
2595 * fputs (string);
2596 * ...
2598 * String:
2599 * the string to be translated
2600 * Since 2.4
2602 // TODO
2603 // #define N_(String)
2606 * Returns a random gboolean from rand_. This corresponds to a unbiased
2607 * coin toss.
2608 * rand_:
2609 * a GRand.
2610 * Returns:
2611 * a random gboolean.
2613 // TODO
2614 // #define g_rand_boolean(rand_)
2617 * Returns a random gboolean. This corresponds to a unbiased coin toss.
2618 * Returns:
2619 * a random gboolean.
2621 // TODO
2622 // #define g_random_boolean()
2625 * Warning
2626 * g_scanner_freeze_symbol_table has been deprecated since version 2.2 and should not be used in newly-written code. This macro does nothing.
2627 * There is no reason to use this macro, since it does nothing.
2628 * scanner:
2629 * a GScanner.
2631 // TODO
2632 // #define g_scanner_freeze_symbol_table(scanner)
2635 * Warning
2636 * g_scanner_thaw_symbol_table has been deprecated since version 2.2 and should not be used in newly-written code. This macro does nothing.
2637 * There is no reason to use this macro, since it does nothing.
2638 * scanner:
2639 * a GScanner.
2641 // TODO
2642 // #define g_scanner_thaw_symbol_table(scanner)
2645 * Warning
2646 * g_scanner_add_symbol has been deprecated since version 2.2 and should not be used in newly-written code. Use g_scanner_scope_add_symbol() instead.
2647 * Adds a symbol to the default scope.
2648 * scanner:
2649 * a GScanner.
2650 * symbol:
2651 * the symbol to add.
2652 * value:
2653 * the value of the symbol.
2655 // TODO
2656 // #define g_scanner_add_symbol( scanner, symbol, value )
2659 * Warning
2660 * g_scanner_remove_symbol has been deprecated since version 2.2 and should not be used in newly-written code. Use g_scanner_scope_remove_symbol() instead.
2661 * Removes a symbol from the default scope.
2662 * scanner:
2663 * a GScanner.
2664 * symbol:
2665 * the symbol to remove.
2667 // TODO
2668 // #define g_scanner_remove_symbol( scanner, symbol )
2671 * Warning
2672 * g_scanner_foreach_symbol has been deprecated since version 2.2 and should not be used in newly-written code. Use g_scanner_scope_foreach_symbol() instead.
2673 * Calls a function for each symbol in the default scope.
2674 * scanner:
2675 * a GScanner.
2676 * func:
2677 * the function to call with each symbol.
2678 * data:
2679 * data to pass to the function.
2681 // TODO
2682 // #define g_scanner_foreach_symbol( scanner, func, data )
2685 * Provided for UNIX emulation on Windows; see documentation for pipe()
2686 * in any UNIX manual.
2687 * phandles:
2688 * file descriptors, the first one for reading, the second one for writing.
2690 // TODO
2691 // #define pipe(phandles) _pipe (phandles, 4096, _O_BINARY)
2694 * On Windows, this macro defines a DllMain() function
2695 * that stores the actual DLL name that the code being compiled will be
2696 * included in.
2697 * On non-Windows platforms, expands to nothing.
2698 * static:
2699 * empty or "static".
2700 * dll_name:
2701 * the name of the (pointer to the) char array where the DLL name
2702 * will be stored. If this is used, you must also include
2703 * windows.h. If you need a more complex DLL entry
2704 * point function, you cannot use this.
2706 // TODO
2707 // #define G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name)
2710 * On Windows, this macro defines an expression which evaluates to TRUE
2711 * if the code is running on a version of Windows where the wide
2712 * character versions of the Win32 API functions, and the wide chaacter
2713 * versions of the C library functions work. (They are always present in
2714 * the DLLs, but don't work on Windows 9x and Me.)
2715 * On non-Windows platforms, it is not defined.
2716 * Since 2.6
2718 // TODO
2719 // #define G_WIN32_HAVE_WIDECHAR_API() TRUE
2722 * On Windows, this macro defines an expression which evaluates to TRUE
2723 * if the code is running on an NT-based Windows operating system.
2724 * On non-Windows platforms, it is not defined.
2725 * Since 2.6
2727 // TODO
2728 // #define G_WIN32_IS_NT_BASED() TRUE
2731 * A convenience macro to allocate a block of memory from the slice allocator.
2732 * It calls g_slice_alloc() with sizeof (type) and casts the returned pointer
2733 * to a pointer of the given type, avoiding a type cast in the source code.
2734 * Note that the underlying slice allocation mechanism can
2735 * be changed with the G_SLICE=always-malloc
2736 * environment variable.
2737 * type:
2738 * the type to allocate, typically a structure name
2739 * Returns:
2740 * a pointer to the allocated block, cast to a pointer to type.
2741 * Since 2.10
2743 // TODO
2744 // #define g_slice_new(type)
2747 * A convenience macro to allocate a block of memory from the slice allocator
2748 * and set the memory to 0. It calls g_slice_alloc0() with sizeof (type) and
2749 * casts the returned pointer to a pointer of the given type, avoiding a type
2750 * cast in the source code.
2751 * Note that the underlying slice allocation mechanism can
2752 * be changed with the G_SLICE=always-malloc
2753 * environment variable.
2754 * type:
2755 * the type to allocate, typically a structure name
2756 * Returns:
2757 * a pointer to the allocated block, cast to a pointer to type.
2758 * Since 2.10
2760 // TODO
2761 // #define g_slice_new0(type)
2764 * A convenience macro to free a block of memory that has been allocated
2765 * from the slice allocator. It calls g_slice_free1() using
2766 * sizeof (type) as the block size.
2767 * Note that the exact release behaviour can be changed with the
2768 * G_DEBUG=gc-friendly environment variable,
2769 * also see G_SLICE for related debugging options.
2770 * type:
2771 * the type of the block to free, typically a structure name
2772 * mem:
2773 * a pointer to the block to free
2774 * Since 2.10
2776 // TODO
2777 // #define g_slice_free(type, mem)
2780 * Frees a linked list of memory blocks of structure type type.
2781 * The memory blocks must be equal-sized, allocated via
2782 * g_slice_alloc() or g_slice_alloc0() and linked together by a
2783 * next pointer (similar to GSList). The name of the
2784 * next field in type is passed as third argument.
2785 * Note that the exact release behaviour can be changed with the
2786 * G_DEBUG=gc-friendly environment variable,
2787 * also see G_SLICE for related debugging options.
2788 * type:
2789 * the type of the mem_chain blocks
2790 * mem_chain:
2791 * a pointer to the first block of the chain
2792 * next:
2793 * the field name of the next pointer in type
2794 * Since 2.10
2795 * [5]
2796 * [Bonwick94] Jeff Bonwick, The slab allocator: An object-caching kernel
2797 * memory allocator. USENIX 1994, and
2798 * [Bonwick01] Bonwick and Jonathan Adams, Magazines and vmem: Extending the
2799 * slab allocator to many cpu's and arbitrary resources. USENIX 2001
2801 // TODO
2802 // #define g_slice_free_chain(type, mem_chain, next)
2805 * Warning
2806 * g_mem_chunk_create has been deprecated since version 2.10 and should not be used in newly-written code. Use the slice
2807 * allocator instead
2808 * A convenience macro for creating a new GMemChunk.
2809 * It calls g_mem_chunk_new(), using the given type to create the GMemChunk
2810 * name. The atom size is determined using sizeof(), and the
2811 * area size is calculated by multiplying the pre_alloc parameter with
2812 * the atom size.
2813 * type:
2814 * the type of the atoms, typically a structure name.
2815 * pre_alloc:
2816 * the number of atoms to store in each block of memory.
2817 * alloc_type:
2818 * the type of the GMemChunk.
2819 * G_ALLOC_AND_FREE is used if the atoms will be freed individually.
2820 * G_ALLOC_ONLY should be used if atoms will never be freed individually.
2821 * G_ALLOC_ONLY is quicker, since it does not need to track free atoms,
2822 * but it obviously wastes memory if you no longer need many of the atoms.
2823 * Returns:
2824 * the new GMemChunk.
2826 // TODO
2827 // #define g_mem_chunk_create(type, pre_alloc, alloc_type)
2830 * Warning
2831 * g_chunk_new has been deprecated since version 2.10 and should not be used in newly-written code. Use g_slice_new() instead
2832 * A convenience macro to allocate an atom of memory from a GMemChunk.
2833 * It calls g_mem_chunk_alloc() and casts the returned atom to a pointer to
2834 * the given type, avoiding a type cast in the source code.
2835 * type:
2836 * the type of the GMemChunk atoms, typically a structure name.
2837 * chunk:
2838 * a GMemChunk.
2839 * Returns:
2840 * a pointer to the allocated atom, cast to a pointer to type.
2842 // TODO
2843 // #define g_chunk_new(type, chunk)
2846 * Warning
2847 * g_chunk_new0 has been deprecated since version 2.10 and should not be used in newly-written code. Use g_slice_new0() instead
2848 * A convenience macro to allocate an atom of memory from a GMemChunk.
2849 * It calls g_mem_chunk_alloc0() and casts the returned atom to a pointer to
2850 * the given type, avoiding a type cast in the source code.
2851 * type:
2852 * the type of the GMemChunk atoms, typically a structure name.
2853 * chunk:
2854 * a GMemChunk.
2855 * Returns:
2856 * a pointer to the allocated atom, cast to a pointer to type.
2858 // TODO
2859 // #define g_chunk_new0(type, chunk)
2862 * Warning
2863 * g_chunk_free has been deprecated since version 2.10 and should not be used in newly-written code. Use g_slice_free() instead
2864 * A convenience macro to free an atom of memory from a GMemChunk.
2865 * It simply switches the arguments and calls g_mem_chunk_free()
2866 * It is included simply to complement the other convenience macros, g_chunk_new()
2867 * and g_chunk_new0().
2868 * mem:
2869 * a pointer to the atom to be freed.
2870 * mem_chunk:
2871 * a GMemChunk.
2873 // TODO
2874 // #define g_chunk_free(mem, mem_chunk)
2877 * A convenience macro to gets the previous element in a GList.
2878 * list:
2879 * an element in a GList.
2880 * Returns:
2881 * the previous element, or NULL if there are no previous elements.
2883 // TODO
2884 // #define g_list_previous(list)
2887 * A convenience macro to gets the next element in a GList.
2888 * list:
2889 * an element in a GList.
2890 * Returns:
2891 * the next element, or NULL if there are no more elements.
2893 // TODO
2894 // #define g_list_next(list)
2897 * A convenience macro to gets the next element in a GSList.
2898 * slist:
2899 * an element in a GSList.
2900 * Returns:
2901 * the next element, or NULL if there are no more elements.
2903 // TODO
2904 // #define g_slist_next(slist)
2907 * Warning
2908 * g_hash_table_freeze is deprecated and should not be used in newly-written code.
2909 * This function is deprecated and will be removed in the next major
2910 * release of GLib. It does nothing.
2911 * hash_table:
2912 * a GHashTable
2914 // TODO
2915 // #define g_hash_table_freeze(hash_table)
2918 * Warning
2919 * g_hash_table_thaw is deprecated and should not be used in newly-written code.
2920 * This function is deprecated and will be removed in the next major
2921 * release of GLib. It does nothing.
2922 * hash_table:
2923 * a GHashTable
2925 // TODO
2926 // #define g_hash_table_thaw(hash_table)
2929 * Adds the value on to the end of the array.
2930 * The array will grow in size automatically if necessary.
2931 * Note
2932 * g_array_append_val() is a macro which uses a reference to the value
2933 * parameter v. This means that you cannot use it with literal values
2934 * such as "27". You must use variables.
2935 * a:
2936 * a GArray.
2937 * v:
2938 * the value to append to the GArray.
2939 * Returns:
2940 * the GArray.
2942 // TODO
2943 // #define g_array_append_val(a,v)
2946 * Adds the value on to the start of the array.
2947 * The array will grow in size automatically if necessary.
2948 * This operation is slower than g_array_append_val() since the existing elements
2949 * in the array have to be moved to make space for the new element.
2950 * Note
2951 * g_array_prepend_val() is a macro which uses a reference to the value
2952 * parameter v. This means that you cannot use it with literal values
2953 * such as "27". You must use variables.
2954 * a:
2955 * a GArray.
2956 * v:
2957 * the value to prepend to the GArray.
2958 * Returns:
2959 * the GArray.
2961 // TODO
2962 // #define g_array_prepend_val(a,v)
2965 * Inserts an element into an array at the given index.
2966 * Note
2967 * g_array_insert_val() is a macro which uses a reference to the value
2968 * parameter v. This means that you cannot use it with literal values
2969 * such as "27". You must use variables.
2970 * a:
2971 * a GArray.
2972 * i:
2973 * the index to place the element at.
2974 * v:
2975 * the value to insert into the array.
2976 * Returns:
2977 * the GArray.
2979 // TODO
2980 // #define g_array_insert_val(a,i,v)
2983 * Returns the element of a GArray at the given index.
2984 * The return value is cast to the given type.
2985 * Example6.Getting a pointer to an element in a GArray
2986 * EDayViewEvent *event;
2987 * /+* This gets a pointer to the 3rd element in the array of EDayViewEvent
2988 * structs. +/
2989 * event = g_array_index (events, EDayViewEvent, 3);
2990 * a:
2991 * a GArray.
2992 * t:
2993 * the type of the elements.
2994 * i:
2995 * the index of the element to return.
2996 * Returns:
2997 * the element of the GArray at the index given by i.
2999 // TODO
3000 // #define g_array_index(a,t,i)
3003 * Returns the pointer at the given index of the pointer array.
3004 * array:
3005 * a GPtrArray.
3006 * index_:
3007 * the index of the pointer to return.
3008 * Returns:
3009 * the pointer at the given index.
3011 // TODO
3012 // #define g_ptr_array_index(array,index_)
3015 * Inserts a GNode as the last child of the given parent.
3016 * parent:
3017 * the GNode to place the new GNode under.
3018 * node:
3019 * the GNode to insert.
3020 * Returns:
3021 * the inserted GNode.
3023 // TODO
3024 // #define g_node_append(parent, node)
3027 * Inserts a new GNode at the given position.
3028 * parent:
3029 * the GNode to place the new GNode under.
3030 * position:
3031 * the position to place the new GNode at.
3032 * If position is -1, the new GNode is inserted as the last child of parent.
3033 * data:
3034 * the data for the new GNode.
3035 * Returns:
3036 * the new GNode.
3038 // TODO
3039 // #define g_node_insert_data(parent, position, data)
3042 * Inserts a new GNode before the given sibling.
3043 * parent:
3044 * the GNode to place the new GNode under.
3045 * sibling:
3046 * the sibling GNode to place the new GNode before.
3047 * data:
3048 * the data for the new GNode.
3049 * Returns:
3050 * the new GNode.
3052 // TODO
3053 // #define g_node_insert_data_before(parent, sibling, data)
3056 * Inserts a new GNode as the last child of the given parent.
3057 * parent:
3058 * the GNode to place the new GNode under.
3059 * data:
3060 * the data for the new GNode.
3061 * Returns:
3062 * the new GNode.
3064 // TODO
3065 // #define g_node_append_data(parent, data)
3068 * Inserts a new GNode as the first child of the given parent.
3069 * parent:
3070 * the GNode to place the new GNode under.
3071 * data:
3072 * the data for the new GNode.
3073 * Returns:
3074 * the new GNode.
3076 // TODO
3077 // #define g_node_prepend_data(parent, data)
3080 * Gets the first child of a GNode.
3081 * node:
3082 * a GNode.
3083 * Returns:
3084 * the last child of node, or NULL if node is NULL or has no children.
3086 // TODO
3087 // #define g_node_first_child(node)
3090 * Gets the next sibling of a GNode.
3091 * node:
3092 * a GNode.
3093 * Returns:
3094 * the next sibling of node, or NULL if node is NULL.
3096 // TODO
3097 // #define g_node_next_sibling(node)
3100 * Gets the previous sibling of a GNode.
3101 * node:
3102 * a GNode.
3103 * Returns:
3104 * the previous sibling of node, or NULL if node is NULL.
3106 // TODO
3107 // #define g_node_prev_sibling(node)
3110 * Returns TRUE if a GNode is a leaf node.
3111 * node:
3112 * a GNode.
3113 * Returns:
3114 * TRUE if the GNode is a leaf node (i.e. it has no children).
3116 // TODO
3117 // #define G_NODE_IS_LEAF(node) (((GNode*) (node))->children == NULL)
3120 * Returns TRUE if a GNode is the root of a tree.
3121 * node:
3122 * a GNode.
3123 * Returns:
3124 * TRUE if the GNode is the root of a tree (i.e. it has no parent
3125 * or siblings).
3127 // TODO
3128 // #define G_NODE_IS_ROOT(node)
3131 * Sets the data corresponding to the given GQuark id.
3132 * Any previous data with the same key is removed, and its
3133 * destroy function is called.
3134 * dl:
3135 * a datalist.
3136 * q:
3137 * the GQuark to identify the data element.
3138 * d:
3139 * the data element, or NULL to remove any previous element
3140 * corresponding to q.
3142 // TODO
3143 // #define g_datalist_id_set_data(dl, q, d)
3146 * Removes an element, using its GQuark identifier.
3147 * dl:
3148 * a datalist.
3149 * q:
3150 * the GQuark identifying the data element.
3152 // TODO
3153 // #define g_datalist_id_remove_data(dl, q)
3156 * Sets the data element corresponding to the given string identifier.
3157 * dl:
3158 * a datalist.
3159 * k:
3160 * the string to identify the data element.
3161 * d:
3162 * the data element, or NULL to remove any previous element
3163 * corresponding to k.
3165 // TODO
3166 // #define g_datalist_set_data(dl, k, d)
3169 * Sets the data element corresponding to the given string identifier, and the
3170 * function to be called when the data element is removed.
3171 * dl:
3172 * a datalist.
3173 * k:
3174 * the string to identify the data element.
3175 * d:
3176 * the data element, or NULL to remove any previous element corresponding to
3177 * k.
3178 * f:
3179 * the function to call when the data element is removed. This
3180 * function will be called with the data element and can be used to free any
3181 * memory allocated for it. If d is NULL, then f must also be NULL.
3183 // TODO
3184 // #define g_datalist_set_data_full(dl, k, d, f)
3187 * Gets a data element, using its string identifer.
3188 * This is slower than g_datalist_id_get_data() because the string is first
3189 * converted to a GQuark.
3190 * dl:
3191 * a datalist.
3192 * k:
3193 * the string identifying a data element.
3194 * Returns:
3195 * the data element, or NULL if it is not found.
3197 // TODO
3198 // #define g_datalist_get_data(dl, k)
3201 * Removes an element using its string identifier.
3202 * The data element's destroy function is called if it has been set.
3203 * dl:
3204 * a datalist.
3205 * k:
3206 * the string identifying the data element.
3208 // TODO
3209 // #define g_datalist_remove_data(dl, k)
3212 * Removes an element, without calling its destroy notifier.
3213 * dl:
3214 * a datalist.
3215 * k:
3216 * the string identifying the data element.
3218 // TODO
3219 // #define g_datalist_remove_no_notify(dl, k)
3222 * Sets the data element associated with the given GQuark id.
3223 * Any previous data with the same key is removed, and its destroy function
3224 * is called.
3225 * l:
3226 * the location identifying the dataset.
3227 * k:
3228 * the GQuark id to identify the data element.
3229 * d:
3230 * the data element.
3232 // TODO
3233 // #define g_dataset_id_set_data(l, k, d)
3236 * Removes a data element from a dataset.
3237 * The data element's destroy function is called if it has been set.
3238 * l:
3239 * the location identifying the dataset.
3240 * k:
3241 * the GQuark id identifying the data element.
3243 // TODO
3244 // #define g_dataset_id_remove_data(l, k)
3247 * Sets the data corresponding to the given string identifier.
3248 * l:
3249 * the location identifying the dataset.
3250 * k:
3251 * the string to identify the data element.
3252 * d:
3253 * the data element.
3255 // TODO
3256 // #define g_dataset_set_data(l, k, d)
3259 * Sets the data corresponding to the given string identifier, and the function
3260 * to call when the data element is destroyed.
3261 * l:
3262 * the location identifying the dataset.
3263 * k:
3264 * the string to identify the data element.
3265 * d:
3266 * the data element.
3267 * f:
3268 * the function to call when the data element is removed. This
3269 * function will be called with the data element and can be used to free any
3270 * memory allocated for it.
3272 // TODO
3273 // #define g_dataset_set_data_full(l, k, d, f)
3276 * Gets the data element corresponding to a string.
3277 * l:
3278 * the location identifying the dataset.
3279 * k:
3280 * the string identifying the data element.
3281 * Returns:
3282 * the data element corresponding to the string, or NULL if it is not
3283 * found.
3285 // TODO
3286 // #define g_dataset_get_data(l, k)
3289 * Removes a data element corresponding to a string.
3290 * Its destroy function is called if it has been set.
3291 * l:
3292 * the location identifying the dataset.
3293 * k:
3294 * the string identifying the data element.
3296 // TODO
3297 // #define g_dataset_remove_data(l, k)
3300 * Removes an element, without calling its destroy notifier.
3301 * l:
3302 * the location identifying the dataset.
3303 * k:
3304 * the string identifying the data element.
3306 // TODO
3307 // #define g_dataset_remove_no_notify(l, k)
3310 * Specifies the type of function passed to g_main_context_set_poll_func().
3311 * The semantics of the function should match those of the
3312 * poll() system call.
3313 * ufds:
3314 * an array of GPollFD elements.
3315 * nfsd:
3316 * the number of elements in ufds.
3317 * timeout_:
3318 * the maximum time to wait for an event of the file descriptors.
3319 * A negative value indicates an infinite timeout.
3320 * Returns:
3321 * the number of GPollFD elements which have events or errors reported,
3322 * or -1 if an error occurred.
3324 // gint (*GPollFunc) (GPollFD *ufds, guint nfsd, gint timeout_);
3325 public typedef extern(C) int function (GPollFD*, uint, int) GPollFunc;
3328 * The type of functions to be called when a child exists.
3329 * pid:
3330 * the process id of the child process
3331 * status:
3332 * Status information about the child process,
3333 * see waitpid(2) for more information about this field
3334 * data:
3335 * user data passed to g_child_watch_add()
3337 // void (*GChildWatchFunc) (GPid pid, gint status, gpointer data);
3338 public typedef extern(C) void function (GPid, int, void*) GChildWatchFunc;
3341 * This is just a placeholder for GClosureMarshal, which cannot be used here
3342 * for dependency reasons.
3344 // void (*GSourceDummyMarshal) (void);
3345 public typedef extern(C) void function () GSourceDummyMarshal;
3348 * Specifies the type of function passed to g_timeout_add(), g_timeout_add_full(),
3349 * g_idle_add(), and g_idle_add_full().
3350 * data:
3351 * data passed to the function, set when the source was created with one
3352 * of the above functions.
3353 * Returns:
3354 * it should return FALSE if the source should be removed.
3356 // gboolean (*GSourceFunc) (gpointer data);
3357 public typedef extern(C) int function (void*) GSourceFunc;
3360 * Specifies the type of the module initialization function.
3361 * If a module contains a function named g_module_check_init() it is called
3362 * automatically when the module is loaded. It is passed the GModule structure
3363 * and should return NULL on success or a string describing the initialization
3364 * error.
3365 * module:
3366 * the GModule corresponding to the module which has just been loaded.
3367 * Returns:
3368 * NULL on success, or a string describing the initialization error.
3370 // const gchar* (*GModuleCheckInit) (GModule *module);
3371 public typedef extern(C) char* function (GModule*) GModuleCheckInit;
3374 * Specifies the type of the module function called when it is unloaded.
3375 * If a module contains a function named g_module_unload() it is called
3376 * automatically when the module is unloaded.
3377 * It is passed the GModule structure.
3378 * module:
3379 * the GModule about to be unloaded.
3381 // void (*GModuleUnload) (GModule *module);
3382 public typedef extern(C) void function (GModule*) GModuleUnload;
3385 * Specifies the type of function passed to g_io_add_watch() or
3386 * g_io_add_watch_full(), which is called when the requested condition on a
3387 * GIOChannel is satisfied.
3388 * source:
3389 * the GIOChannel event source.
3390 * condition:
3391 * the condition which has been satisfied.
3392 * data:
3393 * user data set in g_io_add_watch() or g_io_add_watch_full().
3394 * Returns:
3395 * the function should return FALSE if the event source should be
3396 * removed.
3398 // gboolean (*GIOFunc) (GIOChannel *source, GIOCondition condition, gpointer data);
3399 public typedef extern(C) int function (GIOChannel*, GIOCondition, void*) GIOFunc;
3402 * Specifies the type of the print handler functions.
3403 * These are called with the complete formatted string to output.
3404 * string:
3405 * the message to be output.
3407 // void (*GPrintFunc) (const gchar *string);
3408 public typedef extern(C) void function (char[]) GPrintFunc;
3411 * Specifies the prototype of log handler functions.
3412 * log_domain:
3413 * the log domain of the message.
3414 * log_level:
3415 * the log level of the message (including the fatal and recursion
3416 * flags).
3417 * message:
3418 * the message to process.
3419 * user_data:
3420 * user data, set in g_log_set_handler().
3422 // void (*GLogFunc) (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data);
3423 public typedef extern(C) void function (char[], GLogLevelFlags, char[], void*) GLogFunc;
3426 * Declares a type of function which takes no arguments and has no return value.
3427 * It is used to specify the type function passed to g_atexit().
3429 // void (*GVoidFunc) (void);
3430 public typedef extern(C) void function () GVoidFunc;
3433 * Declares a type of function which takes an arbitrary data pointer argument
3434 * and has no return value. It is not currently used in GLib or GTK+.
3435 * data:
3436 * a data pointer.
3438 // void (*GFreeFunc) (gpointer data);
3439 public typedef extern(C) void function (void*) GFreeFunc;
3442 * Specifies the type of the message handler function.
3443 * scanner:
3444 * a GScanner.
3445 * message:
3446 * the message.
3447 * error:
3448 * TRUE if the message signals an error, FALSE if it
3449 * signals a warning.
3451 // void (*GScannerMsgFunc) (GScanner *scanner, gchar *message, gboolean error);
3452 public typedef extern(C) void function (GScanner*, char[], int) GScannerMsgFunc;
3455 * Specifies the type of the function passed to g_completion_new().
3456 * It should return the string corresponding to the given target item.
3457 * This is used when you use data structures as GCompletion items.
3458 * Param1:
3459 * the completion item.
3460 * Returns:
3461 * the string corresponding to the item.
3463 // gchar* (*GCompletionFunc) (gpointer );
3464 public typedef extern(C) char* function (void*) GCompletionFunc;
3467 * Specifies the type of the function passed to g_completion_set_compare().
3468 * This is used when you use strings as GCompletion items.
3469 * s1:
3470 * string to compare with s2.
3471 * s2:
3472 * string to compare with s1.
3473 * n:
3474 * maximal number of bytes to compare.
3475 * Returns:
3476 * an integer less than, equal to, or greater than zero if the
3477 * first n bytes of s1 is found, respectively, to be less than, to match,
3478 * or to be greater than the first n bytes of s2.
3480 // gint (*GCompletionStrncmpFunc) (const gchar *s1, const gchar *s2, gsize n);
3481 public typedef extern(C) int function (char[], char[], uint) GCompletionStrncmpFunc;
3484 * Specifies the type of the setup function passed to g_spawn_async(),
3485 * g_spawn_sync() and g_spawn_async_with_pipes(). On POSIX platforms it
3486 * is called in the child after GLib has performed all the setup it plans
3487 * to perform but before calling exec(). On POSIX
3488 * actions taken in this function will thus only affect the child, not
3489 * the parent.
3490 * On Windows the function is called in the parent. Its usefulness on
3491 * Windows is thus questionable. In many cases executing the child setup
3492 * function in the parent can have ill effects, and you should be very
3493 * careful when porting software to Windows that uses child setup
3494 * functions.
3495 * user_data:
3496 * user data to pass to the function.
3498 // void (*GSpawnChildSetupFunc) (gpointer user_data);
3499 public typedef extern(C) void function (void*) GSpawnChildSetupFunc;
3502 * The type of function to be passed as callback for G_OPTION_ARG_CALLBACK
3503 * options.
3504 * option_name:
3505 * The name of the option being parsed. This will be either a
3506 * single dash followed by a single letter (for a short name) or two dashes
3507 * followed by a long option name.
3508 * value:
3509 * The value to be parsed.
3510 * data:
3511 * User data added to the GOptionGroup containing the option when it
3512 * was created with g_option_group_new()
3513 * error:
3514 * A return location for errors. The error code G_OPTION_ERROR_FAILED
3515 * is intended to be used for errors in GOptionArgFunc callbacks.
3516 * Returns:
3517 * TRUE if the option was successfully parsed, FALSE if an error
3518 * occurred, in which case error should be set with g_set_error()
3520 // gboolean (*GOptionArgFunc) (const gchar *option_name, const gchar *value, gpointer data, GError **error);
3521 public typedef extern(C) int function (char[], char[], void*, GError**) GOptionArgFunc;
3524 * The type of functions which are used to translate user-visible
3525 * strings, for --help output.
3526 * str:
3527 * the untranslated string
3528 * data:
3529 * user data specified when installing the function, e.g.
3530 * in g_option_group_set_translate_func()
3531 * Returns:
3532 * a translation of the string for the current locale.
3533 * The returned string is owned by GLib and must not be freed.
3535 // const gchar* (*GTranslateFunc) (const gchar *str, gpointer data);
3536 public typedef extern(C) char* function (char[], void*) GTranslateFunc;
3539 * The type of function that can be called before and after parsing.
3540 * context:
3541 * The active GOptionContext
3542 * group:
3543 * The group to which the function belongs
3544 * data:
3545 * User data added to the GOptionGroup containing the option when it
3546 * was created with g_option_group_new()
3547 * error:
3548 * A return location for error details
3549 * Returns:
3550 * TRUE if the function completed successfully, FALSE if an error
3551 * occurred, in which case error should be set with g_set_error()
3553 // gboolean (*GOptionParseFunc) (GOptionContext *context, GOptionGroup *group, gpointer data, GError **error);
3554 public typedef extern(C) int function (GOptionContext*, GOptionGroup*, void*, GError**) GOptionParseFunc;
3557 * The type of function to be used as callback when a parse error occurs.
3558 * context:
3559 * The active GOptionContext
3560 * group:
3561 * The group to which the function belongs
3562 * data:
3563 * User data added to the GOptionGroup containing the option when it
3564 * was created with g_option_group_new()
3565 * error:
3566 * The GError containing details about the parse error
3568 // void (*GOptionErrorFunc) (GOptionContext *context, GOptionGroup *group, gpointer data, GError **error);
3569 public typedef extern(C) void function (GOptionContext*, GOptionGroup*, void*, GError**) GOptionErrorFunc;
3572 * Specifies the type of a comparison function used to compare two
3573 * values. The function should return a negative integer if the first
3574 * value comes before the second, 0 if they are equal, or a positive
3575 * integer if the first value comes after the second.
3576 * a:
3577 * a value.
3578 * b:
3579 * a value to compare with.
3580 * Returns:
3581 * negative value if a < b; zero if a = b; positive value
3582 * if a > b.
3584 // gint (*GCompareFunc) (gconstpointer a, gconstpointer b);
3585 public typedef extern(C) int function (void*, void*) GCompareFunc;
3588 * Specifies the type of a comparison function used to compare two
3589 * values. The function should return a negative integer if the first
3590 * value comes before the second, 0 if they are equal, or a positive
3591 * integer if the first value comes after the second.
3592 * a:
3593 * a value.
3594 * b:
3595 * a value to compare with.
3596 * user_data:
3597 * user data to pass to comparison function.
3598 * Returns:
3599 * negative value if a < b; zero if a = b; positive value
3600 * if a > b.
3602 // gint (*GCompareDataFunc) (gconstpointer a, gconstpointer b, gpointer user_data);
3603 public typedef extern(C) int function (void*, void*, void*) GCompareDataFunc;
3606 * Specifies the type of functions passed to g_list_foreach() and
3607 * g_slist_foreach().
3608 * data:
3609 * the element's data.
3610 * user_data:
3611 * user data passed to g_list_foreach() or g_slist_foreach().
3613 // void (*GFunc) (gpointer data, gpointer user_data);
3614 public typedef extern(C) void function (void*, void*) GFunc;
3617 * Specifies the type of the hash function which is passed to
3618 * g_hash_table_new() when a GHashTable is created.
3619 * The function is passed a key and should return a guint hash value.
3620 * The functions g_direct_hash(), g_int_hash() and g_str_hash() provide
3621 * hash functions which can be used when the key is a gpointer, gint, and
3622 * gchar* respectively.
3623 * FIXME: Need more here.
3624 * The hash values should be evenly distributed over a fairly large range?
3625 * The modulus is taken with the hash table size (a prime number)
3626 * to find the 'bucket' to place each key into.
3627 * The function should also be very fast, since it is called for each key
3628 * lookup.
3629 * key:
3630 * a key.
3631 * Returns:
3632 * the hash value corresponding to the key.
3634 // guint (*GHashFunc) (gconstpointer key);
3635 public typedef extern(C) uint function (void*) GHashFunc;
3638 * Specifies the type of a function used to test two values for
3639 * equality. The function should return TRUE if both values are equal and
3640 * FALSE otherwise.
3641 * a:
3642 * a value.
3643 * b:
3644 * a value to compare with.
3645 * Returns:
3646 * TRUE if a = b; FALSE otherwise.
3648 // gboolean (*GEqualFunc) (gconstpointer a, gconstpointer b);
3649 public typedef extern(C) int function (void*, void*) GEqualFunc;
3652 * Specifies the type of the function passed to g_hash_table_foreach().
3653 * It is called with each key/value pair, together with the user_data parameter
3654 * which is passed to g_hash_table_foreach().
3655 * key:
3656 * a key.
3657 * value:
3658 * the value corresponding to the key.
3659 * user_data:
3660 * user data passed to g_hash_table_foreach().
3662 // void (*GHFunc) (gpointer key, gpointer value, gpointer user_data);
3663 public typedef extern(C) void function (void*, void*, void*) GHFunc;
3666 * Specifies the type of the function passed to g_hash_table_foreach_remove().
3667 * It is called with each key/value pair, together with the user_data parameter
3668 * passed to g_hash_table_foreach_remove().
3669 * It should return TRUE if the key/value pair should be removed from the
3670 * GHashTable.
3671 * key:
3672 * a key.
3673 * value:
3674 * the value associated with the key.
3675 * user_data:
3676 * user data passed to g_hash_table_remove().
3677 * Returns:
3678 * TRUE if the key/value pair should be removed from the GHashTable.
3680 // gboolean (*GHRFunc) (gpointer key, gpointer value, gpointer user_data);
3681 public typedef extern(C) int function (void*, void*, void*) GHRFunc;
3684 * Specifies the type of function passed to g_tree_traverse().
3685 * It is passed the key and value of each node, together with
3686 * the user_data parameter passed to g_tree_traverse().
3687 * If the function returns TRUE, the traversal is stopped.
3688 * key:
3689 * a key of a GTree node.
3690 * value:
3691 * the value corresponding to the key.
3692 * data:
3693 * user data passed to g_tree_traverse().
3694 * Returns:
3695 * TRUE to stop the traversal.
3697 // gboolean (*GTraverseFunc) (gpointer key, gpointer value, gpointer data);
3698 public typedef extern(C) int function (void*, void*, void*) GTraverseFunc;
3701 * A function of this signature is used to copy the node data when doing a deep-copy
3702 * of a tree.
3703 * src:
3704 * A pointer to the data which should be copied.
3705 * data:
3706 * Additional data.
3707 * Returns:
3708 * A pointer to the copy.
3709 * Since 2.4
3711 // gpointer (*GCopyFunc) (gconstpointer src, gpointer data);
3712 public typedef extern(C) void* function (void*, void*) GCopyFunc;
3715 * Specifies the type of function passed to g_node_traverse().
3716 * The function is called with each of the nodes visited, together with the
3717 * user data passed to g_node_traverse().
3718 * If the function returns TRUE, then the traversal is stopped.
3719 * node:
3720 * a GNode.
3721 * data:
3722 * user data passed to g_node_traverse().
3723 * Returns:
3724 * TRUE to stop the traversal.
3726 // gboolean (*GNodeTraverseFunc) (GNode *node, gpointer data);
3727 public typedef extern(C) int function (GNode*, void*) GNodeTraverseFunc;
3730 * Specifies the type of function passed to g_node_children_foreach().
3731 * The function is called with each child node, together with the user data
3732 * passed to g_node_children_foreach().
3733 * node:
3734 * a GNode.
3735 * data:
3736 * user data passed to g_node_children_foreach().
3738 // void (*GNodeForeachFunc) (GNode *node, gpointer data);
3739 public typedef extern(C) void function (GNode*, void*) GNodeForeachFunc;
3742 * Specifies the type of function which is called when a data element is
3743 * destroyed. It is passed the pointer to the data element and should free
3744 * any memory and resources allocated for it.
3745 * data:
3746 * the data element.
3748 // void (*GDestroyNotify) (gpointer data);
3749 public typedef extern(C) void function (void*) GDestroyNotify;
3752 * Specifies the type of function passed to g_dataset_foreach().
3753 * It is called with each GQuark id and associated data element,
3754 * together with the user_data parameter supplied to g_dataset_foreach().
3755 * key_id:
3756 * the GQuark id to identifying the data element.
3757 * data:
3758 * the data element.
3759 * user_data:
3760 * user data passed to g_dataset_foreach().
3762 // void (*GDataForeachFunc) (GQuark key_id, gpointer data, gpointer user_data);
3763 public typedef extern(C) void function (GQuark, void*, void*) GDataForeachFunc;
3766 * Specifies the type of the value_destroy_func and key_destroy_func functions
3767 * passed to g_cache_new().
3768 * The functions are passed a pointer to the GCache key or GCache value and
3769 * should free any memory and other resources associated with it.
3770 * value:
3771 * the GCache value to destroy.
3773 // void (*GCacheDestroyFunc) (gpointer value);
3774 public typedef extern(C) void function (void*) GCacheDestroyFunc;
3777 * Specifies the type of the key_dup_func function passed to g_cache_new().
3778 * The function is passed a key (not a value as the prototype implies) and
3779 * should return a duplicate of the key.
3780 * value:
3781 * the GCache key to destroy (not a GCache value as it seems).
3782 * Returns:
3783 * a copy of the GCache key.
3785 // gpointer (*GCacheDupFunc) (gpointer value);
3786 public typedef extern(C) void* function (void*) GCacheDupFunc;
3789 * Specifies the type of the value_new_func function passed to g_cache_new().
3790 * It is passed a GCache key and should create the value corresponding to the
3791 * key.
3792 * key:
3793 * a GCache key.
3794 * Returns:
3795 * a new GCache value corresponding to the key.
3797 // gpointer (*GCacheNewFunc) (gpointer key);
3798 public typedef extern(C) void* function (void*) GCacheNewFunc;
3800 * A union holding the value of the token.
3802 public struct GTokenValue
3804 union
3806 void* vSymbol;
3807 char *vIdentifier;
3808 uint vBinary;
3809 uint vOctal;
3810 uint vInt;
3811 ulong vInt64;
3812 double vFloat;
3813 uint vHex;
3814 char *vString;
3815 char *vComment;
3816 char vChar;
3817 uint vError;