2 * Copyright © 2011 Red Hat, Inc
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the licence, or (at your option) any later version.
9 * This library 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 GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
19 * Author: Matthias Clasen
23 /* This file collects documentation for macros, typedefs and
24 * the like, which have no good home in any of the 'real' source
28 /* Basic types {{{1 */
33 * @short_description: standard GLib types, defined for ease-of-use
36 * GLib defines a number of commonly used types, which can be divided
38 * - New types which are not part of standard C (but are defined in
39 * various C standard library header files) - #gboolean, #gsize,
40 * #gssize, #goffset, #gintptr, #guintptr.
41 * - Integer types which are guaranteed to be the same size across
42 * all platforms - #gint8, #guint8, #gint16, #guint16, #gint32,
43 * #guint32, #gint64, #guint64.
44 * - Types which are easier to use than their standard C counterparts -
45 * #gpointer, #gconstpointer, #guchar, #guint, #gushort, #gulong.
46 * - Types which correspond exactly to standard C types, but are
47 * included for completeness - #gchar, #gint, #gshort, #glong,
50 * GLib also defines macros for the limits of some of the standard
51 * integer and floating point types, as well as macros for suitable
52 * printf() formats for these types.
58 * A standard boolean type.
59 * Variables of this type should only contain the value
67 * #gpointer looks better and is easier to use
68 * than <type>void*</type>.
74 * An untyped pointer to constant data.
75 * The data pointed to should not be changed.
77 * This is typically used in function prototypes to indicate
78 * that the data pointed to will not be altered by the function.
84 * Corresponds to the standard C <type>char</type> type.
90 * Corresponds to the standard C <type>unsigned char</type> type.
96 * Corresponds to the standard C <type>int</type> type.
97 * Values of this type can range from #G_MININT to #G_MAXINT.
103 * The minimum value which can be held in a #gint.
109 * The maximum value which can be held in a #gint.
115 * Corresponds to the standard C <type>unsigned int</type> type.
116 * Values of this type can range from 0 to #G_MAXUINT.
122 * The maximum value which can be held in a #guint.
128 * Corresponds to the standard C <type>short</type> type.
129 * Values of this type can range from #G_MINSHORT to #G_MAXSHORT.
135 * The minimum value which can be held in a #gshort.
141 * The maximum value which can be held in a #gshort.
147 * Corresponds to the standard C <type>unsigned short</type> type.
148 * Values of this type can range from 0 to #G_MAXUSHORT.
154 * The maximum value which can be held in a #gushort.
160 * Corresponds to the standard C <type>long</type> type.
161 * Values of this type can range from #G_MINLONG to #G_MAXLONG.
167 * The minimum value which can be held in a #glong.
173 * The maximum value which can be held in a #glong.
179 * Corresponds to the standard C <type>unsigned long</type> type.
180 * Values of this type can range from 0 to #G_MAXULONG.
186 * The maximum value which can be held in a #gulong.
192 * A signed integer guaranteed to be 8 bits on all platforms.
193 * Values of this type can range from #G_MININT8 (= -128) to
194 * #G_MAXINT8 (= 127).
200 * The minimum value which can be held in a #gint8.
208 * The maximum value which can be held in a #gint8.
216 * An unsigned integer guaranteed to be 8 bits on all platforms.
217 * Values of this type can range from 0 to #G_MAXUINT8 (= 255).
223 * The maximum value which can be held in a #guint8.
231 * A signed integer guaranteed to be 16 bits on all platforms.
232 * Values of this type can range from #G_MININT16 (= -32,768) to
233 * #G_MAXINT16 (= 32,767).
235 * To print or scan values of this type, use
236 * %G_GINT16_MODIFIER and/or %G_GINT16_FORMAT.
242 * The minimum value which can be held in a #gint16.
250 * The maximum value which can be held in a #gint16.
258 * The platform dependent length modifier for conversion specifiers
259 * for scanning and printing values of type #gint16 or #guint16. It
260 * is a string literal, but doesn't include the percent-sign, such
261 * that you can add precision and length modifiers between percent-sign
262 * and conversion specifier and append a conversion specifier.
264 * The following example prints "0x7b";
266 * gint16 value = 123;
267 * g_print ("%#" G_GINT16_MODIFIER "x", value);
276 * This is the platform dependent conversion specifier for scanning and
277 * printing values of type #gint16. It is a string literal, but doesn't
278 * include the percent-sign, such that you can add precision and length
279 * modifiers between percent-sign and conversion specifier.
284 * sscanf ("42", "%" G_GINT16_FORMAT, &in)
286 * g_print ("%" G_GINT32_FORMAT, out);
293 * An unsigned integer guaranteed to be 16 bits on all platforms.
294 * Values of this type can range from 0 to #G_MAXUINT16 (= 65,535).
296 * To print or scan values of this type, use
297 * %G_GINT16_MODIFIER and/or %G_GUINT16_FORMAT.
303 * The maximum value which can be held in a #guint16.
311 * This is the platform dependent conversion specifier for scanning
312 * and printing values of type #guint16. See also #G_GINT16_FORMAT
318 * A signed integer guaranteed to be 32 bits on all platforms.
319 * Values of this type can range from #G_MININT32 (= -2,147,483,648)
320 * to #G_MAXINT32 (= 2,147,483,647).
322 * To print or scan values of this type, use
323 * %G_GINT32_MODIFIER and/or %G_GINT32_FORMAT.
329 * The minimum value which can be held in a #gint32.
337 * The maximum value which can be held in a #gint32.
345 * The platform dependent length modifier for conversion specifiers
346 * for scanning and printing values of type #gint32 or #guint32. It
347 * is a string literal. See also #G_GINT16_MODIFIER.
355 * This is the platform dependent conversion specifier for scanning
356 * and printing values of type #gint32. See also #G_GINT16_FORMAT.
362 * An unsigned integer guaranteed to be 32 bits on all platforms.
363 * Values of this type can range from 0 to #G_MAXUINT32 (= 4,294,967,295).
365 * To print or scan values of this type, use
366 * %G_GINT32_MODIFIER and/or %G_GUINT32_FORMAT.
372 * The maximum value which can be held in a #guint32.
380 * This is the platform dependent conversion specifier for scanning
381 * and printing values of type #guint32. See also #G_GINT16_FORMAT.
387 * A signed integer guaranteed to be 64 bits on all platforms.
388 * Values of this type can range from #G_MININT64
389 * (= -9,223,372,036,854,775,808) to #G_MAXINT64
390 * (= 9,223,372,036,854,775,807).
392 * To print or scan values of this type, use
393 * %G_GINT64_MODIFIER and/or %G_GINT64_FORMAT.
399 * The minimum value which can be held in a #gint64.
405 * The maximum value which can be held in a #gint64.
411 * The platform dependent length modifier for conversion specifiers
412 * for scanning and printing values of type #gint64 or #guint64.
413 * It is a string literal.
416 * Some platforms do not support printing 64 bit integers, even
417 * though the types are supported. On such platforms #G_GINT64_MODIFIER
427 * This is the platform dependent conversion specifier for scanning
428 * and printing values of type #gint64. See also #G_GINT16_FORMAT.
431 * Some platforms do not support scanning and printing 64 bit integers,
432 * even though the types are supported. On such platforms #G_GINT64_FORMAT
433 * is not defined. Note that scanf() may not support 64 bit integers, even
434 * if #G_GINT64_FORMAT is defined. Due to its weak error handling, scanf()
435 * is not recommended for parsing anyway; consider using g_ascii_strtoull()
443 * An unsigned integer guaranteed to be 64 bits on all platforms.
444 * Values of this type can range from 0 to #G_MAXUINT64
445 * (= 18,446,744,073,709,551,615).
447 * To print or scan values of this type, use
448 * %G_GINT64_MODIFIER and/or %G_GUINT64_FORMAT.
454 * The maximum value which can be held in a #guint64.
460 * This is the platform dependent conversion specifier for scanning
461 * and printing values of type #guint64. See also #G_GINT16_FORMAT.
464 * Some platforms do not support scanning and printing 64 bit integers,
465 * even though the types are supported. On such platforms #G_GUINT64_FORMAT
466 * is not defined. Note that scanf() may not support 64 bit integers, even
467 * if #G_GINT64_FORMAT is defined. Due to its weak error handling, scanf()
468 * is not recommended for parsing anyway; consider using g_ascii_strtoull()
475 * @val: a literal integer value, e.g. 0x1d636b02300a7aa7
477 * This macro is used to insert 64-bit integer literals
478 * into the source code.
482 * G_GUINT64_CONSTANT:
483 * @val: a literal integer value, e.g. 0x1d636b02300a7aa7U
485 * This macro is used to insert 64-bit unsigned integer
486 * literals into the source code.
494 * Corresponds to the standard C <type>float</type> type.
495 * Values of this type can range from -#G_MAXFLOAT to #G_MAXFLOAT.
501 * The minimum positive value which can be held in a #gfloat.
503 * If you are interested in the smallest value which can be held
504 * in a #gfloat, use -G_MAXFLOAT.
510 * The maximum value which can be held in a #gfloat.
516 * Corresponds to the standard C <type>double</type> type.
517 * Values of this type can range from -#G_MAXDOUBLE to #G_MAXDOUBLE.
523 * The minimum positive value which can be held in a #gdouble.
525 * If you are interested in the smallest value which can be held
526 * in a #gdouble, use -G_MAXDOUBLE.
532 * The maximum value which can be held in a #gdouble.
538 * An unsigned integer type of the result of the sizeof operator,
539 * corresponding to the <type>size_t</type> type defined in C99.
540 * This type is wide enough to hold the numeric value of a pointer,
541 * so it is usually 32bit wide on a 32bit platform and 64bit wide
542 * on a 64bit platform. Values of this type can range from 0 to
545 * To print or scan values of this type, use
546 * %G_GSIZE_MODIFIER and/or %G_GSIZE_FORMAT.
552 * The maximum value which can be held in a #gsize.
560 * The platform dependent length modifier for conversion specifiers
561 * for scanning and printing values of type #gsize or #gssize. It
562 * is a string literal.
570 * This is the platform dependent conversion specifier for scanning
571 * and printing values of type #gsize. See also #G_GINT16_FORMAT.
579 * A signed variant of #gsize, corresponding to the
580 * <type>ssize_t</type> defined on most platforms.
581 * Values of this type can range from #G_MINSSIZE
584 * To print or scan values of this type, use
585 * %G_GSIZE_MODIFIER and/or %G_GSSIZE_FORMAT.
591 * The minimum value which can be held in a #gssize.
599 * The maximum value which can be held in a #gssize.
607 * This is the platform dependent conversion specifier for scanning
608 * and printing values of type #gssize. See also #G_GINT16_FORMAT.
616 * A signed integer type that is used for file offsets,
617 * corresponding to the C99 type <type>off64_t</type>.
618 * Values of this type can range from #G_MINOFFSET to
621 * To print or scan values of this type, use
622 * %G_GOFFSET_MODIFIER and/or %G_GOFFSET_FORMAT.
630 * The minimum value which can be held in a #goffset.
636 * The maximum value which can be held in a #goffset.
640 * G_GOFFSET_MODIFIER:
642 * The platform dependent length modifier for conversion specifiers
643 * for scanning and printing values of type #goffset. It is a string
644 * literal. See also #G_GINT64_MODIFIER.
652 * This is the platform dependent conversion specifier for scanning
653 * and printing values of type #goffset. See also #G_GINT64_FORMAT.
659 * G_GOFFSET_CONSTANT:
660 * @val: a literal integer value, e.g. 0x1d636b02300a7aa7
662 * This macro is used to insert #goffset 64-bit integer literals
663 * into the source code.
665 * See also #G_GINT64_CONSTANT.
673 * Corresponds to the C99 type <type>intptr_t</type>,
674 * a signed integer type that can hold any pointer.
676 * To print or scan values of this type, use
677 * %G_GINTPTR_MODIFIER and/or %G_GINTPTR_FORMAT.
683 * G_GINTPTR_MODIFIER:
685 * The platform dependent length modifier for conversion specifiers
686 * for scanning and printing values of type #gintptr or #guintptr.
687 * It is a string literal.
695 * This is the platform dependent conversion specifier for scanning
696 * and printing values of type #gintptr.
704 * Corresponds to the C99 type <type>uintptr_t</type>,
705 * an unsigned integer type that can hold any pointer.
707 * To print or scan values of this type, use
708 * %G_GINTPTR_MODIFIER and/or %G_GUINTPTR_FORMAT.
716 * This is the platform dependent conversion specifier
717 * for scanning and printing values of type #guintptr.
722 /* Type conversion {{{1 */
725 * SECTION:type_conversion
726 * @title: Type Conversion Macros
727 * @short_description: portably storing integers in pointer variables
729 * Many times GLib, GTK+, and other libraries allow you to pass "user
730 * data" to a callback, in the form of a void pointer. From time to time
731 * you want to pass an integer instead of a pointer. You could allocate
732 * an integer, with something like:
734 * int *ip = g_new (int, 1);
737 * But this is inconvenient, and it's annoying to have to free the
738 * memory at some later time.
740 * Pointers are always at least 32 bits in size (on all platforms GLib
741 * intends to support). Thus you can store at least 32-bit integer values
742 * in a pointer value. Naively, you might try this, but it's incorrect:
749 * Again, that example was <emphasis>not</emphasis> correct, don't copy it.
750 * The problem is that on some systems you need to do this:
754 * p = (void*) (long) 42;
755 * i = (int) (long) p;
757 * The GLib macros GPOINTER_TO_INT(), GINT_TO_POINTER(), etc. take care
758 * to do the right thing on the every platform.
760 * <warning><para>You may not store pointers in integers. This is not
761 * portable in any way, shape or form. These macros <emphasis>only</emphasis>
762 * allow storing integers in pointers, and only preserve 32 bits of the
763 * integer; values outside the range of a 32-bit integer will be mangled.
769 * @i: integer to stuff into a pointer
771 * Stuffs an integer into a pointer type.
773 * Remember, you may not store pointers in integers. This is not portable
774 * in any way, shape or form. These macros <emphasis>only</emphasis> allow
775 * storing integers in pointers, and only preserve 32 bits of the
776 * integer; values outside the range of a 32-bit integer will be mangled.
781 * @p: pointer containing an integer
783 * Extracts an integer from a pointer. The integer must have
784 * been stored in the pointer with GINT_TO_POINTER().
786 * Remember, you may not store pointers in integers. This is not portable
787 * in any way, shape or form. These macros <emphasis>only</emphasis> allow
788 * storing integers in pointers, and only preserve 32 bits of the
789 * integer; values outside the range of a 32-bit integer will be mangled.
794 * @u: unsigned integer to stuff into the pointer
796 * Stuffs an unsigned integer into a pointer type.
801 * @p: pointer to extract an unsigned integer from
803 * Extracts an unsigned integer from a pointer. The integer must have
804 * been stored in the pointer with GUINT_TO_POINTER().
809 * @s: #gsize to stuff into the pointer
811 * Stuffs a #gsize into a pointer type.
816 * @p: pointer to extract a #gsize from
818 * Extracts a #gsize from a pointer. The #gsize must have
819 * been stored in the pointer with GSIZE_TO_POINTER().
822 /* Byte order {{{1 */
826 * @title: Byte Order Macros
827 * @short_description: a portable way to convert between different byte orders
829 * These macros provide a portable way to determine the host byte order
830 * and to convert values between different byte orders.
832 * The byte order is the order in which bytes are stored to create larger
833 * data types such as the #gint and #glong values.
834 * The host byte order is the byte order used on the current machine.
836 * Some processors store the most significant bytes (i.e. the bytes that
837 * hold the largest part of the value) first. These are known as big-endian
838 * processors. Other processors (notably the x86 family) store the most
839 * significant byte last. These are known as little-endian processors.
841 * Finally, to complicate matters, some other processors store the bytes in
842 * a rather curious order known as PDP-endian. For a 4-byte word, the 3rd
843 * most significant byte is stored first, then the 4th, then the 1st and
846 * Obviously there is a problem when these different processors communicate
847 * with each other, for example over networks or by using binary file formats.
848 * This is where these macros come in. They are typically used to convert
849 * values into a byte order which has been agreed on for use when
850 * communicating between different processors. The Internet uses what is
851 * known as 'network byte order' as the standard byte order (which is in
852 * fact the big-endian byte order).
854 * Note that the byte order conversion macros may evaluate their arguments
855 * multiple times, thus you should not use them with arguments which have
862 * The host byte order.
863 * This can be either #G_LITTLE_ENDIAN or #G_BIG_ENDIAN (support for
864 * #G_PDP_ENDIAN may be added in future.)
870 * Specifies one of the possible types of byte order.
877 * Specifies one of the possible types of byte order.
884 * Specifies one of the possible types of byte order
885 * (currently unused). See #G_BYTE_ORDER.
890 * @val: a 32-bit integer value in host byte order
892 * Converts a 32-bit integer value from host to network byte order.
894 * Returns: @val converted to network byte order
899 * @val: a 16-bit integer value in host byte order
901 * Converts a 16-bit integer value from host to network byte order.
903 * Returns: @val converted to network byte order
908 * @val: a 32-bit integer value in network byte order
910 * Converts a 32-bit integer value from network to host byte order.
912 * Returns: @val converted to host byte order.
917 * @val: a 16-bit integer value in network byte order
919 * Converts a 16-bit integer value from network to host byte order.
921 * Returns: @val converted to host byte order
926 * @val: a #gint value in big-endian byte order
928 * Converts a #gint value from big-endian to host byte order.
930 * Returns: @val converted to host byte order
935 * @val: a #gint value in little-endian byte order
937 * Converts a #gint value from little-endian to host byte order.
939 * Returns: @val converted to host byte order
944 * @val: a #gint value in host byte order
946 * Converts a #gint value from host byte order to big-endian.
948 * Returns: @val converted to big-endian byte order
953 * @val: a #gint value in host byte order
955 * Converts a #gint value from host byte order to little-endian.
957 * Returns: @val converted to little-endian byte order
962 * @val: a #guint value in big-endian byte order
964 * Converts a #guint value from big-endian to host byte order.
966 * Returns: @val converted to host byte order
971 * @val: a #guint value in little-endian byte order
973 * Converts a #guint value from little-endian to host byte order.
975 * Returns: @val converted to host byte order
980 * @val: a #guint value in host byte order
982 * Converts a #guint value from host byte order to big-endian.
984 * Returns: @val converted to big-endian byte order
989 * @val: a #guint value in host byte order
991 * Converts a #guint value from host byte order to little-endian.
993 * Returns: @val converted to little-endian byte order.
998 * @val: a #glong value in big-endian byte order
1000 * Converts a #glong value from big-endian to the host byte order.
1002 * Returns: @val converted to host byte order
1007 * @val: a #glong value in little-endian byte order
1009 * Converts a #glong value from little-endian to host byte order.
1011 * Returns: @val converted to host byte order
1016 * @val: a #glong value in host byte order
1018 * Converts a #glong value from host byte order to big-endian.
1020 * Returns: @val converted to big-endian byte order
1025 * @val: a #glong value in host byte order
1027 * Converts a #glong value from host byte order to little-endian.
1029 * Returns: @val converted to little-endian
1034 * @val: a #gulong value in big-endian byte order
1036 * Converts a #gulong value from big-endian to host byte order.
1038 * Returns: @val converted to host byte order
1043 * @val: a #gulong value in little-endian byte order
1045 * Converts a #gulong value from little-endian to host byte order.
1047 * Returns: @val converted to host byte order
1052 * @val: a #gulong value in host byte order
1054 * Converts a #gulong value from host byte order to big-endian.
1056 * Returns: @val converted to big-endian
1061 * @val: a #gulong value in host byte order
1063 * Converts a #gulong value from host byte order to little-endian.
1065 * Returns: @val converted to little-endian
1070 * @val: a #gsize value in big-endian byte order
1072 * Converts a #gsize value from big-endian to the host byte order.
1074 * Returns: @val converted to host byte order
1079 * @val: a #gsize value in little-endian byte order
1081 * Converts a #gsize value from little-endian to host byte order.
1083 * Returns: @val converted to host byte order
1088 * @val: a #gsize value in host byte order
1090 * Converts a #gsize value from host byte order to big-endian.
1092 * Returns: @val converted to big-endian byte order
1097 * @val: a #gsize value in host byte order
1099 * Converts a #gsize value from host byte order to little-endian.
1101 * Returns: @val converted to little-endian
1106 * @val: a #gssize value in big-endian byte order
1108 * Converts a #gssize value from big-endian to host byte order.
1110 * Returns: @val converted to host byte order
1115 * @val: a #gssize value in little-endian byte order
1117 * Converts a #gssize value from little-endian to host byte order.
1119 * Returns: @val converted to host byte order
1124 * @val: a #gssize value in host byte order
1126 * Converts a #gssize value from host byte order to big-endian.
1128 * Returns: @val converted to big-endian
1133 * @val: a #gssize value in host byte order
1135 * Converts a #gssize value from host byte order to little-endian.
1137 * Returns: @val converted to little-endian
1142 * @val: a #gint16 value in big-endian byte order
1144 * Converts a #gint16 value from big-endian to host byte order.
1146 * Returns: @val converted to host byte order
1151 * @val: a #gint16 value in little-endian byte order
1153 * Converts a #gint16 value from little-endian to host byte order.
1155 * Returns: @val converted to host byte order
1160 * @val: a #gint16 value in host byte order
1162 * Converts a #gint16 value from host byte order to big-endian.
1164 * Returns: @val converted to big-endian
1169 * @val: a #gint16 value in host byte order
1171 * Converts a #gint16 value from host byte order to little-endian.
1173 * Returns: @val converted to little-endian
1178 * @val: a #guint16 value in big-endian byte order
1180 * Converts a #guint16 value from big-endian to host byte order.
1182 * Returns: @val converted to host byte order
1187 * @val: a #guint16 value in little-endian byte order
1189 * Converts a #guint16 value from little-endian to host byte order.
1191 * Returns: @val converted to host byte order
1196 * @val: a #guint16 value in host byte order
1198 * Converts a #guint16 value from host byte order to big-endian.
1200 * Returns: @val converted to big-endian
1205 * @val: a #guint16 value in host byte order
1207 * Converts a #guint16 value from host byte order to little-endian.
1209 * Returns: @val converted to little-endian
1214 * @val: a #gint32 value in big-endian byte order
1216 * Converts a #gint32 value from big-endian to host byte order.
1218 * Returns: @val converted to host byte order
1223 * @val: a #gint32 value in little-endian byte order
1225 * Converts a #gint32 value from little-endian to host byte order.
1227 * Returns: @val converted to host byte order
1232 * @val: a #gint32 value in host byte order
1234 * Converts a #gint32 value from host byte order to big-endian.
1236 * Returns: @val converted to big-endian
1241 * @val: a #gint32 value in host byte order
1243 * Converts a #gint32 value from host byte order to little-endian.
1245 * Returns: @val converted to little-endian
1250 * @val: a #guint32 value in big-endian byte order
1252 * Converts a #guint32 value from big-endian to host byte order.
1254 * Returns: @val converted to host byte order
1259 * @val: a #guint32 value in little-endian byte order
1261 * Converts a #guint32 value from little-endian to host byte order.
1263 * Returns: @val converted to host byte order
1268 * @val: a #guint32 value in host byte order
1270 * Converts a #guint32 value from host byte order to big-endian.
1272 * Returns: @val converted to big-endian
1277 * @val: a #guint32 value in host byte order
1279 * Converts a #guint32 value from host byte order to little-endian.
1281 * Returns: @val converted to little-endian
1286 * @val: a #gint64 value in big-endian byte order
1288 * Converts a #gint64 value from big-endian to host byte order.
1290 * Returns: @val converted to host byte order
1295 * @val: a #gint64 value in little-endian byte order
1297 * Converts a #gint64 value from little-endian to host byte order.
1299 * Returns: @val converted to host byte order
1304 * @val: a #gint64 value in host byte order
1306 * Converts a #gint64 value from host byte order to big-endian.
1308 * Returns: @val converted to big-endian
1313 * @val: a #gint64 value in host byte order
1315 * Converts a #gint64 value from host byte order to little-endian.
1317 * Returns: @val converted to little-endian
1322 * @val: a #guint64 value in big-endian byte order
1324 * Converts a #guint64 value from big-endian to host byte order.
1326 * Returns: @val converted to host byte order
1331 * @val: a #guint64 value in little-endian byte order
1333 * Converts a #guint64 value from little-endian to host byte order.
1335 * Returns: @val converted to host byte order
1340 * @val: a #guint64 value in host byte order
1342 * Converts a #guint64 value from host byte order to big-endian.
1344 * Returns: @val converted to big-endian
1349 * @val: a #guint64 value in host byte order
1351 * Converts a #guint64 value from host byte order to little-endian.
1353 * Returns: @val converted to little-endian
1357 * GUINT16_SWAP_BE_PDP:
1358 * @val: a #guint16 value in big-endian or pdp-endian byte order
1360 * Converts a #guint16 value between big-endian and pdp-endian byte order.
1361 * The conversion is symmetric so it can be used both ways.
1363 * Returns: @val converted to the opposite byte order
1367 * GUINT16_SWAP_LE_BE:
1368 * @val: a #guint16 value in little-endian or big-endian byte order
1370 * Converts a #guint16 value between little-endian and big-endian byte order.
1371 * The conversion is symmetric so it can be used both ways.
1373 * Returns: @val converted to the opposite byte order
1377 * GUINT16_SWAP_LE_PDP:
1378 * @val: a #guint16 value in little-endian or pdp-endian byte order
1380 * Converts a #guint16 value between little-endian and pdp-endian byte order.
1381 * The conversion is symmetric so it can be used both ways.
1383 * Returns: @val converted to the opposite byte order
1387 * GUINT32_SWAP_BE_PDP:
1388 * @val: a #guint32 value in big-endian or pdp-endian byte order
1390 * Converts a #guint32 value between big-endian and pdp-endian byte order.
1391 * The conversion is symmetric so it can be used both ways.
1393 * Returns: @val converted to the opposite byte order
1397 * GUINT32_SWAP_LE_BE:
1398 * @val: a #guint32 value in little-endian or big-endian byte order
1400 * Converts a #guint32 value between little-endian and big-endian byte order.
1401 * The conversion is symmetric so it can be used both ways.
1403 * Returns: @val converted to the opposite byte order
1407 * GUINT32_SWAP_LE_PDP:
1408 * @val: a #guint32 value in little-endian or pdp-endian byte order
1410 * Converts a #guint32 value between little-endian and pdp-endian byte order.
1411 * The conversion is symmetric so it can be used both ways.
1413 * Returns: @val converted to the opposite byte order
1417 * GUINT64_SWAP_LE_BE:
1418 * @val: a #guint64 value in little-endian or big-endian byte order
1420 * Converts a #guint64 value between little-endian and big-endian byte order.
1421 * The conversion is symmetric so it can be used both ways.
1423 * Returns: @val converted to the opposite byte order
1426 /* Numerical Definitions {{{1 */
1430 * @title: Numerical Definitions
1431 * @short_description: mathematical constants, and floating point decomposition
1433 * GLib offers mathematical constants such as #G_PI for the value of pi;
1434 * many platforms have these in the C library, but some don't, the GLib
1435 * versions always exist.
1437 * The #GFloatIEEE754 and #GDoubleIEEE754 unions are used to access the
1438 * sign, mantissa and exponent of IEEE floats and doubles. These unions are
1439 * defined as appropriate for a given platform. IEEE floats and doubles are
1440 * supported (used for storage) by at least Intel, PPC and Sparc. See
1441 * <ulink url="http://en.wikipedia.org/wiki/IEEE_float">IEEE 754-2008</ulink>
1442 * for more information about IEEE number formats.
1446 * G_IEEE754_FLOAT_BIAS:
1448 * The bias by which exponents in single-precision floats are offset.
1452 * G_IEEE754_DOUBLE_BIAS:
1454 * The bias by which exponents in double-precision floats are offset.
1459 * @v_float: the double value
1461 * The #GFloatIEEE754 and #GDoubleIEEE754 unions are used to access the sign,
1462 * mantissa and exponent of IEEE floats and doubles. These unions are defined
1463 * as appropriate for a given platform. IEEE floats and doubles are supported
1464 * (used for storage) by at least Intel, PPC and Sparc.
1469 * @v_double: the double value
1471 * The #GFloatIEEE754 and #GDoubleIEEE754 unions are used to access the sign,
1472 * mantissa and exponent of IEEE floats and doubles. These unions are defined
1473 * as appropriate for a given platform. IEEE floats and doubles are supported
1474 * (used for storage) by at least Intel, PPC and Sparc.
1480 * The base of natural logarithms.
1486 * The natural logarithm of 2.
1492 * The natural logarithm of 10.
1498 * The value of pi (ratio of circle's circumference to its diameter).
1516 * The square root of two.
1522 * Multiplying the base 2 exponent by this number yields the base 10 exponent.
1529 * @title: Standard Macros
1530 * @short_description: commonly-used macros
1532 * These macros provide a few commonly-used features.
1538 * This macro is defined only on Windows. So you can bracket
1539 * Windows-specific code in "#ifdef G_OS_WIN32".
1545 * This macro is defined only on UNIX. So you can bracket
1546 * UNIX-specific code in "#ifdef G_OS_UNIX".
1552 * The directory separator character.
1553 * This is '/' on UNIX machines and '\' under Windows.
1557 * G_DIR_SEPARATOR_S:
1559 * The directory separator as a string.
1560 * This is "/" on UNIX machines and "\" under Windows.
1564 * G_IS_DIR_SEPARATOR:
1567 * Checks whether a character is a directory
1568 * separator. It returns %TRUE for '/' on UNIX
1569 * machines and for '\' or '/' under Windows.
1575 * G_SEARCHPATH_SEPARATOR:
1577 * The search path separator character.
1578 * This is ':' on UNIX machines and ';' under Windows.
1582 * G_SEARCHPATH_SEPARATOR_S:
1584 * The search path separator as a string.
1585 * This is ":" on UNIX machines and ";" under Windows.
1591 * Defines the %TRUE value for the #gboolean type.
1597 * Defines the %FALSE value for the #gboolean type.
1603 * Defines the standard %NULL pointer.
1608 * @a: a numeric value
1609 * @b: a numeric value
1611 * Calculates the minimum of @a and @b.
1613 * Returns: the minimum of @a and @b.
1618 * @a: a numeric value
1619 * @b: a numeric value
1621 * Calculates the maximum of @a and @b.
1623 * Returns: the maximum of @a and @b.
1628 * @a: a numeric value
1630 * Calculates the absolute value of @a.
1631 * The absolute value is simply the number with any negative sign taken away.
1635 * - ABS(10) is also 10.
1637 * Returns: the absolute value of @a.
1642 * @x: the value to clamp
1643 * @low: the minimum value allowed
1644 * @high: the maximum value allowed
1646 * Ensures that @x is between the limits set by @low and @high. If @low is
1647 * greater than @high the result is undefined.
1650 * - CLAMP(5, 10, 15) is 10.
1651 * - CLAMP(15, 5, 10) is 10.
1652 * - CLAMP(20, 15, 25) is 20.
1654 * Returns: the value of @x clamped to the range between @low and @high
1659 * @member_type: the type of the struct field
1660 * @struct_p: a pointer to a struct
1661 * @struct_offset: the offset of the field from the start of the struct,
1664 * Returns a member of a structure at a given offset, using the given type.
1666 * Returns: the struct member
1670 * G_STRUCT_MEMBER_P:
1671 * @struct_p: a pointer to a struct
1672 * @struct_offset: the offset from the start of the struct, in bytes
1674 * Returns an untyped pointer to a given offset of a struct.
1676 * Returns: an untyped pointer to @struct_p plus @struct_offset bytes
1681 * @struct_type: a structure type, e.g. <structname>GtkWidget</structname>
1682 * @member: a field in the structure, e.g. <structfield>window</structfield>
1684 * Returns the offset, in bytes, of a member of a struct.
1686 * Returns: the offset of @member from the start of @struct_type
1692 * If <literal>G_DISABLE_CONST_RETURNS</literal> is defined, this macro expands
1693 * to nothing. By default, the macro expands to <literal>const</literal>.
1694 * The macro should be used in place of <literal>const</literal> for
1695 * functions that return a value that should not be modified. The
1696 * purpose of this macro is to allow us to turn on <literal>const</literal>
1697 * for returned constant strings by default, while allowing programmers
1698 * who find that annoying to turn it off. This macro should only be used
1699 * for return values and for <emphasis>out</emphasis> parameters, it doesn't
1700 * make sense for <emphasis>in</emphasis> parameters.
1702 * Deprecated: 2.30: API providers should replace all existing uses with
1703 * <literal>const</literal> and API consumers should adjust their code
1711 * Determines the number of elements in an array. The array must be
1712 * declared so the compiler knows its size at compile-time; this
1713 * macro will not work on an array allocated on the heap, only static
1714 * arrays or arrays on the stack.
1717 /* Miscellaneous Macros {{{1 */
1720 * SECTION:macros_misc
1721 * @title: Miscellaneous Macros
1722 * @short_description: specialized macros which are not used often
1724 * These macros provide more specialized features which are not
1725 * needed so often by application programmers.
1731 * This macro is used to export function prototypes so they can be linked
1732 * with an external version when no inlining is performed. The file which
1733 * implements the functions should define <literal>G_IMPLEMENTS_INLINES</literal>
1734 * before including the headers which contain %G_INLINE_FUNC declarations.
1735 * Since inlining is very compiler-dependent using these macros correctly
1736 * is very difficult. Their use is strongly discouraged.
1738 * This macro is often mistaken for a replacement for the inline keyword;
1739 * inline is already declared in a portable manner in the GLib headers
1740 * and can be used normally.
1746 * Used within multi-statement macros so that they can be used in places
1747 * where only one statement is expected by the compiler.
1753 * Used within multi-statement macros so that they can be used in places
1754 * where only one statement is expected by the compiler.
1760 * Used (along with #G_END_DECLS) to bracket header files. If the
1761 * compiler in use is a C++ compiler, adds <literal>extern "C"</literal>
1762 * around the header.
1768 * Used (along with #G_BEGIN_DECLS) to bracket header files. If the
1769 * compiler in use is a C++ compiler, adds <literal>extern "C"</literal>
1770 * around the header.
1775 * @ap1: the <type>va_list</type> variable to place a copy of @ap2 in
1776 * @ap2: a <type>va_list</type>
1778 * Portable way to copy <type>va_list</type> variables.
1780 * In order to use this function, you must include
1781 * <filename>string.h</filename> yourself, because this macro may
1782 * use memmove() and GLib does not include <filename>string.h</filename>
1788 * @macro_or_string: a macro or a string
1790 * Accepts a macro or a string and converts it into a string after
1791 * preprocessor argument expansion. For example, the following code:
1795 * const gchar *greeting = G_STRINGIFY (AGE) " today!";
1798 * is transformed by the preprocessor into (code equivalent to):
1801 * const gchar *greeting = "27 today!";
1807 * @identifier1: an identifier
1808 * @identifier2: an identifier
1810 * Yields a new preprocessor pasted identifier
1811 * <code>identifier1identifier2</code> from its expanded
1812 * arguments @identifier1 and @identifier2. For example,
1813 * the following code:
1815 * #define GET(traveller,method) G_PASTE(traveller_get_, method) (traveller)
1816 * const gchar *name = GET (traveller, name);
1817 * const gchar *quest = GET (traveller, quest);
1818 * GdkColor *favourite = GET (traveller, favourite_colour);
1821 * is transformed by the preprocessor into:
1823 * const gchar *name = traveller_get_name (traveller);
1824 * const gchar *quest = traveller_get_quest (traveller);
1825 * GdkColor *favourite = traveller_get_favourite_colour (traveller);
1833 * @expr: a constant expression
1835 * The G_STATIC_ASSERT macro lets the programmer check
1836 * a condition at compile time, the condition needs to
1837 * be compile time computable. The macro can be used in
1838 * any place where a <literal>typedef</literal> is valid.
1841 * A <literal>typedef</literal> is generally allowed in
1842 * exactly the same places that a variable declaration is
1843 * allowed. For this reason, you should not use
1844 * <literal>G_STATIC_ASSERT</literal> in the middle of
1848 * The macro should only be used once per source code line.
1854 * G_STATIC_ASSERT_EXPR:
1855 * @expr: a constant expression
1857 * The G_STATIC_ASSERT_EXPR macro lets the programmer check
1858 * a condition at compile time. The condition needs to be
1859 * compile time computable.
1861 * Unlike <literal>G_STATIC_ASSERT</literal>, this macro
1862 * evaluates to an expression and, as such, can be used in
1863 * the middle of other expressions. Its value should be
1864 * ignored. This can be accomplished by placing it as
1865 * the first argument of a comma expression.
1868 * #define ADD_ONE_TO_INT(x) \
1869 * (G_STATIC_ASSERT_EXPR(sizeof (x) == sizeof (int)), ((x) + 1))
1878 * Expands to <literal>__extension__</literal> when <command>gcc</command>
1879 * is used as the compiler. This simply tells <command>gcc</command> not
1880 * to warn about the following non-standard code when compiling with the
1881 * <option>-pedantic</option> option.
1887 * Expands to the GNU C <literal>const</literal> function attribute if
1888 * the compiler is <command>gcc</command>. Declaring a function as const
1889 * enables better optimization of calls to the function. A const function
1890 * doesn't examine any values except its parameters, and has no effects
1891 * except its return value.
1893 * Place the attribute after the declaration, just before the semicolon.
1895 * See the GNU C documentation for more details.
1898 * A function that has pointer arguments and examines the data pointed to
1899 * must <emphasis>not</emphasis> be declared const. Likewise, a function
1900 * that calls a non-const function usually must not be const. It doesn't
1901 * make sense for a const function to return void.
1908 * Expands to the GNU C <literal>pure</literal> function attribute if the
1909 * compiler is <command>gcc</command>. Declaring a function as pure enables
1910 * better optimization of calls to the function. A pure function has no
1911 * effects except its return value and the return value depends only on
1912 * the parameters and/or global variables.
1914 * Place the attribute after the declaration, just before the semicolon.
1916 * See the GNU C documentation for more details.
1922 * Expands to the GNU C <literal>malloc</literal> function attribute if the
1923 * compiler is <command>gcc</command>. Declaring a function as malloc enables
1924 * better optimization of the function. A function can have the malloc
1925 * attribute if it returns a pointer which is guaranteed to not alias with
1926 * any other pointer when the function returns (in practice, this means newly
1927 * allocated memory).
1929 * Place the attribute after the declaration, just before the semicolon.
1931 * See the GNU C documentation for more details.
1937 * G_GNUC_ALLOC_SIZE:
1938 * @x: the index of the argument specifying the allocation size
1940 * Expands to the GNU C <literal>alloc_size</literal> function attribute
1941 * if the compiler is a new enough <command>gcc</command>. This attribute
1942 * tells the compiler that the function returns a pointer to memory of a
1943 * size that is specified by the @x<!-- -->th function parameter.
1945 * Place the attribute after the function declaration, just before the
1948 * See the GNU C documentation for more details.
1954 * G_GNUC_ALLOC_SIZE2:
1955 * @x: the index of the argument specifying one factor of the allocation size
1956 * @y: the index of the argument specifying the second factor of the allocation size
1958 * Expands to the GNU C <literal>alloc_size</literal> function attribute
1959 * if the compiler is a new enough <command>gcc</command>. This attribute
1960 * tells the compiler that the function returns a pointer to memory of a
1961 * size that is specified by the product of two function parameters.
1963 * Place the attribute after the function declaration, just before the
1966 * See the GNU C documentation for more details.
1972 * G_GNUC_DEPRECATED:
1974 * Expands to the GNU C <literal>deprecated</literal> attribute if the
1975 * compiler is <command>gcc</command>. It can be used to mark typedefs,
1976 * variables and functions as deprecated. When called with the
1977 * <option>-Wdeprecated-declarations</option> option, the compiler will
1978 * generate warnings when deprecated interfaces are used.
1980 * Place the attribute after the declaration, just before the semicolon.
1982 * See the GNU C documentation for more details.
1988 * G_GNUC_DEPRECATED_FOR:
1989 * @f: the intended replacement for the deprecated symbol,
1990 * such as the name of a function
1992 * Like %G_GNUC_DEPRECATED, but names the intended replacement for the
1993 * deprecated symbol if the version of <command>gcc</command> in use is
1994 * new enough to support custom deprecation messages.
1996 * Place the attribute after the declaration, just before the semicolon.
1998 * See the GNU C documentation for more details.
2000 * Note that if @f is a macro, it will be expanded in the warning message.
2001 * You can enclose it in quotes to prevent this. (The quotes will show up
2002 * in the warning, but it's better than showing the macro expansion.)
2008 * G_GNUC_BEGIN_IGNORE_DEPRECATIONS:
2010 * Tells <command>gcc</command> (if it is a new enough version) to
2011 * temporarily stop emitting warnings when functions marked with
2012 * %G_GNUC_DEPRECATED or %G_GNUC_DEPRECATED_FOR are called. This is
2013 * useful for when you have one deprecated function calling another
2014 * one, or when you still have regression tests for deprecated
2017 * Use %G_GNUC_END_IGNORE_DEPRECATIONS to begin warning again. (If you
2018 * are not compiling with <literal>-Wdeprecated-declarations</literal>
2019 * then neither macro has any effect.)
2021 * This macro can be used either inside or outside of a function body,
2022 * but must appear on a line by itself.
2028 * G_GNUC_END_IGNORE_DEPRECATIONS:
2030 * Undoes the effect of %G_GNUC_BEGIN_IGNORE_DEPRECATIONS, telling
2031 * <command>gcc</command> to begin outputting warnings again
2032 * (assuming those warnings had been enabled to begin with).
2034 * This macro can be used either inside or outside of a function body,
2035 * but must appear on a line by itself.
2043 * This macro is similar to %G_GNUC_DEPRECATED, and can be used to mark
2044 * functions declarations as deprecated. Unlike %G_GNUC_DEPRECATED, it is
2045 * meant to be portable across different compilers and must be placed
2046 * before the function declaration.
2053 * @f: the name of the function that this function was deprecated for
2055 * This macro is similar to %G_GNUC_DEPRECATED_FOR, and can be used to mark
2056 * functions declarations as deprecated. Unlike %G_GNUC_DEPRECATED_FOR, it is
2057 * meant to be portable across different compilers and must be placed
2058 * before the function declaration.
2065 * @maj: the major version that introduced the symbol
2066 * @min: the minor version that introduced the symbol
2068 * This macro can be used to mark a function declaration as unavailable.
2069 * It must be placed before the function declaration. Use of a function
2070 * that has been annotated with this macros will produce a compiler warning.
2076 * GLIB_DISABLE_DEPRECATION_WARNINGS:
2078 * A macro that should be defined before including the glib.h header.
2079 * If it is defined, no compiler warnings will be produced for uses
2080 * of deprecated GLib APIs.
2086 * Expands to the GNU C <literal>noreturn</literal> function attribute
2087 * if the compiler is <command>gcc</command>. It is used for declaring
2088 * functions which never return. It enables optimization of the function,
2089 * and avoids possible compiler warnings.
2091 * Place the attribute after the declaration, just before the semicolon.
2093 * See the GNU C documentation for more details.
2099 * Expands to the GNU C <literal>unused</literal> function attribute if
2100 * the compiler is <command>gcc</command>. It is used for declaring
2101 * functions and arguments which may never be used. It avoids possible compiler
2104 * For functions, place the attribute after the declaration, just before the
2105 * semicolon. For arguments, place the attribute at the beginning of the
2106 * argument declaration.
2109 * void my_unused_function (G_GNUC_UNUSED gint unused_argument,
2110 * gint other_argument) G_GNUC_UNUSED;
2113 * See the GNU C documentation for more details.
2118 * @format_idx: the index of the argument corresponding to the
2119 * format string (The arguments are numbered from 1)
2120 * @arg_idx: the index of the first of the format arguments
2122 * Expands to the GNU C <literal>format</literal> function attribute
2123 * if the compiler is <command>gcc</command>. This is used for declaring
2124 * functions which take a variable number of arguments, with the same
2125 * syntax as printf(). It allows the compiler to type-check the arguments
2126 * passed to the function.
2128 * Place the attribute after the function declaration, just before the
2131 * See the GNU C documentation for more details.
2134 * gint g_snprintf (gchar *string,
2136 * gchar const *format,
2137 * ...) G_GNUC_PRINTF (3, 4);
2143 * @format_idx: the index of the argument corresponding to
2144 * the format string (The arguments are numbered from 1)
2145 * @arg_idx: the index of the first of the format arguments
2147 * Expands to the GNU C <literal>format</literal> function attribute
2148 * if the compiler is <command>gcc</command>. This is used for declaring
2149 * functions which take a variable number of arguments, with the same
2150 * syntax as scanf(). It allows the compiler to type-check the arguments
2151 * passed to the function. See the GNU C documentation for details.
2156 * @arg_idx: the index of the argument
2158 * Expands to the GNU C <literal>format_arg</literal> function attribute
2159 * if the compiler is <command>gcc</command>. This function attribute
2160 * specifies that a function takes a format string for a printf(),
2161 * scanf(), strftime() or strfmon() style function and modifies it,
2162 * so that the result can be passed to a printf(), scanf(), strftime()
2163 * or strfmon() style function (with the remaining arguments to the
2164 * format function the same as they would have been for the unmodified
2167 * Place the attribute after the function declaration, just before the
2170 * See the GNU C documentation for more details.
2173 * gchar *g_dgettext (gchar *domain_name, gchar *msgid) G_GNUC_FORMAT (2);
2178 * G_GNUC_NULL_TERMINATED:
2180 * Expands to the GNU C <literal>sentinel</literal> function attribute
2181 * if the compiler is <command>gcc</command>, or "" if it isn't. This
2182 * function attribute only applies to variadic functions and instructs
2183 * the compiler to check that the argument list is terminated with an
2186 * Place the attribute after the declaration, just before the semicolon.
2188 * See the GNU C documentation for more details.
2194 * G_GNUC_WARN_UNUSED_RESULT:
2196 * Expands to the GNU C <literal>warn_unused_result</literal> function
2197 * attribute if the compiler is <command>gcc</command>, or "" if it isn't.
2198 * This function attribute makes the compiler emit a warning if the result
2199 * of a function call is ignored.
2201 * Place the attribute after the declaration, just before the semicolon.
2203 * See the GNU C documentation for more details.
2211 * Expands to "" on all modern compilers, and to
2212 * <literal>__FUNCTION__</literal> on <command>gcc</command> version 2.x.
2215 * Deprecated: 2.16: Use #G_STRFUNC instead
2219 * G_GNUC_PRETTY_FUNCTION:
2221 * Expands to "" on all modern compilers, and to
2222 * <literal>__PRETTY_FUNCTION__</literal> on <command>gcc</command>
2223 * version 2.x. Don't use it.
2225 * Deprecated: 2.16: Use #G_STRFUNC instead
2229 * G_GNUC_NO_INSTRUMENT:
2231 * Expands to the GNU C <literal>no_instrument_function</literal> function
2232 * attribute if the compiler is <command>gcc</command>. Functions with this
2233 * attribute will not be instrumented for profiling, when the compiler is
2234 * called with the <option>-finstrument-functions</option> option.
2236 * Place the attribute after the declaration, just before the semicolon.
2238 * See the GNU C documentation for more details.
2244 * This attribute can be used for marking library functions as being used
2245 * internally to the library only, which may allow the compiler to handle
2246 * function calls more efficiently. Note that static functions do not need
2247 * to be marked as internal in this way. See the GNU C documentation for
2250 * When using a compiler that supports the GNU C hidden visibility attribute,
2251 * this macro expands to <literal>__attribute__((visibility("hidden")))</literal>.
2252 * When using the Sun Studio compiler, it expands to <literal>__hidden</literal>.
2254 * Note that for portability, the attribute should be placed before the
2255 * function declaration. While GCC allows the macro after the declaration,
2256 * Sun Studio does not.
2260 * void _g_log_fallback_handler (const gchar *log_domain,
2261 * GLogLevelFlags log_level,
2262 * const gchar *message,
2263 * gpointer unused_data);
2272 * Expands to the GNU C <literal>may_alias</literal> type attribute
2273 * if the compiler is <command>gcc</command>. Types with this attribute
2274 * will not be subjected to type-based alias analysis, but are assumed
2275 * to alias with any other type, just like char.
2276 * See the GNU C documentation for details.
2283 * @expr: the expression
2285 * Hints the compiler that the expression is likely to evaluate to
2286 * a true value. The compiler may use this information for optimizations.
2289 * if (G_LIKELY (random () != 1))
2290 * g_print ("not one");
2293 * Returns: the value of @expr
2300 * @expr: the expression
2302 * Hints the compiler that the expression is unlikely to evaluate to
2303 * a true value. The compiler may use this information for optimizations.
2306 * if (G_UNLIKELY (random () == 1))
2307 * g_print ("a random one");
2310 * Returns: the value of @expr
2318 * Expands to a string identifying the current code position.
2324 * Expands to a string identifying the current function.
2329 /* Windows Compatibility Functions {{{1 */
2333 * @title: Windows Compatibility Functions
2334 * @short_description: UNIX emulation on Windows
2336 * These functions provide some level of UNIX emulation on the
2337 * Windows platform. If your application really needs the POSIX
2338 * APIs, we suggest you try the Cygwin project.
2344 * Provided for UNIX emulation on Windows; equivalent to UNIX
2345 * macro %MAXPATHLEN, which is the maximum length of a filename
2346 * (including full path).
2350 * G_WIN32_DLLMAIN_FOR_DLL_NAME:
2351 * @static: empty or "static"
2352 * @dll_name: the name of the (pointer to the) char array where
2353 * the DLL name will be stored. If this is used, you must also
2354 * include <filename>windows.h</filename>. If you need a more
2355 * complex DLL entry point function, you cannot use this
2357 * On Windows, this macro defines a DllMain() function that stores
2358 * the actual DLL name that the code being compiled will be included in.
2360 * On non-Windows platforms, expands to nothing.
2364 * G_WIN32_HAVE_WIDECHAR_API:
2366 * On Windows, this macro defines an expression which evaluates to
2367 * %TRUE if the code is running on a version of Windows where the wide
2368 * character versions of the Win32 API functions, and the wide character
2369 * versions of the C library functions work. (They are always present in
2370 * the DLLs, but don't work on Windows 9x and Me.)
2372 * On non-Windows platforms, it is not defined.
2379 * G_WIN32_IS_NT_BASED:
2381 * On Windows, this macro defines an expression which evaluates to
2382 * %TRUE if the code is running on an NT-based Windows operating system.
2384 * On non-Windows platforms, it is not defined.
2390 /* vim: set foldmethod=marker: */