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 than void*.
73 * An untyped pointer to constant data.
74 * The data pointed to should not be changed.
76 * This is typically used in function prototypes to indicate
77 * that the data pointed to will not be altered by the function.
83 * Corresponds to the standard C char type.
89 * Corresponds to the standard C unsigned char type.
95 * Corresponds to the standard C int type.
96 * Values of this type can range from #G_MININT to #G_MAXINT.
102 * The minimum value which can be held in a #gint.
108 * The maximum value which can be held in a #gint.
114 * Corresponds to the standard C unsigned int type.
115 * Values of this type can range from 0 to #G_MAXUINT.
121 * The maximum value which can be held in a #guint.
127 * Corresponds to the standard C short type.
128 * Values of this type can range from #G_MINSHORT to #G_MAXSHORT.
134 * The minimum value which can be held in a #gshort.
140 * The maximum value which can be held in a #gshort.
146 * Corresponds to the standard C unsigned short type.
147 * Values of this type can range from 0 to #G_MAXUSHORT.
153 * The maximum value which can be held in a #gushort.
159 * Corresponds to the standard C long type.
160 * Values of this type can range from #G_MINLONG to #G_MAXLONG.
166 * The minimum value which can be held in a #glong.
172 * The maximum value which can be held in a #glong.
178 * Corresponds to the standard C unsigned long type.
179 * Values of this type can range from 0 to #G_MAXULONG.
185 * The maximum value which can be held in a #gulong.
191 * A signed integer guaranteed to be 8 bits on all platforms.
192 * Values of this type can range from #G_MININT8 (= -128) to
193 * #G_MAXINT8 (= 127).
199 * The minimum value which can be held in a #gint8.
207 * The maximum value which can be held in a #gint8.
215 * An unsigned integer guaranteed to be 8 bits on all platforms.
216 * Values of this type can range from 0 to #G_MAXUINT8 (= 255).
222 * The maximum value which can be held in a #guint8.
230 * A signed integer guaranteed to be 16 bits on all platforms.
231 * Values of this type can range from #G_MININT16 (= -32,768) to
232 * #G_MAXINT16 (= 32,767).
234 * To print or scan values of this type, use
235 * %G_GINT16_MODIFIER and/or %G_GINT16_FORMAT.
241 * The minimum value which can be held in a #gint16.
249 * The maximum value which can be held in a #gint16.
257 * The platform dependent length modifier for conversion specifiers
258 * for scanning and printing values of type #gint16 or #guint16. It
259 * is a string literal, but doesn't include the percent-sign, such
260 * that you can add precision and length modifiers between percent-sign
261 * and conversion specifier and append a conversion specifier.
263 * The following example prints "0x7b";
265 * gint16 value = 123;
266 * g_print ("%#" G_GINT16_MODIFIER "x", value);
275 * This is the platform dependent conversion specifier for scanning and
276 * printing values of type #gint16. It is a string literal, but doesn't
277 * include the percent-sign, such that you can add precision and length
278 * modifiers between percent-sign and conversion specifier.
283 * sscanf ("42", "%" G_GINT16_FORMAT, &in)
285 * g_print ("%" G_GINT32_FORMAT, out);
292 * An unsigned integer guaranteed to be 16 bits on all platforms.
293 * Values of this type can range from 0 to #G_MAXUINT16 (= 65,535).
295 * To print or scan values of this type, use
296 * %G_GINT16_MODIFIER and/or %G_GUINT16_FORMAT.
302 * The maximum value which can be held in a #guint16.
310 * This is the platform dependent conversion specifier for scanning
311 * and printing values of type #guint16. See also #G_GINT16_FORMAT
317 * A signed integer guaranteed to be 32 bits on all platforms.
318 * Values of this type can range from #G_MININT32 (= -2,147,483,648)
319 * to #G_MAXINT32 (= 2,147,483,647).
321 * To print or scan values of this type, use
322 * %G_GINT32_MODIFIER and/or %G_GINT32_FORMAT.
328 * The minimum value which can be held in a #gint32.
336 * The maximum value which can be held in a #gint32.
344 * The platform dependent length modifier for conversion specifiers
345 * for scanning and printing values of type #gint32 or #guint32. It
346 * is a string literal. See also #G_GINT16_MODIFIER.
354 * This is the platform dependent conversion specifier for scanning
355 * and printing values of type #gint32. See also #G_GINT16_FORMAT.
361 * An unsigned integer guaranteed to be 32 bits on all platforms.
362 * Values of this type can range from 0 to #G_MAXUINT32 (= 4,294,967,295).
364 * To print or scan values of this type, use
365 * %G_GINT32_MODIFIER and/or %G_GUINT32_FORMAT.
371 * The maximum value which can be held in a #guint32.
379 * This is the platform dependent conversion specifier for scanning
380 * and printing values of type #guint32. See also #G_GINT16_FORMAT.
386 * A signed integer guaranteed to be 64 bits on all platforms.
387 * Values of this type can range from #G_MININT64
388 * (= -9,223,372,036,854,775,808) to #G_MAXINT64
389 * (= 9,223,372,036,854,775,807).
391 * To print or scan values of this type, use
392 * %G_GINT64_MODIFIER and/or %G_GINT64_FORMAT.
398 * The minimum value which can be held in a #gint64.
404 * The maximum value which can be held in a #gint64.
410 * The platform dependent length modifier for conversion specifiers
411 * for scanning and printing values of type #gint64 or #guint64.
412 * It is a string literal.
415 * Some platforms do not support printing 64 bit integers, even
416 * though the types are supported. On such platforms #G_GINT64_MODIFIER
426 * This is the platform dependent conversion specifier for scanning
427 * and printing values of type #gint64. See also #G_GINT16_FORMAT.
430 * Some platforms do not support scanning and printing 64 bit integers,
431 * even though the types are supported. On such platforms #G_GINT64_FORMAT
432 * is not defined. Note that scanf() may not support 64 bit integers, even
433 * if #G_GINT64_FORMAT is defined. Due to its weak error handling, scanf()
434 * is not recommended for parsing anyway; consider using g_ascii_strtoull()
442 * An unsigned integer guaranteed to be 64 bits on all platforms.
443 * Values of this type can range from 0 to #G_MAXUINT64
444 * (= 18,446,744,073,709,551,615).
446 * To print or scan values of this type, use
447 * %G_GINT64_MODIFIER and/or %G_GUINT64_FORMAT.
453 * The maximum value which can be held in a #guint64.
459 * This is the platform dependent conversion specifier for scanning
460 * and printing values of type #guint64. See also #G_GINT16_FORMAT.
463 * Some platforms do not support scanning and printing 64 bit integers,
464 * even though the types are supported. On such platforms #G_GUINT64_FORMAT
465 * is not defined. Note that scanf() may not support 64 bit integers, even
466 * if #G_GINT64_FORMAT is defined. Due to its weak error handling, scanf()
467 * is not recommended for parsing anyway; consider using g_ascii_strtoull()
474 * @val: a literal integer value, e.g. 0x1d636b02300a7aa7
476 * This macro is used to insert 64-bit integer literals
477 * into the source code.
481 * G_GUINT64_CONSTANT:
482 * @val: a literal integer value, e.g. 0x1d636b02300a7aa7U
484 * This macro is used to insert 64-bit unsigned integer
485 * literals into the source code.
493 * Corresponds to the standard C float type.
494 * Values of this type can range from -#G_MAXFLOAT to #G_MAXFLOAT.
500 * The minimum positive value which can be held in a #gfloat.
502 * If you are interested in the smallest value which can be held
503 * in a #gfloat, use -G_MAXFLOAT.
509 * The maximum value which can be held in a #gfloat.
515 * Corresponds to the standard C double type.
516 * Values of this type can range from -#G_MAXDOUBLE to #G_MAXDOUBLE.
522 * The minimum positive value which can be held in a #gdouble.
524 * If you are interested in the smallest value which can be held
525 * in a #gdouble, use -G_MAXDOUBLE.
531 * The maximum value which can be held in a #gdouble.
537 * An unsigned integer type of the result of the sizeof operator,
538 * corresponding to the size_t type defined in C99.
539 * This type is wide enough to hold the numeric value of a pointer,
540 * so it is usually 32bit wide on a 32bit platform and 64bit wide
541 * on a 64bit platform. Values of this type can range from 0 to
544 * To print or scan values of this type, use
545 * %G_GSIZE_MODIFIER and/or %G_GSIZE_FORMAT.
551 * The maximum value which can be held in a #gsize.
559 * The platform dependent length modifier for conversion specifiers
560 * for scanning and printing values of type #gsize or #gssize. It
561 * is a string literal.
569 * This is the platform dependent conversion specifier for scanning
570 * and printing values of type #gsize. See also #G_GINT16_FORMAT.
578 * A signed variant of #gsize, corresponding to the
579 * ssize_t defined on most platforms.
580 * Values of this type can range from #G_MINSSIZE
583 * To print or scan values of this type, use
584 * %G_GSIZE_MODIFIER and/or %G_GSSIZE_FORMAT.
590 * The minimum value which can be held in a #gssize.
598 * The maximum value which can be held in a #gssize.
606 * This is the platform dependent conversion specifier for scanning
607 * and printing values of type #gssize. See also #G_GINT16_FORMAT.
615 * A signed integer type that is used for file offsets,
616 * corresponding to the C99 type off64_t.
617 * Values of this type can range from #G_MINOFFSET to
620 * To print or scan values of this type, use
621 * %G_GOFFSET_MODIFIER and/or %G_GOFFSET_FORMAT.
629 * The minimum value which can be held in a #goffset.
635 * The maximum value which can be held in a #goffset.
639 * G_GOFFSET_MODIFIER:
641 * The platform dependent length modifier for conversion specifiers
642 * for scanning and printing values of type #goffset. It is a string
643 * literal. See also #G_GINT64_MODIFIER.
651 * This is the platform dependent conversion specifier for scanning
652 * and printing values of type #goffset. See also #G_GINT64_FORMAT.
658 * G_GOFFSET_CONSTANT:
659 * @val: a literal integer value, e.g. 0x1d636b02300a7aa7
661 * This macro is used to insert #goffset 64-bit integer literals
662 * into the source code.
664 * See also #G_GINT64_CONSTANT.
672 * Corresponds to the C99 type intptr_t,
673 * a signed integer type that can hold any pointer.
675 * To print or scan values of this type, use
676 * %G_GINTPTR_MODIFIER and/or %G_GINTPTR_FORMAT.
682 * G_GINTPTR_MODIFIER:
684 * The platform dependent length modifier for conversion specifiers
685 * for scanning and printing values of type #gintptr or #guintptr.
686 * It is a string literal.
694 * This is the platform dependent conversion specifier for scanning
695 * and printing values of type #gintptr.
703 * Corresponds to the C99 type uintptr_t,
704 * an unsigned integer type that can hold any pointer.
706 * To print or scan values of this type, use
707 * %G_GINTPTR_MODIFIER and/or %G_GUINTPTR_FORMAT.
715 * This is the platform dependent conversion specifier
716 * for scanning and printing values of type #guintptr.
721 /* Type conversion {{{1 */
724 * SECTION:type_conversion
725 * @title: Type Conversion Macros
726 * @short_description: portably storing integers in pointer variables
728 * Many times GLib, GTK+, and other libraries allow you to pass "user
729 * data" to a callback, in the form of a void pointer. From time to time
730 * you want to pass an integer instead of a pointer. You could allocate
731 * an integer, with something like:
733 * int *ip = g_new (int, 1);
736 * But this is inconvenient, and it's annoying to have to free the
737 * memory at some later time.
739 * Pointers are always at least 32 bits in size (on all platforms GLib
740 * intends to support). Thus you can store at least 32-bit integer values
741 * in a pointer value. Naively, you might try this, but it's incorrect:
748 * Again, that example was <emphasis>not</emphasis> correct, don't copy it.
749 * The problem is that on some systems you need to do this:
753 * p = (void*) (long) 42;
754 * i = (int) (long) p;
756 * The GLib macros GPOINTER_TO_INT(), GINT_TO_POINTER(), etc. take care
757 * to do the right thing on the every platform.
759 * <warning><para>You may not store pointers in integers. This is not
760 * portable in any way, shape or form. These macros <emphasis>only</emphasis>
761 * allow storing integers in pointers, and only preserve 32 bits of the
762 * integer; values outside the range of a 32-bit integer will be mangled.
768 * @i: integer to stuff into a pointer
770 * Stuffs an integer into a pointer type.
772 * Remember, you may not store pointers in integers. This is not portable
773 * in any way, shape or form. These macros <emphasis>only</emphasis> allow
774 * storing integers in pointers, and only preserve 32 bits of the
775 * integer; values outside the range of a 32-bit integer will be mangled.
780 * @p: pointer containing an integer
782 * Extracts an integer from a pointer. The integer must have
783 * been stored in the pointer with GINT_TO_POINTER().
785 * Remember, you may not store pointers in integers. This is not portable
786 * in any way, shape or form. These macros <emphasis>only</emphasis> allow
787 * storing integers in pointers, and only preserve 32 bits of the
788 * integer; values outside the range of a 32-bit integer will be mangled.
793 * @u: unsigned integer to stuff into the pointer
795 * Stuffs an unsigned integer into a pointer type.
800 * @p: pointer to extract an unsigned integer from
802 * Extracts an unsigned integer from a pointer. The integer must have
803 * been stored in the pointer with GUINT_TO_POINTER().
808 * @s: #gsize to stuff into the pointer
810 * Stuffs a #gsize into a pointer type.
815 * @p: pointer to extract a #gsize from
817 * Extracts a #gsize from a pointer. The #gsize must have
818 * been stored in the pointer with GSIZE_TO_POINTER().
821 /* Byte order {{{1 */
825 * @title: Byte Order Macros
826 * @short_description: a portable way to convert between different byte orders
828 * These macros provide a portable way to determine the host byte order
829 * and to convert values between different byte orders.
831 * The byte order is the order in which bytes are stored to create larger
832 * data types such as the #gint and #glong values.
833 * The host byte order is the byte order used on the current machine.
835 * Some processors store the most significant bytes (i.e. the bytes that
836 * hold the largest part of the value) first. These are known as big-endian
837 * processors. Other processors (notably the x86 family) store the most
838 * significant byte last. These are known as little-endian processors.
840 * Finally, to complicate matters, some other processors store the bytes in
841 * a rather curious order known as PDP-endian. For a 4-byte word, the 3rd
842 * most significant byte is stored first, then the 4th, then the 1st and
845 * Obviously there is a problem when these different processors communicate
846 * with each other, for example over networks or by using binary file formats.
847 * This is where these macros come in. They are typically used to convert
848 * values into a byte order which has been agreed on for use when
849 * communicating between different processors. The Internet uses what is
850 * known as 'network byte order' as the standard byte order (which is in
851 * fact the big-endian byte order).
853 * Note that the byte order conversion macros may evaluate their arguments
854 * multiple times, thus you should not use them with arguments which have
861 * The host byte order.
862 * This can be either #G_LITTLE_ENDIAN or #G_BIG_ENDIAN (support for
863 * #G_PDP_ENDIAN may be added in future.)
869 * Specifies one of the possible types of byte order.
876 * Specifies one of the possible types of byte order.
883 * Specifies one of the possible types of byte order
884 * (currently unused). See #G_BYTE_ORDER.
889 * @val: a 32-bit integer value in host byte order
891 * Converts a 32-bit integer value from host to network byte order.
893 * Returns: @val converted to network byte order
898 * @val: a 16-bit integer value in host byte order
900 * Converts a 16-bit integer value from host to network byte order.
902 * Returns: @val converted to network byte order
907 * @val: a 32-bit integer value in network byte order
909 * Converts a 32-bit integer value from network to host byte order.
911 * Returns: @val converted to host byte order.
916 * @val: a 16-bit integer value in network byte order
918 * Converts a 16-bit integer value from network to host byte order.
920 * Returns: @val converted to host byte order
925 * @val: a #gint value in big-endian byte order
927 * Converts a #gint value from big-endian to host byte order.
929 * Returns: @val converted to host byte order
934 * @val: a #gint value in little-endian byte order
936 * Converts a #gint value from little-endian to host byte order.
938 * Returns: @val converted to host byte order
943 * @val: a #gint value in host byte order
945 * Converts a #gint value from host byte order to big-endian.
947 * Returns: @val converted to big-endian byte order
952 * @val: a #gint value in host byte order
954 * Converts a #gint value from host byte order to little-endian.
956 * Returns: @val converted to little-endian byte order
961 * @val: a #guint value in big-endian byte order
963 * Converts a #guint value from big-endian to host byte order.
965 * Returns: @val converted to host byte order
970 * @val: a #guint value in little-endian byte order
972 * Converts a #guint value from little-endian to host byte order.
974 * Returns: @val converted to host byte order
979 * @val: a #guint value in host byte order
981 * Converts a #guint value from host byte order to big-endian.
983 * Returns: @val converted to big-endian byte order
988 * @val: a #guint value in host byte order
990 * Converts a #guint value from host byte order to little-endian.
992 * Returns: @val converted to little-endian byte order.
997 * @val: a #glong value in big-endian byte order
999 * Converts a #glong value from big-endian to the host byte order.
1001 * Returns: @val converted to host byte order
1006 * @val: a #glong value in little-endian byte order
1008 * Converts a #glong value from little-endian to host byte order.
1010 * Returns: @val converted to host byte order
1015 * @val: a #glong value in host byte order
1017 * Converts a #glong value from host byte order to big-endian.
1019 * Returns: @val converted to big-endian byte order
1024 * @val: a #glong value in host byte order
1026 * Converts a #glong value from host byte order to little-endian.
1028 * Returns: @val converted to little-endian
1033 * @val: a #gulong value in big-endian byte order
1035 * Converts a #gulong value from big-endian to host byte order.
1037 * Returns: @val converted to host byte order
1042 * @val: a #gulong value in little-endian byte order
1044 * Converts a #gulong value from little-endian to host byte order.
1046 * Returns: @val converted to host byte order
1051 * @val: a #gulong value in host byte order
1053 * Converts a #gulong value from host byte order to big-endian.
1055 * Returns: @val converted to big-endian
1060 * @val: a #gulong value in host byte order
1062 * Converts a #gulong value from host byte order to little-endian.
1064 * Returns: @val converted to little-endian
1069 * @val: a #gsize value in big-endian byte order
1071 * Converts a #gsize value from big-endian to the host byte order.
1073 * Returns: @val converted to host byte order
1078 * @val: a #gsize value in little-endian byte order
1080 * Converts a #gsize value from little-endian to host byte order.
1082 * Returns: @val converted to host byte order
1087 * @val: a #gsize value in host byte order
1089 * Converts a #gsize value from host byte order to big-endian.
1091 * Returns: @val converted to big-endian byte order
1096 * @val: a #gsize value in host byte order
1098 * Converts a #gsize value from host byte order to little-endian.
1100 * Returns: @val converted to little-endian
1105 * @val: a #gssize value in big-endian byte order
1107 * Converts a #gssize value from big-endian to host byte order.
1109 * Returns: @val converted to host byte order
1114 * @val: a #gssize value in little-endian byte order
1116 * Converts a #gssize value from little-endian to host byte order.
1118 * Returns: @val converted to host byte order
1123 * @val: a #gssize value in host byte order
1125 * Converts a #gssize value from host byte order to big-endian.
1127 * Returns: @val converted to big-endian
1132 * @val: a #gssize value in host byte order
1134 * Converts a #gssize value from host byte order to little-endian.
1136 * Returns: @val converted to little-endian
1141 * @val: a #gint16 value in big-endian byte order
1143 * Converts a #gint16 value from big-endian to host byte order.
1145 * Returns: @val converted to host byte order
1150 * @val: a #gint16 value in little-endian byte order
1152 * Converts a #gint16 value from little-endian to host byte order.
1154 * Returns: @val converted to host byte order
1159 * @val: a #gint16 value in host byte order
1161 * Converts a #gint16 value from host byte order to big-endian.
1163 * Returns: @val converted to big-endian
1168 * @val: a #gint16 value in host byte order
1170 * Converts a #gint16 value from host byte order to little-endian.
1172 * Returns: @val converted to little-endian
1177 * @val: a #guint16 value in big-endian byte order
1179 * Converts a #guint16 value from big-endian to host byte order.
1181 * Returns: @val converted to host byte order
1186 * @val: a #guint16 value in little-endian byte order
1188 * Converts a #guint16 value from little-endian to host byte order.
1190 * Returns: @val converted to host byte order
1195 * @val: a #guint16 value in host byte order
1197 * Converts a #guint16 value from host byte order to big-endian.
1199 * Returns: @val converted to big-endian
1204 * @val: a #guint16 value in host byte order
1206 * Converts a #guint16 value from host byte order to little-endian.
1208 * Returns: @val converted to little-endian
1213 * @val: a #gint32 value in big-endian byte order
1215 * Converts a #gint32 value from big-endian to host byte order.
1217 * Returns: @val converted to host byte order
1222 * @val: a #gint32 value in little-endian byte order
1224 * Converts a #gint32 value from little-endian to host byte order.
1226 * Returns: @val converted to host byte order
1231 * @val: a #gint32 value in host byte order
1233 * Converts a #gint32 value from host byte order to big-endian.
1235 * Returns: @val converted to big-endian
1240 * @val: a #gint32 value in host byte order
1242 * Converts a #gint32 value from host byte order to little-endian.
1244 * Returns: @val converted to little-endian
1249 * @val: a #guint32 value in big-endian byte order
1251 * Converts a #guint32 value from big-endian to host byte order.
1253 * Returns: @val converted to host byte order
1258 * @val: a #guint32 value in little-endian byte order
1260 * Converts a #guint32 value from little-endian to host byte order.
1262 * Returns: @val converted to host byte order
1267 * @val: a #guint32 value in host byte order
1269 * Converts a #guint32 value from host byte order to big-endian.
1271 * Returns: @val converted to big-endian
1276 * @val: a #guint32 value in host byte order
1278 * Converts a #guint32 value from host byte order to little-endian.
1280 * Returns: @val converted to little-endian
1285 * @val: a #gint64 value in big-endian byte order
1287 * Converts a #gint64 value from big-endian to host byte order.
1289 * Returns: @val converted to host byte order
1294 * @val: a #gint64 value in little-endian byte order
1296 * Converts a #gint64 value from little-endian to host byte order.
1298 * Returns: @val converted to host byte order
1303 * @val: a #gint64 value in host byte order
1305 * Converts a #gint64 value from host byte order to big-endian.
1307 * Returns: @val converted to big-endian
1312 * @val: a #gint64 value in host byte order
1314 * Converts a #gint64 value from host byte order to little-endian.
1316 * Returns: @val converted to little-endian
1321 * @val: a #guint64 value in big-endian byte order
1323 * Converts a #guint64 value from big-endian to host byte order.
1325 * Returns: @val converted to host byte order
1330 * @val: a #guint64 value in little-endian byte order
1332 * Converts a #guint64 value from little-endian to host byte order.
1334 * Returns: @val converted to host byte order
1339 * @val: a #guint64 value in host byte order
1341 * Converts a #guint64 value from host byte order to big-endian.
1343 * Returns: @val converted to big-endian
1348 * @val: a #guint64 value in host byte order
1350 * Converts a #guint64 value from host byte order to little-endian.
1352 * Returns: @val converted to little-endian
1356 * GUINT16_SWAP_BE_PDP:
1357 * @val: a #guint16 value in big-endian or pdp-endian byte order
1359 * Converts a #guint16 value between big-endian and pdp-endian byte order.
1360 * The conversion is symmetric so it can be used both ways.
1362 * Returns: @val converted to the opposite byte order
1366 * GUINT16_SWAP_LE_BE:
1367 * @val: a #guint16 value in little-endian or big-endian byte order
1369 * Converts a #guint16 value between little-endian and big-endian byte order.
1370 * The conversion is symmetric so it can be used both ways.
1372 * Returns: @val converted to the opposite byte order
1376 * GUINT16_SWAP_LE_PDP:
1377 * @val: a #guint16 value in little-endian or pdp-endian byte order
1379 * Converts a #guint16 value between little-endian and pdp-endian byte order.
1380 * The conversion is symmetric so it can be used both ways.
1382 * Returns: @val converted to the opposite byte order
1386 * GUINT32_SWAP_BE_PDP:
1387 * @val: a #guint32 value in big-endian or pdp-endian byte order
1389 * Converts a #guint32 value between big-endian and pdp-endian byte order.
1390 * The conversion is symmetric so it can be used both ways.
1392 * Returns: @val converted to the opposite byte order
1396 * GUINT32_SWAP_LE_BE:
1397 * @val: a #guint32 value in little-endian or big-endian byte order
1399 * Converts a #guint32 value between little-endian and big-endian byte order.
1400 * The conversion is symmetric so it can be used both ways.
1402 * Returns: @val converted to the opposite byte order
1406 * GUINT32_SWAP_LE_PDP:
1407 * @val: a #guint32 value in little-endian or pdp-endian byte order
1409 * Converts a #guint32 value between little-endian and pdp-endian byte order.
1410 * The conversion is symmetric so it can be used both ways.
1412 * Returns: @val converted to the opposite byte order
1416 * GUINT64_SWAP_LE_BE:
1417 * @val: a #guint64 value in little-endian or big-endian byte order
1419 * Converts a #guint64 value between little-endian and big-endian byte order.
1420 * The conversion is symmetric so it can be used both ways.
1422 * Returns: @val converted to the opposite byte order
1425 /* Numerical Definitions {{{1 */
1429 * @title: Numerical Definitions
1430 * @short_description: mathematical constants, and floating point decomposition
1432 * GLib offers mathematical constants such as #G_PI for the value of pi;
1433 * many platforms have these in the C library, but some don't, the GLib
1434 * versions always exist.
1436 * The #GFloatIEEE754 and #GDoubleIEEE754 unions are used to access the
1437 * sign, mantissa and exponent of IEEE floats and doubles. These unions are
1438 * defined as appropriate for a given platform. IEEE floats and doubles are
1439 * supported (used for storage) by at least Intel, PPC and Sparc. See
1440 * <ulink url="http://en.wikipedia.org/wiki/IEEE_float">IEEE 754-2008</ulink>
1441 * for more information about IEEE number formats.
1445 * G_IEEE754_FLOAT_BIAS:
1447 * The bias by which exponents in single-precision floats are offset.
1451 * G_IEEE754_DOUBLE_BIAS:
1453 * The bias by which exponents in double-precision floats are offset.
1458 * @v_float: the double value
1460 * The #GFloatIEEE754 and #GDoubleIEEE754 unions are used to access the sign,
1461 * mantissa and exponent of IEEE floats and doubles. These unions are defined
1462 * as appropriate for a given platform. IEEE floats and doubles are supported
1463 * (used for storage) by at least Intel, PPC and Sparc.
1468 * @v_double: the double value
1470 * The #GFloatIEEE754 and #GDoubleIEEE754 unions are used to access the sign,
1471 * mantissa and exponent of IEEE floats and doubles. These unions are defined
1472 * as appropriate for a given platform. IEEE floats and doubles are supported
1473 * (used for storage) by at least Intel, PPC and Sparc.
1479 * The base of natural logarithms.
1485 * The natural logarithm of 2.
1491 * The natural logarithm of 10.
1497 * The value of pi (ratio of circle's circumference to its diameter).
1515 * The square root of two.
1521 * Multiplying the base 2 exponent by this number yields the base 10 exponent.
1528 * @title: Standard Macros
1529 * @short_description: commonly-used macros
1531 * These macros provide a few commonly-used features.
1537 * This macro is defined only on Windows. So you can bracket
1538 * Windows-specific code in "#ifdef G_OS_WIN32".
1544 * This macro is defined only on UNIX. So you can bracket
1545 * UNIX-specific code in "#ifdef G_OS_UNIX".
1551 * The directory separator character.
1552 * This is '/' on UNIX machines and '\' under Windows.
1556 * G_DIR_SEPARATOR_S:
1558 * The directory separator as a string.
1559 * This is "/" on UNIX machines and "\" under Windows.
1563 * G_IS_DIR_SEPARATOR:
1566 * Checks whether a character is a directory
1567 * separator. It returns %TRUE for '/' on UNIX
1568 * machines and for '\' or '/' under Windows.
1574 * G_SEARCHPATH_SEPARATOR:
1576 * The search path separator character.
1577 * This is ':' on UNIX machines and ';' under Windows.
1581 * G_SEARCHPATH_SEPARATOR_S:
1583 * The search path separator as a string.
1584 * This is ":" on UNIX machines and ";" under Windows.
1590 * Defines the %TRUE value for the #gboolean type.
1596 * Defines the %FALSE value for the #gboolean type.
1602 * Defines the standard %NULL pointer.
1607 * @a: a numeric value
1608 * @b: a numeric value
1610 * Calculates the minimum of @a and @b.
1612 * Returns: the minimum of @a and @b.
1617 * @a: a numeric value
1618 * @b: a numeric value
1620 * Calculates the maximum of @a and @b.
1622 * Returns: the maximum of @a and @b.
1627 * @a: a numeric value
1629 * Calculates the absolute value of @a.
1630 * The absolute value is simply the number with any negative sign taken away.
1634 * - ABS(10) is also 10.
1636 * Returns: the absolute value of @a.
1641 * @x: the value to clamp
1642 * @low: the minimum value allowed
1643 * @high: the maximum value allowed
1645 * Ensures that @x is between the limits set by @low and @high. If @low is
1646 * greater than @high the result is undefined.
1649 * - CLAMP(5, 10, 15) is 10.
1650 * - CLAMP(15, 5, 10) is 10.
1651 * - CLAMP(20, 15, 25) is 20.
1653 * Returns: the value of @x clamped to the range between @low and @high
1658 * @member_type: the type of the struct field
1659 * @struct_p: a pointer to a struct
1660 * @struct_offset: the offset of the field from the start of the struct,
1663 * Returns a member of a structure at a given offset, using the given type.
1665 * Returns: the struct member
1669 * G_STRUCT_MEMBER_P:
1670 * @struct_p: a pointer to a struct
1671 * @struct_offset: the offset from the start of the struct, in bytes
1673 * Returns an untyped pointer to a given offset of a struct.
1675 * Returns: an untyped pointer to @struct_p plus @struct_offset bytes
1680 * @struct_type: a structure type, e.g. #GtkWidget
1681 * @member: a field in the structure, e.g. @window
1683 * Returns the offset, in bytes, of a member of a struct.
1685 * Returns: the offset of @member from the start of @struct_type
1691 * If <literal>G_DISABLE_CONST_RETURNS</literal> is defined, this macro expands
1692 * to nothing. By default, the macro expands to <literal>const</literal>.
1693 * The macro should be used in place of <literal>const</literal> for
1694 * functions that return a value that should not be modified. The
1695 * purpose of this macro is to allow us to turn on <literal>const</literal>
1696 * for returned constant strings by default, while allowing programmers
1697 * who find that annoying to turn it off. This macro should only be used
1698 * for return values and for <emphasis>out</emphasis> parameters, it doesn't
1699 * make sense for <emphasis>in</emphasis> parameters.
1701 * Deprecated: 2.30: API providers should replace all existing uses with
1702 * <literal>const</literal> and API consumers should adjust their code
1710 * Determines the number of elements in an array. The array must be
1711 * declared so the compiler knows its size at compile-time; this
1712 * macro will not work on an array allocated on the heap, only static
1713 * arrays or arrays on the stack.
1716 /* Miscellaneous Macros {{{1 */
1719 * SECTION:macros_misc
1720 * @title: Miscellaneous Macros
1721 * @short_description: specialized macros which are not used often
1723 * These macros provide more specialized features which are not
1724 * needed so often by application programmers.
1730 * This macro is used to export function prototypes so they can be linked
1731 * with an external version when no inlining is performed. The file which
1732 * implements the functions should define <literal>G_IMPLEMENTS_INLINES</literal>
1733 * before including the headers which contain %G_INLINE_FUNC declarations.
1734 * Since inlining is very compiler-dependent using these macros correctly
1735 * is very difficult. Their use is strongly discouraged.
1737 * This macro is often mistaken for a replacement for the inline keyword;
1738 * inline is already declared in a portable manner in the GLib headers
1739 * and can be used normally.
1745 * Used within multi-statement macros so that they can be used in places
1746 * where only one statement is expected by the compiler.
1752 * Used within multi-statement macros so that they can be used in places
1753 * where only one statement is expected by the compiler.
1759 * Used (along with #G_END_DECLS) to bracket header files. If the
1760 * compiler in use is a C++ compiler, adds <literal>extern "C"</literal>
1761 * around the header.
1767 * Used (along with #G_BEGIN_DECLS) to bracket header files. If the
1768 * compiler in use is a C++ compiler, adds <literal>extern "C"</literal>
1769 * around the header.
1774 * @ap1: the va_list variable to place a copy of @ap2 in
1777 * Portable way to copy va_list variables.
1779 * In order to use this function, you must include string.h yourself,
1780 * because this macro may use memmove() and GLib does not include
1786 * @macro_or_string: a macro or a string
1788 * Accepts a macro or a string and converts it into a string after
1789 * preprocessor argument expansion. For example, the following code:
1793 * const gchar *greeting = G_STRINGIFY (AGE) " today!";
1796 * is transformed by the preprocessor into (code equivalent to):
1799 * const gchar *greeting = "27 today!";
1805 * @identifier1: an identifier
1806 * @identifier2: an identifier
1808 * Yields a new preprocessor pasted identifier
1809 * <code>identifier1identifier2</code> from its expanded
1810 * arguments @identifier1 and @identifier2. For example,
1811 * the following code:
1813 * #define GET(traveller,method) G_PASTE(traveller_get_, method) (traveller)
1814 * const gchar *name = GET (traveller, name);
1815 * const gchar *quest = GET (traveller, quest);
1816 * GdkColor *favourite = GET (traveller, favourite_colour);
1819 * is transformed by the preprocessor into:
1821 * const gchar *name = traveller_get_name (traveller);
1822 * const gchar *quest = traveller_get_quest (traveller);
1823 * GdkColor *favourite = traveller_get_favourite_colour (traveller);
1831 * @expr: a constant expression
1833 * The G_STATIC_ASSERT macro lets the programmer check
1834 * a condition at compile time, the condition needs to
1835 * be compile time computable. The macro can be used in
1836 * any place where a <literal>typedef</literal> is valid.
1839 * A <literal>typedef</literal> is generally allowed in
1840 * exactly the same places that a variable declaration is
1841 * allowed. For this reason, you should not use
1842 * <literal>G_STATIC_ASSERT</literal> in the middle of
1846 * The macro should only be used once per source code line.
1852 * G_STATIC_ASSERT_EXPR:
1853 * @expr: a constant expression
1855 * The G_STATIC_ASSERT_EXPR macro lets the programmer check
1856 * a condition at compile time. The condition needs to be
1857 * compile time computable.
1859 * Unlike <literal>G_STATIC_ASSERT</literal>, this macro
1860 * evaluates to an expression and, as such, can be used in
1861 * the middle of other expressions. Its value should be
1862 * ignored. This can be accomplished by placing it as
1863 * the first argument of a comma expression.
1866 * #define ADD_ONE_TO_INT(x) \
1867 * (G_STATIC_ASSERT_EXPR(sizeof (x) == sizeof (int)), ((x) + 1))
1876 * Expands to <literal>__extension__</literal> when <command>gcc</command>
1877 * is used as the compiler. This simply tells <command>gcc</command> not
1878 * to warn about the following non-standard code when compiling with the
1879 * <option>-pedantic</option> option.
1885 * Expands to the GNU C <literal>const</literal> function attribute if
1886 * the compiler is <command>gcc</command>. Declaring a function as const
1887 * enables better optimization of calls to the function. A const function
1888 * doesn't examine any values except its parameters, and has no effects
1889 * except its return value.
1891 * Place the attribute after the declaration, just before the semicolon.
1893 * See the GNU C documentation for more details.
1896 * A function that has pointer arguments and examines the data pointed to
1897 * must <emphasis>not</emphasis> be declared const. Likewise, a function
1898 * that calls a non-const function usually must not be const. It doesn't
1899 * make sense for a const function to return void.
1906 * Expands to the GNU C <literal>pure</literal> function attribute if the
1907 * compiler is <command>gcc</command>. Declaring a function as pure enables
1908 * better optimization of calls to the function. A pure function has no
1909 * effects except its return value and the return value depends only on
1910 * the parameters and/or global variables.
1912 * Place the attribute after the declaration, just before the semicolon.
1914 * See the GNU C documentation for more details.
1920 * Expands to the GNU C <literal>malloc</literal> function attribute if the
1921 * compiler is <command>gcc</command>. Declaring a function as malloc enables
1922 * better optimization of the function. A function can have the malloc
1923 * attribute if it returns a pointer which is guaranteed to not alias with
1924 * any other pointer when the function returns (in practice, this means newly
1925 * allocated memory).
1927 * Place the attribute after the declaration, just before the semicolon.
1929 * See the GNU C documentation for more details.
1935 * G_GNUC_ALLOC_SIZE:
1936 * @x: the index of the argument specifying the allocation size
1938 * Expands to the GNU C <literal>alloc_size</literal> function attribute
1939 * if the compiler is a new enough <command>gcc</command>. This attribute
1940 * tells the compiler that the function returns a pointer to memory of a
1941 * size that is specified by the @x<!-- -->th function parameter.
1943 * Place the attribute after the function declaration, just before the
1946 * See the GNU C documentation for more details.
1952 * G_GNUC_ALLOC_SIZE2:
1953 * @x: the index of the argument specifying one factor of the allocation size
1954 * @y: the index of the argument specifying the second factor of the allocation size
1956 * Expands to the GNU C <literal>alloc_size</literal> function attribute
1957 * if the compiler is a new enough <command>gcc</command>. This attribute
1958 * tells the compiler that the function returns a pointer to memory of a
1959 * size that is specified by the product of two function parameters.
1961 * Place the attribute after the function declaration, just before the
1964 * See the GNU C documentation for more details.
1970 * G_GNUC_DEPRECATED:
1972 * Expands to the GNU C <literal>deprecated</literal> attribute if the
1973 * compiler is <command>gcc</command>. It can be used to mark typedefs,
1974 * variables and functions as deprecated. When called with the
1975 * <option>-Wdeprecated-declarations</option> option, the compiler will
1976 * generate warnings when deprecated interfaces are used.
1978 * Place the attribute after the declaration, just before the semicolon.
1980 * See the GNU C documentation for more details.
1986 * G_GNUC_DEPRECATED_FOR:
1987 * @f: the intended replacement for the deprecated symbol,
1988 * such as the name of a function
1990 * Like %G_GNUC_DEPRECATED, but names the intended replacement for the
1991 * deprecated symbol if the version of <command>gcc</command> in use is
1992 * new enough to support custom deprecation messages.
1994 * Place the attribute after the declaration, just before the semicolon.
1996 * See the GNU C documentation for more details.
1998 * Note that if @f is a macro, it will be expanded in the warning message.
1999 * You can enclose it in quotes to prevent this. (The quotes will show up
2000 * in the warning, but it's better than showing the macro expansion.)
2006 * G_GNUC_BEGIN_IGNORE_DEPRECATIONS:
2008 * Tells <command>gcc</command> (if it is a new enough version) to
2009 * temporarily stop emitting warnings when functions marked with
2010 * %G_GNUC_DEPRECATED or %G_GNUC_DEPRECATED_FOR are called. This is
2011 * useful for when you have one deprecated function calling another
2012 * one, or when you still have regression tests for deprecated
2015 * Use %G_GNUC_END_IGNORE_DEPRECATIONS to begin warning again. (If you
2016 * are not compiling with <literal>-Wdeprecated-declarations</literal>
2017 * then neither macro has any effect.)
2019 * This macro can be used either inside or outside of a function body,
2020 * but must appear on a line by itself.
2026 * G_GNUC_END_IGNORE_DEPRECATIONS:
2028 * Undoes the effect of %G_GNUC_BEGIN_IGNORE_DEPRECATIONS, telling
2029 * <command>gcc</command> to begin outputting warnings again
2030 * (assuming those warnings had been enabled to begin with).
2032 * This macro can be used either inside or outside of a function body,
2033 * but must appear on a line by itself.
2041 * This macro is similar to %G_GNUC_DEPRECATED, and can be used to mark
2042 * functions declarations as deprecated. Unlike %G_GNUC_DEPRECATED, it is
2043 * meant to be portable across different compilers and must be placed
2044 * before the function declaration.
2051 * @f: the name of the function that this function was deprecated for
2053 * This macro is similar to %G_GNUC_DEPRECATED_FOR, and can be used to mark
2054 * functions declarations as deprecated. Unlike %G_GNUC_DEPRECATED_FOR, it is
2055 * meant to be portable across different compilers and must be placed
2056 * before the function declaration.
2063 * @maj: the major version that introduced the symbol
2064 * @min: the minor version that introduced the symbol
2066 * This macro can be used to mark a function declaration as unavailable.
2067 * It must be placed before the function declaration. Use of a function
2068 * that has been annotated with this macros will produce a compiler warning.
2074 * GLIB_DISABLE_DEPRECATION_WARNINGS:
2076 * A macro that should be defined before including the glib.h header.
2077 * If it is defined, no compiler warnings will be produced for uses
2078 * of deprecated GLib APIs.
2084 * Expands to the GNU C <literal>noreturn</literal> function attribute
2085 * if the compiler is <command>gcc</command>. It is used for declaring
2086 * functions which never return. It enables optimization of the function,
2087 * and avoids possible compiler warnings.
2089 * Place the attribute after the declaration, just before the semicolon.
2091 * See the GNU C documentation for more details.
2097 * Expands to the GNU C <literal>unused</literal> function attribute if
2098 * the compiler is <command>gcc</command>. It is used for declaring
2099 * functions and arguments which may never be used. It avoids possible compiler
2102 * For functions, place the attribute after the declaration, just before the
2103 * semicolon. For arguments, place the attribute at the beginning of the
2104 * argument declaration.
2107 * void my_unused_function (G_GNUC_UNUSED gint unused_argument,
2108 * gint other_argument) G_GNUC_UNUSED;
2111 * See the GNU C documentation for more details.
2116 * @format_idx: the index of the argument corresponding to the
2117 * format string (The arguments are numbered from 1)
2118 * @arg_idx: the index of the first of the format arguments
2120 * Expands to the GNU C <literal>format</literal> function attribute
2121 * if the compiler is <command>gcc</command>. This is used for declaring
2122 * functions which take a variable number of arguments, with the same
2123 * syntax as printf(). It allows the compiler to type-check the arguments
2124 * passed to the function.
2126 * Place the attribute after the function declaration, just before the
2129 * See the GNU C documentation for more details.
2132 * gint g_snprintf (gchar *string,
2134 * gchar const *format,
2135 * ...) G_GNUC_PRINTF (3, 4);
2141 * @format_idx: the index of the argument corresponding to
2142 * the format string (The arguments are numbered from 1)
2143 * @arg_idx: the index of the first of the format arguments
2145 * Expands to the GNU C <literal>format</literal> function attribute
2146 * if the compiler is <command>gcc</command>. This is used for declaring
2147 * functions which take a variable number of arguments, with the same
2148 * syntax as scanf(). It allows the compiler to type-check the arguments
2149 * passed to the function. See the GNU C documentation for details.
2154 * @arg_idx: the index of the argument
2156 * Expands to the GNU C <literal>format_arg</literal> function attribute
2157 * if the compiler is <command>gcc</command>. This function attribute
2158 * specifies that a function takes a format string for a printf(),
2159 * scanf(), strftime() or strfmon() style function and modifies it,
2160 * so that the result can be passed to a printf(), scanf(), strftime()
2161 * or strfmon() style function (with the remaining arguments to the
2162 * format function the same as they would have been for the unmodified
2165 * Place the attribute after the function declaration, just before the
2168 * See the GNU C documentation for more details.
2171 * gchar *g_dgettext (gchar *domain_name, gchar *msgid) G_GNUC_FORMAT (2);
2176 * G_GNUC_NULL_TERMINATED:
2178 * Expands to the GNU C <literal>sentinel</literal> function attribute
2179 * if the compiler is <command>gcc</command>, or "" if it isn't. This
2180 * function attribute only applies to variadic functions and instructs
2181 * the compiler to check that the argument list is terminated with an
2184 * Place the attribute after the declaration, just before the semicolon.
2186 * See the GNU C documentation for more details.
2192 * G_GNUC_WARN_UNUSED_RESULT:
2194 * Expands to the GNU C <literal>warn_unused_result</literal> function
2195 * attribute if the compiler is <command>gcc</command>, or "" if it isn't.
2196 * This function attribute makes the compiler emit a warning if the result
2197 * of a function call is ignored.
2199 * Place the attribute after the declaration, just before the semicolon.
2201 * See the GNU C documentation for more details.
2209 * Expands to "" on all modern compilers, and to
2210 * <literal>__FUNCTION__</literal> on <command>gcc</command> version 2.x.
2213 * Deprecated: 2.16: Use #G_STRFUNC instead
2217 * G_GNUC_PRETTY_FUNCTION:
2219 * Expands to "" on all modern compilers, and to
2220 * <literal>__PRETTY_FUNCTION__</literal> on <command>gcc</command>
2221 * version 2.x. Don't use it.
2223 * Deprecated: 2.16: Use #G_STRFUNC instead
2227 * G_GNUC_NO_INSTRUMENT:
2229 * Expands to the GNU C <literal>no_instrument_function</literal> function
2230 * attribute if the compiler is <command>gcc</command>. Functions with this
2231 * attribute will not be instrumented for profiling, when the compiler is
2232 * called with the <option>-finstrument-functions</option> option.
2234 * Place the attribute after the declaration, just before the semicolon.
2236 * See the GNU C documentation for more details.
2242 * This attribute can be used for marking library functions as being used
2243 * internally to the library only, which may allow the compiler to handle
2244 * function calls more efficiently. Note that static functions do not need
2245 * to be marked as internal in this way. See the GNU C documentation for
2248 * When using a compiler that supports the GNU C hidden visibility attribute,
2249 * this macro expands to <literal>__attribute__((visibility("hidden")))</literal>.
2250 * When using the Sun Studio compiler, it expands to <literal>__hidden</literal>.
2252 * Note that for portability, the attribute should be placed before the
2253 * function declaration. While GCC allows the macro after the declaration,
2254 * Sun Studio does not.
2258 * void _g_log_fallback_handler (const gchar *log_domain,
2259 * GLogLevelFlags log_level,
2260 * const gchar *message,
2261 * gpointer unused_data);
2270 * Expands to the GNU C <literal>may_alias</literal> type attribute
2271 * if the compiler is <command>gcc</command>. Types with this attribute
2272 * will not be subjected to type-based alias analysis, but are assumed
2273 * to alias with any other type, just like char.
2274 * See the GNU C documentation for details.
2281 * @expr: the expression
2283 * Hints the compiler that the expression is likely to evaluate to
2284 * a true value. The compiler may use this information for optimizations.
2287 * if (G_LIKELY (random () != 1))
2288 * g_print ("not one");
2291 * Returns: the value of @expr
2298 * @expr: the expression
2300 * Hints the compiler that the expression is unlikely to evaluate to
2301 * a true value. The compiler may use this information for optimizations.
2304 * if (G_UNLIKELY (random () == 1))
2305 * g_print ("a random one");
2308 * Returns: the value of @expr
2316 * Expands to a string identifying the current code position.
2322 * Expands to a string identifying the current function.
2327 /* Windows Compatibility Functions {{{1 */
2331 * @title: Windows Compatibility Functions
2332 * @short_description: UNIX emulation on Windows
2334 * These functions provide some level of UNIX emulation on the
2335 * Windows platform. If your application really needs the POSIX
2336 * APIs, we suggest you try the Cygwin project.
2342 * Provided for UNIX emulation on Windows; equivalent to UNIX
2343 * macro %MAXPATHLEN, which is the maximum length of a filename
2344 * (including full path).
2348 * G_WIN32_DLLMAIN_FOR_DLL_NAME:
2349 * @static: empty or "static"
2350 * @dll_name: the name of the (pointer to the) char array where
2351 * the DLL name will be stored. If this is used, you must also
2352 * include <filename>windows.h</filename>. If you need a more
2353 * complex DLL entry point function, you cannot use this
2355 * On Windows, this macro defines a DllMain() function that stores
2356 * the actual DLL name that the code being compiled will be included in.
2358 * On non-Windows platforms, expands to nothing.
2362 * G_WIN32_HAVE_WIDECHAR_API:
2364 * On Windows, this macro defines an expression which evaluates to
2365 * %TRUE if the code is running on a version of Windows where the wide
2366 * character versions of the Win32 API functions, and the wide character
2367 * versions of the C library functions work. (They are always present in
2368 * the DLLs, but don't work on Windows 9x and Me.)
2370 * On non-Windows platforms, it is not defined.
2377 * G_WIN32_IS_NT_BASED:
2379 * On Windows, this macro defines an expression which evaluates to
2380 * %TRUE if the code is running on an NT-based Windows operating system.
2382 * On non-Windows platforms, it is not defined.
2388 /* vim: set foldmethod=marker: */