├── glib ├── tests │ ├── empty │ ├── bookmarks │ │ ├── fail-01.xbel │ │ ├── fail-02.xbel │ │ ├── fail-03.xbel │ │ ├── valid-02.xbel │ │ ├── fail-08.xbel │ │ ├── fail-09.xbel │ │ ├── fail-04.xbel │ │ ├── fail-06.xbel │ │ ├── fail-07.xbel │ │ ├── fail-10.xbel │ │ ├── fail-05.xbel │ │ ├── fail-13.xbel │ │ ├── valid-01.xbel │ │ ├── fail-17.xbel │ │ ├── fail-11.xbel │ │ ├── fail-12.xbel │ │ ├── fail-15.xbel │ │ ├── fail-14.xbel │ │ ├── fail-16.xbel │ │ └── valid-03.xbel │ ├── markups │ │ ├── fail-1.gmarkup │ │ ├── fail-17.gmarkup │ │ ├── fail-4.gmarkup │ │ ├── fail-12.gmarkup │ │ ├── fail-13.gmarkup │ │ ├── fail-16.gmarkup │ │ ├── fail-18.gmarkup │ │ ├── fail-19.gmarkup │ │ ├── fail-20.gmarkup │ │ ├── fail-22.gmarkup │ │ ├── fail-14.gmarkup │ │ ├── fail-21.gmarkup │ │ ├── fail-23.gmarkup │ │ ├── fail-26.gmarkup │ │ ├── fail-27.gmarkup │ │ ├── fail-33.gmarkup │ │ ├── fail-37.gmarkup │ │ ├── fail-44.gmarkup │ │ ├── fail-10.gmarkup │ │ ├── fail-28.gmarkup │ │ ├── fail-29.gmarkup │ │ ├── fail-34.gmarkup │ │ ├── fail-45.gmarkup │ │ ├── fail-46.gmarkup │ │ ├── fail-49.gmarkup │ │ ├── fail-6.gmarkup │ │ ├── fail-8.gmarkup │ │ ├── fail-32.gmarkup │ │ ├── fail-35.gmarkup │ │ ├── fail-38.gmarkup │ │ ├── fail-39.gmarkup │ │ ├── fail-5.gmarkup │ │ ├── fail-15.gmarkup │ │ ├── fail-43.gmarkup │ │ ├── fail-47.gmarkup │ │ ├── fail-7.gmarkup │ │ ├── fail-9.gmarkup │ │ ├── valid-11.gmarkup │ │ ├── valid-9.gmarkup │ │ ├── fail-25.gmarkup │ │ ├── valid-15.gmarkup │ │ ├── fail-11.gmarkup │ │ ├── fail-30.gmarkup │ │ ├── fail-40.gmarkup │ │ ├── fail-48.gmarkup │ │ ├── valid-12.gmarkup │ │ ├── valid-7.gmarkup │ │ ├── fail-24.gmarkup │ │ ├── fail-36.gmarkup │ │ ├── valid-13.gmarkup │ │ ├── valid-5.gmarkup │ │ ├── valid-8.gmarkup │ │ ├── fail-42.gmarkup │ │ ├── valid-11.expected │ │ ├── valid-9.expected │ │ ├── fail-31.gmarkup │ │ ├── valid-15.expected │ │ ├── fail-5.expected │ │ ├── fail-6.expected │ │ ├── fail-7.expected │ │ ├── valid-12.expected │ │ ├── valid-13.expected │ │ ├── valid-6.gmarkup │ │ ├── fail-27.expected │ │ ├── fail-28.expected │ │ ├── fail-29.expected │ │ ├── valid-7.expected │ │ ├── fail-1.expected │ │ ├── fail-2.expected │ │ ├── fail-2.gmarkup │ │ ├── fail-3.expected │ │ ├── fail-3.gmarkup │ │ ├── fail-4.expected │ │ ├── fail-41.gmarkup │ │ ├── valid-10.gmarkup │ │ ├── valid-5.expected │ │ ├── fail-17.expected │ │ ├── fail-18.expected │ │ ├── fail-41.expected │ │ ├── fail-12.expected │ │ ├── fail-13.expected │ │ ├── fail-19.expected │ │ ├── fail-40.expected │ │ ├── fail-21.expected │ │ ├── valid-10.expected │ │ ├── fail-24.expected │ │ ├── fail-25.expected │ │ ├── fail-32.expected │ │ ├── valid-8.expected │ │ ├── fail-43.expected │ │ ├── fail-48.expected │ │ ├── valid-6.expected │ │ ├── valid-4.gmarkup │ │ ├── fail-23.expected │ │ ├── fail-26.expected │ │ ├── fail-37.expected │ │ ├── fail-20.expected │ │ ├── fail-36.expected │ │ ├── fail-44.expected │ │ ├── fail-49.expected │ │ ├── fail-8.expected │ │ ├── fail-10.expected │ │ ├── fail-14.expected │ │ ├── fail-16.expected │ │ ├── fail-22.expected │ │ ├── fail-46.expected │ │ ├── fail-9.expected │ │ ├── fail-38.expected │ │ ├── fail-47.expected │ │ ├── fail-39.expected │ │ ├── fail-45.expected │ │ ├── fail-42.expected │ │ ├── fail-11.expected │ │ ├── fail-33.expected │ │ ├── valid-16.gmarkup │ │ ├── fail-30.expected │ │ ├── fail-35.expected │ │ ├── fail-34.expected │ │ ├── fail-15.expected │ │ ├── fail-31.expected │ │ ├── valid-3.gmarkup │ │ ├── valid-4.expected │ │ ├── valid-1.gmarkup │ │ ├── valid-16.expected │ │ ├── valid-1.expected │ │ ├── valid-3.expected │ │ ├── valid-14.gmarkup │ │ ├── valid-14.expected │ │ ├── valid-2.gmarkup │ │ └── valid-2.expected │ ├── echo-script │ ├── echo-script.bat │ ├── keyfiletest.ini │ ├── include.c │ ├── bitlock.c │ ├── bookmarks.xbel │ ├── dir.c │ ├── test-spawn-echo.c │ ├── option-argv0.c │ ├── search-utils.c │ ├── 642026.c │ ├── hook.c │ ├── timeout.c │ ├── error.c │ └── markup.c ├── glib.rc ├── glib.rc.in ├── pcre │ ├── COPYING │ ├── makefile.msc │ └── Makefile.am ├── update-pcre │ ├── Makefile.am │ └── memory.patch ├── glib-Prefix.pch ├── libglib-gdb.py.in ├── glib-mirroring-tab │ ├── Makefile │ └── packtab.h ├── gnulib │ ├── makefile.msc │ ├── Makefile.am │ ├── README │ ├── asnprintf.c │ ├── g-gnulib.h │ ├── printf.h │ ├── printf-parse.h │ └── vasnprintf.h ├── glib_probes.d ├── libcharset │ ├── update.sh │ ├── codeset.m4 │ ├── make-patch.sh │ ├── glibc21.m4 │ ├── ref-del.sin │ ├── ref-add.sin │ ├── README │ ├── localcharset.h │ ├── libcharset.h │ ├── Makefile.am │ └── libcharset-glib.patch ├── gcharsetprivate.h ├── gasyncqueueprivate.h ├── gunicodeprivate.h ├── gmain-internal.h ├── gen-iswide-table.py ├── glib-init.h ├── gi18n.h ├── gwakeup.h ├── glib_trace.h ├── gi18n-lib.h ├── gcharset.h ├── glibintl.h ├── glib-object.h ├── glib-private.c ├── ghostutils.h ├── gdatasetprivate.h ├── gqsort.h ├── gvariant-core.h ├── gprimes.h ├── gprintfint.h ├── gpattern.h ├── gshell.h ├── gvariant-internal.h ├── gversion.h ├── gprintf.h ├── gmappedfile.h ├── gdir.h ├── gstringchunk.h ├── gunibreak.c ├── gthreadprivate.h ├── gprimes.c ├── gbase64.h ├── ggettext.h ├── gtimer.h ├── gbacktrace.h ├── gen-script-table.pl ├── glib-private.h ├── gquark.h ├── gurifuncs.h ├── gtrashstack.c ├── deprecated │ └── gcache.h ├── genviron.h └── gbitlock.h ├── glibTests ├── en.lproj │ └── InfoPlist.strings ├── glibTests.m └── glibTests-Info.plist ├── gthread ├── gthread.rc ├── gthread.def ├── gthread.rc.in ├── .libs │ └── libgthread_2_0_la-gthread-impl.o ├── libgthread_2_0_la-gthread-impl.lo ├── makefile.msc ├── makefile.msc.in └── gthread-impl.c ├── glib.xcodeproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── .gitignore ├── README └── AUTHORS /glib/tests/empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /glib/tests/bookmarks/fail-01.xbel: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-1.gmarkup: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /glib/tests/echo-script: -------------------------------------------------------------------------------- 1 | echo "echo" 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-17.gmarkup: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-13.gmarkup: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-16.gmarkup: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-14.gmarkup: -------------------------------------------------------------------------------- 1 | 2 | < -------------------------------------------------------------------------------- /glib/tests/markups/fail-21.gmarkup: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-47.gmarkup: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-7.gmarkup: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-9.gmarkup: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /glib/tests/markups/valid-11.gmarkup: -------------------------------------------------------------------------------- 1 | data 3 | -------------------------------------------------------------------------------- /glib/tests/markups/valid-9.gmarkup: -------------------------------------------------------------------------------- 1 | data 3 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-25.gmarkup: -------------------------------------------------------------------------------- 1 | <bla>bla 2 | -------------------------------------------------------------------------------- /glib/glib.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gugu/glib-ios/HEAD/glib/glib.rc -------------------------------------------------------------------------------- /glib/tests/markups/fail-11.gmarkup: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-30.gmarkup: -------------------------------------------------------------------------------- 1 | &sdfkljsdsdfsdfsdfsdf 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-40.gmarkup: -------------------------------------------------------------------------------- 1 | &unknownentityname; 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-48.gmarkup: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /glib/tests/markups/valid-12.gmarkup: -------------------------------------------------------------------------------- 1 | 2 | abcäöü 3 | 4 | -------------------------------------------------------------------------------- /glib/tests/markups/valid-7.gmarkup: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-24.gmarkup: -------------------------------------------------------------------------------- 1 | ' 2 | ELEMENT 'foo' 3 | TEXT '' 4 | END 'foo' 5 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-1.expected: -------------------------------------------------------------------------------- 1 | ERROR Error on line 1 char 1: Document was empty or contained only whitespace 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-2.expected: -------------------------------------------------------------------------------- 1 | ERROR Error on line 1 char 1: Document must begin with an element (e.g. ) 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-2.gmarkup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gugu/glib-ios/HEAD/glib/tests/markups/fail-2.gmarkup -------------------------------------------------------------------------------- /glib/tests/markups/fail-3.expected: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gugu/glib-ios/HEAD/glib/tests/markups/fail-3.expected -------------------------------------------------------------------------------- /glib/tests/markups/fail-3.gmarkup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gugu/glib-ios/HEAD/glib/tests/markups/fail-3.gmarkup -------------------------------------------------------------------------------- /glib/tests/markups/fail-4.expected: -------------------------------------------------------------------------------- 1 | ERROR Error on line 1 char 1: Document must begin with an element (e.g. ) 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-41.gmarkup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gugu/glib-ios/HEAD/glib/tests/markups/fail-41.gmarkup -------------------------------------------------------------------------------- /glib/tests/markups/valid-10.gmarkup: -------------------------------------------------------------------------------- 1 | data 7 | -------------------------------------------------------------------------------- /glib/tests/markups/valid-5.expected: -------------------------------------------------------------------------------- 1 | PASS '' 2 | ELEMENT 'foo' 3 | TEXT '' 4 | END 'foo' 5 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-17.expected: -------------------------------------------------------------------------------- 1 | ERROR Error on line 1 char 4: Document ended unexpectedly inside an element name 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-18.expected: -------------------------------------------------------------------------------- 1 | ERROR Error on line 1 char 9: Document ended unexpectedly inside an attribute name 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-41.expected: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gugu/glib-ios/HEAD/glib/tests/markups/fail-41.expected -------------------------------------------------------------------------------- /glib/tests/markups/fail-12.expected: -------------------------------------------------------------------------------- 1 | ERROR Error on line 1 char 6: Element 'foo' was closed, no element is currently open 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-13.expected: -------------------------------------------------------------------------------- 1 | ERROR Error on line 1 char 7: Element 'foo|' was closed, no element is currently open 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-19.expected: -------------------------------------------------------------------------------- 1 | ERROR Error on line 1 char 6: Document ended unexpectedly inside an element-opening tag. 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-40.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'bla' 2 | ERROR Error on line 1: Entity name 'unknownentityname' is not known 3 | -------------------------------------------------------------------------------- /glib/pcre/COPYING: -------------------------------------------------------------------------------- 1 | PCRE LICENCE 2 | 3 | Please see the file LICENCE in the PCRE distribution for licensing details. 4 | 5 | End 6 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-21.expected: -------------------------------------------------------------------------------- 1 | ERROR Error on line 1 char 15: Document ended unexpectedly while inside an attribute value 2 | -------------------------------------------------------------------------------- /glib/tests/markups/valid-10.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | bar="baz" 3 | bar2="baz2" 4 | bar3="baz3" 5 | TEXT 'data' 6 | END 'foo' 7 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-24.expected: -------------------------------------------------------------------------------- 1 | ERROR Error on line 1 char 44: Document ended unexpectedly inside a comment or processing instruction 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-25.expected: -------------------------------------------------------------------------------- 1 | ERROR Error on line 1 char 32: Document ended unexpectedly inside a comment or processing instruction 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-32.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | ERROR Error on line 1: Character reference '0' does not encode a permitted character 3 | -------------------------------------------------------------------------------- /glib/tests/markups/valid-8.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | TEXT '' 3 | PASS '>>> CDATA ]]>' 4 | TEXT '' 5 | END 'foo' 6 | -------------------------------------------------------------------------------- /gthread/.libs/libgthread_2_0_la-gthread-impl.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gugu/glib-ios/HEAD/gthread/.libs/libgthread_2_0_la-gthread-impl.o -------------------------------------------------------------------------------- /glib/tests/markups/fail-43.expected: -------------------------------------------------------------------------------- 1 | ERROR Error on line 1 char 10: Odd character '≈', expected a '=' after attribute name 'bar' of element 'foo' 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-48.expected: -------------------------------------------------------------------------------- 1 | ERROR Error on line 2 char 2: Odd character '>', expected a '=' after attribute name 'bar' of element 'fail' 2 | -------------------------------------------------------------------------------- /glib/tests/markups/valid-6.expected: -------------------------------------------------------------------------------- 1 | PASS ' 3 | ]>' 4 | ELEMENT 'foo' 5 | TEXT '' 6 | END 'foo' 7 | -------------------------------------------------------------------------------- /glib/update-pcre/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/glib.mk 2 | 3 | EXTRA_DIST += \ 4 | update.sh \ 5 | digitab.patch \ 6 | memory.patch 7 | -------------------------------------------------------------------------------- /glib/tests/markups/valid-4.gmarkup: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-23.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | TEXT ' 3 | ' 4 | ERROR Error on line 2 char 5: Document ended unexpectedly inside an element name 5 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-26.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | ERROR Error on line 1: Empty entity '&;' seen; valid entities are: & " < > ' 3 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-37.expected: -------------------------------------------------------------------------------- 1 | ERROR Error on line 1 char 2: ' ' is not a valid character following a '<' character; it may not begin an element name 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-20.expected: -------------------------------------------------------------------------------- 1 | ERROR Error on line 1 char 10: Document ended unexpectedly after the equals sign following an attribute name; no attribute value 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-36.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | TEXT '�' 3 | END 'foo' 4 | ERROR Error on line 2 char 1: '^$non-carriage-null-fail|' is not a valid name 5 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-44.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | ERROR Error on line 1 char 6: Odd character '≻', expected a '>' character to end the empty-element tag 'foo' 3 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-49.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | TEXT '' 3 | ERROR Error on line 2 char 2: Document ended unexpectedly inside the close tag for element 'foo' 4 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-8.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | ERROR Error on line 1 char 6: Odd character '}', expected a '>' character to end the empty-element tag 'foo' 3 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-10.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | TEXT ' 3 | ' 4 | ERROR Error on line 2 char 8: Element '|foo' was closed, but the currently open element is 'foo' 5 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-14.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | TEXT ' 3 | ' 4 | ERROR Error on line 2 char 3: Document ended unexpectedly just after an open angle bracket '<' 5 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-16.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | ERROR Error on line 1 char 6: Document ended unexpectedly, expected to see a close angle bracket ending the tag 3 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-22.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | ERROR Error on line 1 char 6: Document ended unexpectedly with elements still open - 'foo' was the last element opened 3 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-46.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | ERROR Error on line 3 char 2: Document ended unexpectedly with elements still open - 'foo' was the last element opened 3 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-9.expected: -------------------------------------------------------------------------------- 1 | ERROR Error on line 1 char 10: Odd character '{', expected an open quote mark after the equals sign when giving value for attribute 'bar' of element 'foo' 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-38.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | TEXT 'data' 3 | ERROR Error on line 1 char 11: ' ' is not a valid character following a '<' character; it may not begin an element name 4 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-47.expected: -------------------------------------------------------------------------------- 1 | ERROR Error on line 1: Failed to parse '', which should have been a digit inside a character reference (ê for example) - perhaps the digit is too large 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-39.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | TEXT 'data' 3 | ERROR Error on line 1 char 12: ' ' is not a valid character following the characters '' 4 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-42.expected: -------------------------------------------------------------------------------- 1 | ERROR Error on line 3: Entity did not end with a semicolon; most likely you used an ampersand character without intending to start an entity - escape ampersand as & 2 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-11.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | TEXT ' 3 | ' 4 | ELEMENT 'bar' 5 | TEXT ' 6 | ' 7 | ERROR Error on line 3 char 7: Element 'foo' was closed, but the currently open element is 'bar' 8 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-33.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | ERROR Error on line 1: Failed to parse '', which should have been a digit inside a character reference (ê for example) - perhaps the digit is too large 3 | -------------------------------------------------------------------------------- /glib/tests/markups/valid-16.gmarkup: -------------------------------------------------------------------------------- 1 | 2 | 3 | c1 4 | c2 5 | 6 | b1 7 | b2 8 | b3 9 | 10 | 11 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-30.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | ERROR Error on line 1: Entity did not end with a semicolon; most likely you used an ampersand character without intending to start an entity - escape ampersand as & 3 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-35.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | ERROR Error on line 1: Entity did not end with a semicolon; most likely you used an ampersand character without intending to start an entity - escape ampersand as & 3 | -------------------------------------------------------------------------------- /glib.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-34.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | ERROR Error on line 1: Character reference did not end with a semicolon; most likely you used an ampersand character without intending to start an entity - escape ampersand as & 3 | -------------------------------------------------------------------------------- /glib/glib-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #ifdef __OBJC__ 8 | #import 9 | 10 | #endif -------------------------------------------------------------------------------- /glib/tests/markups/fail-15.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | TEXT ' 3 | ' 4 | ELEMENT 'bar' 5 | TEXT ' 6 | ' 7 | END 'bar' 8 | ERROR Error on line 3 char 8: Document ended unexpectedly with elements still open - 'foo' was the last element opened 9 | -------------------------------------------------------------------------------- /glib/tests/markups/fail-31.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | ERROR Error on line 1: Failed to parse '34592348345343453453455645765736575865767', which should have been a digit inside a character reference (ê for example) - perhaps the digit is too large 3 | -------------------------------------------------------------------------------- /glib/libglib-gdb.py.in: -------------------------------------------------------------------------------- 1 | import sys 2 | import gdb 3 | 4 | # Update module path. 5 | dir_ = '@datadir@/glib-2.0/gdb' 6 | if not dir_ in sys.path: 7 | sys.path.insert(0, dir_) 8 | 9 | from glib import register 10 | register (gdb.current_objfile ()) 11 | -------------------------------------------------------------------------------- /glib/glib-mirroring-tab/Makefile: -------------------------------------------------------------------------------- 1 | 2 | CFLAGS = `pkg-config --cflags glib-2.0` 3 | LIBS = `pkg-config --libs glib-2.0` 4 | 5 | 6 | all: gen-mirroring-tab 7 | 8 | gen-mirroring-tab: gen-mirroring-tab.o packtab.o 9 | 10 | clean: 11 | $(RM) gen-mirroring-tab *.o 12 | -------------------------------------------------------------------------------- /glib/tests/markups/valid-3.gmarkup: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by http://www.gitignore.io 2 | 3 | ### Xcode ### 4 | build/ 5 | *.pbxuser 6 | !default.pbxuser 7 | *.mode1v3 8 | !default.mode1v3 9 | *.mode2v3 10 | !default.mode2v3 11 | *.perspectivev3 12 | !default.perspectivev3 13 | xcuserdata 14 | *.xccheckout 15 | *.moved-aside 16 | DerivedData 17 | *.xcuserstate 18 | 19 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | General Information 2 | =================== 3 | 4 | This is GLib-iOS version 2.40.0. GLib is the low-level core 5 | library that forms the basis for projects such as GTK+ and GNOME. It 6 | provides data structure handling for C, portability wrappers, and 7 | interfaces for such runtime functionality as an event loop, threads, 8 | dynamic loading, and an object system. 9 | 10 | 11 | -------------------------------------------------------------------------------- /glib/gnulib/makefile.msc: -------------------------------------------------------------------------------- 1 | TOP = ..\..\.. 2 | !INCLUDE ..\..\build\win32\make.msc 3 | 4 | INCLUDES = -I ..\.. -I .. 5 | DEFINES = -DHAVE_CONFIG_H -DHAVE_LONG_LONG_FORMAT 6 | 7 | OBJECTS = \ 8 | asnprintf.obj \ 9 | printf.obj \ 10 | printf-args.obj \ 11 | printf-parse.obj \ 12 | vasnprintf.obj 13 | 14 | all : gnulib.lib 15 | 16 | gnulib.lib : $(OBJECTS) 17 | lib -out:gnulib.lib $(OBJECTS) 18 | 19 | -------------------------------------------------------------------------------- /gthread/libgthread_2_0_la-gthread-impl.lo: -------------------------------------------------------------------------------- 1 | # libgthread_2_0_la-gthread-impl.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.2 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libgthread_2_0_la-gthread-impl.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object=none 12 | 13 | -------------------------------------------------------------------------------- /glib/tests/markups/valid-4.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | TEXT ' 3 | ' 4 | ELEMENT 'bar' 5 | a="1" 6 | END 'bar' 7 | TEXT ' 8 | ' 9 | ELEMENT 'bar' 10 | a="2" 11 | END 'bar' 12 | TEXT ' 13 | ' 14 | ELEMENT 'bar' 15 | a="3"" 16 | END 'bar' 17 | TEXT ' 18 | ' 19 | ELEMENT 'bar' 20 | a="4'" 21 | END 'bar' 22 | TEXT ' 23 | ' 24 | ELEMENT 'bar' 25 | a="5''''" 26 | END 'bar' 27 | TEXT ' 28 | ' 29 | END 'foo' 30 | -------------------------------------------------------------------------------- /glib/tests/markups/valid-1.gmarkup: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Hi & this is some text inside an element Two 'E' chars as character refs: E E and some 'J': J J 5 | Text with some nested elements and entities "& < >> ' and whitespace 6 | This element has attributes 7 | 8 | 9 | -------------------------------------------------------------------------------- /glib/glib_probes.d: -------------------------------------------------------------------------------- 1 | provider glib { 2 | probe mem__alloc(void*, unsigned int, unsigned int, unsigned int); 3 | probe mem__realloc(void*, void *, unsigned int, unsigned int); 4 | probe mem__free(void*); 5 | probe slice__alloc(void*, unsigned int); 6 | probe slice__free(void*, unsigned int); 7 | probe quark__new(char *, unsigned int); 8 | probe main__before_dispatch (char *); 9 | probe main__after_dispatch (char *); 10 | probe main__source_attach(char*); 11 | probe main__source_destroy(char*); 12 | }; 13 | -------------------------------------------------------------------------------- /glib/tests/include.c: -------------------------------------------------------------------------------- 1 | /* Test case for bug 659866 */ 2 | 3 | #define _POSIX_C_SOURCE 199309L 4 | #undef _GNU_SOURCE 5 | #undef _XOPEN_SOURCE 6 | #include 7 | #include 8 | 9 | static void 10 | test_rwlock (void) 11 | { 12 | GRWLock lock; 13 | 14 | g_rw_lock_init (&lock); 15 | g_rw_lock_clear (&lock); 16 | } 17 | 18 | int 19 | main (int argc, char *argv[]) 20 | { 21 | g_test_init (&argc, &argv, NULL); 22 | 23 | g_test_add_func ("/include/rwlock", test_rwlock); 24 | 25 | return g_test_run (); 26 | } 27 | -------------------------------------------------------------------------------- /glib/gnulib/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | include $(top_srcdir)/glib.mk 3 | 4 | AM_CPPFLAGS = \ 5 | $(glib_INCLUDES) \ 6 | -DG_LOG_DOMAIN=\"GLib\" \ 7 | $(GLIB_DEBUG_FLAGS) \ 8 | -DG_DISABLE_DEPRECATED \ 9 | -DGLIB_COMPILATION 10 | 11 | noinst_LTLIBRARIES += libgnulib.la 12 | 13 | libgnulib_la_CFLAGS = $(GLIB_HIDDEN_VISIBILITY_CFLAGS) 14 | libgnulib_la_SOURCES = \ 15 | asnprintf.c \ 16 | printf-args.c \ 17 | printf-args.h \ 18 | printf-parse.c \ 19 | printf-parse.h \ 20 | vasnprintf.c \ 21 | vasnprintf.h \ 22 | printf.c \ 23 | printf.h \ 24 | g-gnulib.h 25 | 26 | 27 | EXTRA_DIST += makefile.msc 28 | -------------------------------------------------------------------------------- /glib/tests/markups/valid-16.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'a' 2 | TEXT ' 3 | ' 4 | ELEMENT 'b' 5 | TEXT ' 6 | ' 7 | ELEMENT 'c1' 8 | TEXT 'c1' 9 | END 'c1' 10 | TEXT ' 11 | ' 12 | ELEMENT 'c2' 13 | TEXT 'c2' 14 | END 'c2' 15 | TEXT ' 16 | ' 17 | END 'b' 18 | TEXT ' 19 | ' 20 | ELEMENT 'b1' 21 | TEXT 'b1' 22 | END 'b1' 23 | TEXT ' 24 | ' 25 | ELEMENT 'b2' 26 | TEXT 'b2' 27 | END 'b2' 28 | TEXT ' 29 | ' 30 | ELEMENT 'b3' 31 | TEXT 'b3' 32 | END 'b3' 33 | TEXT ' 34 | ' 35 | ELEMENT 'b4' 36 | TEXT '' 37 | PASS '' 38 | TEXT '' 39 | END 'b4' 40 | TEXT ' 41 | ' 42 | END 'a' 43 | -------------------------------------------------------------------------------- /glib/pcre/makefile.msc: -------------------------------------------------------------------------------- 1 | TOP = ..\..\.. 2 | !INCLUDE ..\..\build\win32\make.msc 3 | 4 | INCLUDES = \ 5 | -I ..\.. \ 6 | -I .. 7 | 8 | DEFINES = \ 9 | -DPCRE_STATIC \ 10 | -DHAVE_CONFIG_H \ 11 | -DHAVE_LONG_LONG_FORMAT \ 12 | -DSUPPORT_UCP \ 13 | -DSUPPORT_UTF8 \ 14 | -DNEWLINE=-1 \ 15 | -DMATCH_LIMIT=10000000 \ 16 | -DMATCH_LIMIT_RECURSION=10000000 \ 17 | -DMAX_NAME_SIZE=32 \ 18 | -DMAX_NAME_COUNT=10000 \ 19 | -DMAX_DUPLENGTH=30000 \ 20 | -DLINK_SIZE=2 \ 21 | -DEBCDIC=0 \ 22 | -DPOSIX_MALLOC_THRESHOLD=10 23 | 24 | OBJECTS = \ 25 | 26 | 27 | all : pcre.lib 28 | 29 | pcre.lib : $(OBJECTS) 30 | lib -out:pcre.lib $(OBJECTS) 31 | -------------------------------------------------------------------------------- /glib/tests/bookmarks/fail-03.xbel: -------------------------------------------------------------------------------- 1 | 2 | 6 | Singleton 7 | A file containing a single bookmark element 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /glib/tests/bookmarks/valid-02.xbel: -------------------------------------------------------------------------------- 1 | 2 | 3 | Singleton 4 | A file containing a single bookmark element 5 | 6 | Milan-Stuttgart 7 | A schedule 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /glibTests/glibTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // glibTests.m 3 | // glibTests 4 | // 5 | // Created by Andrii Kostenko on 01.06.14. 6 | // Copyright (c) 2014 Andrii Kostenko. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface glibTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation glibTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /glib/libcharset/update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if test $# = 1 ; then 4 | ORIGINAL=$1 5 | else 6 | echo "Usage: update.sh /path/to/libcharset" 1>&2 7 | exit 1 8 | fi 9 | 10 | if test -f $ORIGINAL/lib/localcharset.c ; then : ; else 11 | echo "Usage: update.sh /path/to/libcharset" 1>&2 12 | exit 1 13 | fi 14 | 15 | VERSION=`grep VERSION= $ORIGINAL/configure.ac | sed s/VERSION=//` 16 | 17 | for i in localcharset.c ref-add.sin ref-del.sin config.charset ; do 18 | cp $ORIGINAL/lib/$i . 19 | done 20 | 21 | for i in libcharset.h localcharset.h ; do 22 | cp $ORIGINAL/include/$i.in ./$i 23 | done 24 | 25 | for i in codeset.m4 glibc21.m4 ; do 26 | cp $ORIGINAL/m4/$i . 27 | done 28 | 29 | patch -p0 < libcharset-glib.patch 30 | 31 | echo "dnl From libcharset $VERSION" > ../../aclibcharset.m4 32 | 33 | 34 | -------------------------------------------------------------------------------- /glib/tests/bookmarks/fail-08.xbel: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | Singleton 10 | A file containing a single bookmark element 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /glib/libcharset/codeset.m4: -------------------------------------------------------------------------------- 1 | # codeset.m4 serial AM1 (gettext-0.10.40) 2 | dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | 9 | AC_DEFUN([AM_LANGINFO_CODESET], 10 | [ 11 | AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, 12 | [AC_TRY_LINK([#include ], 13 | [char* cs = nl_langinfo(CODESET);], 14 | am_cv_langinfo_codeset=yes, 15 | am_cv_langinfo_codeset=no) 16 | ]) 17 | if test $am_cv_langinfo_codeset = yes; then 18 | AC_DEFINE(HAVE_LANGINFO_CODESET, 1, 19 | [Define if you have and nl_langinfo(CODESET).]) 20 | fi 21 | ]) 22 | -------------------------------------------------------------------------------- /glib/tests/markups/valid-1.expected: -------------------------------------------------------------------------------- 1 | PASS '' 2 | PASS '' 3 | ELEMENT 'foobar' 4 | TEXT ' 5 | ' 6 | ELEMENT 'e1' 7 | TEXT 'Hi & this is some text inside an element Two 'E' chars as character refs: E E and some 'J': J J' 8 | END 'e1' 9 | TEXT ' 10 | ' 11 | ELEMENT 'e2:foo' 12 | TEXT ' Text ' 13 | ELEMENT 'childfree' 14 | END 'childfree' 15 | TEXT ' with some ' 16 | ELEMENT 'nested' 17 | TEXT 'nested elements' 18 | END 'nested' 19 | TEXT ' and entities "& < >> ' and whitespace ' 20 | END 'e2:foo' 21 | TEXT ' 22 | ' 23 | ELEMENT 'tag' 24 | ab="fo 2 | 3 | #define ITERATIONS 100000000 4 | 5 | static void 6 | test_bitlocks (void) 7 | { 8 | guint64 start = g_get_monotonic_time (); 9 | gint lock = 0; 10 | gint i; 11 | 12 | for (i = 0; i < ITERATIONS; i++) 13 | { 14 | g_bit_lock (&lock, 0); 15 | g_bit_unlock (&lock, 0); 16 | } 17 | 18 | { 19 | gdouble elapsed; 20 | gdouble rate; 21 | 22 | elapsed = g_get_monotonic_time () - start; 23 | elapsed /= 1000000; 24 | rate = ITERATIONS / elapsed; 25 | 26 | g_test_maximized_result (rate, "iterations per second"); 27 | } 28 | } 29 | 30 | int 31 | main (int argc, char **argv) 32 | { 33 | g_test_init (&argc, &argv, NULL); 34 | 35 | if (g_test_perf ()) 36 | g_test_add_func ("/bitlock/performance/uncontended", test_bitlocks); 37 | 38 | return g_test_run (); 39 | } 40 | -------------------------------------------------------------------------------- /glibTests/glibTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CFBundleIdentifier 7 | name.kostenko.${PRODUCT_NAME:rfc1034identifier} 8 | 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleShortVersionString 14 | 1.0 15 | CFBundleVersion 16 | 1 17 | CFBundleDevelopmentRegion 18 | en 19 | CFBundlePackageType 20 | BNDL 21 | CFBundleSignature 22 | ???? 23 | 24 | 25 | -------------------------------------------------------------------------------- /glib/libcharset/make-patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if test $# = 1 ; then 4 | ORIGINAL=$1 5 | else 6 | echo "Usage: make-patch.sh /path/to/libcharset" 1>&2 7 | exit 1 8 | fi 9 | 10 | if test -f $ORIGINAL/lib/localcharset.c ; then : ; else 11 | echo "Usage: make-patch.sh /path/to/libcharset" 1>&2 12 | exit 1 13 | fi 14 | 15 | VERSION=`grep VERSION= $ORIGINAL/configure.ac | sed s/VERSION=//` 16 | 17 | echo "# Patch against libcharset version $VERSION" > libcharset-glib.patch 18 | 19 | for i in localcharset.c ref-add.sin ref-del.sin ; do 20 | diff -u $ORIGINAL/lib/$i $i >> libcharset-glib.patch 21 | done 22 | 23 | for i in glibc21.m4 codeset.m4 ; do 24 | diff -u $ORIGINAL/m4/$i $i >> libcharset-glib.patch 25 | done 26 | 27 | diff -u $ORIGINAL/include/libcharset.h.in libcharset.h >> libcharset-glib.patch 28 | diff -u $ORIGINAL/include/localcharset.h.in localcharset.h >> libcharset-glib.patch 29 | -------------------------------------------------------------------------------- /gthread/makefile.msc: -------------------------------------------------------------------------------- 1 | ## Makefile for building the gthread dll with Microsoft C 2 | ## Use: nmake -f makefile.msc install 3 | 4 | TOP = ..\.. 5 | 6 | !INCLUDE ..\build\win32\make.msc 7 | 8 | ################################################################ 9 | 10 | INCLUDES = -FImsvc_recommended_pragmas.h -I .. -I . -I ..\glib 11 | DEFINES = -DHAVE_CONFIG_H -DG_LOG_DOMAIN=\"GThread\" 12 | all : \ 13 | libgthread-2.0-0.dll 14 | 15 | gthread_OBJECTS = \ 16 | gthread-impl.obj 17 | 18 | gthread-impl.obj : gthread-impl.c gthread-win32.c 19 | $(CC) -c $(CFLAGS) gthread-impl.c 20 | 21 | gthread.res : gthread.rc 22 | rc -DBUILDNUMBER=0 -r -fo gthread.res gthread.rc 23 | 24 | libgthread-2.0-0.dll : $(gthread_OBJECTS) gthread.def gthread.res 25 | $(CC) $(CFLAGS) -LD -Fe$@ $(gthread_OBJECTS) gthread.res \ 26 | ..\glib\glib-2.0.lib $(DEPCLIBS) user32.lib $(LDFLAGS) /implib:gthread-2.0.lib /def:gthread.def 27 | -------------------------------------------------------------------------------- /glib/tests/bookmarks/fail-09.xbel: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | Singleton 10 | A file containing a single bookmark element 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /gthread/makefile.msc.in: -------------------------------------------------------------------------------- 1 | ## Makefile for building the gthread dll with Microsoft C 2 | ## Use: nmake -f makefile.msc install 3 | 4 | TOP = ..\.. 5 | 6 | !INCLUDE ..\build\win32\make.msc 7 | 8 | ################################################################ 9 | 10 | INCLUDES = -FImsvc_recommended_pragmas.h -I .. -I . -I ..\glib 11 | DEFINES = -DHAVE_CONFIG_H -DG_LOG_DOMAIN=\"GThread\" 12 | all : \ 13 | libgthread-2.0-@LT_CURRENT_MINUS_AGE@.dll 14 | 15 | gthread_OBJECTS = \ 16 | gthread-impl.obj 17 | 18 | gthread-impl.obj : gthread-impl.c gthread-win32.c 19 | $(CC) -c $(CFLAGS) gthread-impl.c 20 | 21 | gthread.res : gthread.rc 22 | rc -DBUILDNUMBER=0 -r -fo gthread.res gthread.rc 23 | 24 | libgthread-2.0-@LT_CURRENT_MINUS_AGE@.dll : $(gthread_OBJECTS) gthread.def gthread.res 25 | $(CC) $(CFLAGS) -LD -Fe$@ $(gthread_OBJECTS) gthread.res \ 26 | ..\glib\glib-2.0.lib $(DEPCLIBS) user32.lib $(LDFLAGS) /implib:gthread-2.0.lib /def:gthread.def 27 | -------------------------------------------------------------------------------- /glib/libcharset/glibc21.m4: -------------------------------------------------------------------------------- 1 | # glibc21.m4 serial 3 2 | dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | # Test for the GNU C Library, version 2.1 or newer. 8 | # From Bruno Haible. 9 | 10 | AC_DEFUN([gl_GLIBC21], 11 | [ 12 | AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, 13 | ac_cv_gnu_library_2_1, 14 | [AC_EGREP_CPP([Lucky GNU user], 15 | [ 16 | #include 17 | #ifdef __GNU_LIBRARY__ 18 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) 19 | Lucky GNU user 20 | #endif 21 | #endif 22 | ], 23 | ac_cv_gnu_library_2_1=yes, 24 | ac_cv_gnu_library_2_1=no) 25 | ] 26 | ) 27 | AC_SUBST(GLIBC21) 28 | GLIBC21="$ac_cv_gnu_library_2_1" 29 | ] 30 | ) 31 | -------------------------------------------------------------------------------- /glib/tests/markups/valid-14.gmarkup: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* gmarkup.c - Simple XML-like parser 4 | * 5 | * Copyright 2000, 2003 Red Hat, Inc. 6 | * Copyright 2007, 2008 Ryan Lortie <desrt@desrt.ca> 7 | * 8 | * GLib is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU Lesser General Public License as 10 | * published by the Free Software Foundation; either version 2 of the 11 | * License, or (at your option) any later version. 12 | * 13 | * GLib is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with GLib; see the file COPYING.LIB. If not, 20 | * see <http://www.gnu.org/licenses/>. 21 | */ 22 | 23 | 24 | -------------------------------------------------------------------------------- /glib/tests/bookmarks/fail-04.xbel: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | Singleton 10 | A file containing a single bookmark element 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /glib/tests/bookmarks/fail-06.xbel: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | Singleton 10 | A file containing a single bookmark element 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /glib/tests/bookmarks/fail-07.xbel: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | Singleton 10 | A file containing a single bookmark element 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /glib/tests/bookmarks/fail-10.xbel: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | Singleton 10 | A file containing a single bookmark element 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /glib/tests/markups/valid-14.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foo' 2 | TEXT ' 3 | ' 4 | ELEMENT 'bar' 5 | TEXT ' 6 | /* gmarkup.c - Simple XML-like parser 7 | * 8 | * Copyright 2000, 2003 Red Hat, Inc. 9 | * Copyright 2007, 2008 Ryan Lortie 10 | * 11 | * GLib is free software; you can redistribute it and/or modify it 12 | * under the terms of the GNU Lesser General Public License as 13 | * published by the Free Software Foundation; either version 2 of the 14 | * License, or (at your option) any later version. 15 | * 16 | * GLib is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with GLib; see the file COPYING.LIB. If not, 23 | * see . 24 | */ 25 | ' 26 | END 'bar' 27 | TEXT ' 28 | ' 29 | END 'foo' 30 | -------------------------------------------------------------------------------- /glib/gcharsetprivate.h: -------------------------------------------------------------------------------- 1 | /* gunicodeprivate.h 2 | * 3 | * Copyright (C) 2012 Red Hat, Inc. 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, see . 17 | */ 18 | 19 | #ifndef __G_CHARSET_PRIVATE_H__ 20 | #define __G_CHARSET_PRIVATE_H__ 21 | 22 | #include "gcharset.h" 23 | 24 | G_BEGIN_DECLS 25 | 26 | const char ** _g_charset_get_aliases (const char *canonical_name); 27 | 28 | G_END_DECLS 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /glib/tests/bookmarks/fail-05.xbel: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | Singleton 10 | A file & containing a single bookmark element 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /glib/tests/bookmarks.xbel: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | Desktop Bookmarks Spec 10 | 11 | 12 | text/xml 13 | 14 | 15 | 16 | 17 | 18 | Editors 19 | 20 | 21 | 22 | 23 | 2 | 5 | 9 | Singleton 10 | A file containing a single bookmark element 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /glib/tests/bookmarks/valid-01.xbel: -------------------------------------------------------------------------------- 1 | 2 | Singleton 6 | A file containing a single bookmark element 7 | 8 | 9 | 10 | 11 | 12 | 13 | Office 14 | Multimedia 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /glib/tests/bookmarks/fail-17.xbel: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | Singleton 10 | A file containing a single bookmark element 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /glib/tests/bookmarks/fail-11.xbel: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | Singleton 10 | A file containing a single bookmark element 11 | 12 | & 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /glib/tests/bookmarks/fail-12.xbel: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | Singleton 10 | A file containing a single bookmark element 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /glib/tests/bookmarks/fail-15.xbel: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | Singleton 10 | A file containing a single bookmark element 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Test 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /glib/tests/bookmarks/fail-14.xbel: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | Singleton 10 | A file containing a single bookmark element 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Test 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /glib/tests/bookmarks/fail-16.xbel: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | Singleton 10 | A file containing a single bookmark element 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Test 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /glib/gasyncqueueprivate.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | 18 | #ifndef __G_ASYNCQUEUEPRIVATE_H__ 19 | #define __G_ASYNCQUEUEPRIVATE_H__ 20 | 21 | #include "gasyncqueue.h" 22 | 23 | G_BEGIN_DECLS 24 | 25 | GMutex *_g_async_queue_get_mutex (GAsyncQueue *queue); 26 | 27 | G_END_DECLS 28 | 29 | #endif /* __G_ASYNCQUEUEPRIVATE_H__ */ 30 | -------------------------------------------------------------------------------- /glib/libcharset/ref-del.sin: -------------------------------------------------------------------------------- 1 | # Remove this package from a list of references stored in a text file. 2 | # 3 | # Copyright (C) 2000 Free Software Foundation, Inc. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU Library General Public License as published 7 | # by the Free Software Foundation; either version 2, or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Library General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Library General Public 16 | # License along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 18 | # USA. 19 | # 20 | # Written by Bruno Haible . 21 | # 22 | /^# Packages using this file: / { 23 | s/# Packages using this file:// 24 | s/ @PACKAGE@ / / 25 | s/^/# Packages using this file:/ 26 | } 27 | -------------------------------------------------------------------------------- /glib/gunicodeprivate.h: -------------------------------------------------------------------------------- 1 | /* gunicodeprivate.h 2 | * 3 | * Copyright (C) 2003 Noah Levitt 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, see . 17 | */ 18 | 19 | #ifndef __G_UNICODE_PRIVATE_H__ 20 | #define __G_UNICODE_PRIVATE_H__ 21 | 22 | #include "gtypes.h" 23 | 24 | G_BEGIN_DECLS 25 | 26 | gunichar *_g_utf8_normalize_wc (const gchar *str, 27 | gssize max_len, 28 | GNormalizeMode mode); 29 | 30 | G_END_DECLS 31 | 32 | #endif /* __G_UNICODE_PRIVATE_H__ */ 33 | -------------------------------------------------------------------------------- /glib/gmain-internal.h: -------------------------------------------------------------------------------- 1 | /* gmain-internal.h - GLib-internal mainloop API 2 | * Copyright (C) 2011 Red Hat, Inc. 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 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 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, see . 16 | */ 17 | 18 | #ifndef __G_MAIN_INTERNAL_H__ 19 | #define __G_MAIN_INTERNAL_H__ 20 | 21 | #if !defined (GLIB_COMPILATION) 22 | #error "This is a private header" 23 | #endif 24 | 25 | #include "gmain.h" 26 | 27 | G_BEGIN_DECLS 28 | 29 | GSource *_g_main_create_unix_signal_watch (int signum); 30 | 31 | G_END_DECLS 32 | 33 | #endif /* __G_MAIN_H__ */ 34 | -------------------------------------------------------------------------------- /glib/tests/bookmarks/valid-03.xbel: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | Singleton 10 | A file containing a single bookmark element 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /glib/gen-iswide-table.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import sys 4 | 5 | W = {} 6 | W['A'] = [] 7 | W['W'] = [] 8 | W['F'] = W['W'] 9 | 10 | for line in sys.stdin: 11 | i = line.find ('#') 12 | if i >= 0: 13 | line = line[:i] 14 | line = line.strip () 15 | if not len (line): 16 | continue 17 | 18 | fields = [x.strip () for x in line.split (';')] 19 | chars = fields[0] 20 | width = fields[1] 21 | 22 | if width not in ['A', 'W', 'F']: 23 | continue 24 | 25 | if chars.find ('..') > 0: 26 | (start,end) = chars.split ('..') 27 | else: 28 | start = chars 29 | end = chars 30 | start, end = int(start,16), int(end,16) 31 | 32 | for i in range (start, end+1): 33 | W[width].append (i) 34 | 35 | 36 | def write_intervals (S): 37 | S.sort () 38 | start = S[0]; 39 | end = start - 1 40 | for c in S: 41 | if c == end+1: 42 | end += 1 43 | continue 44 | else: 45 | print "{0x%04X, 0x%04X}, " % (start, end) 46 | start = c 47 | end = start 48 | print "{0x%04X, 0x%04X} " % (start, end) 49 | 50 | 51 | 52 | print "table for g_unichar_iswide():" 53 | print 54 | write_intervals (W['W']) 55 | print 56 | print "table for g_unichar_iswide_cjk():" 57 | print 58 | write_intervals (W['A']) 59 | -------------------------------------------------------------------------------- /glib/libcharset/ref-add.sin: -------------------------------------------------------------------------------- 1 | # Add this package to a list of references stored in a text file. 2 | # 3 | # Copyright (C) 2000 Free Software Foundation, Inc. 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU Library General Public License as published 7 | # by the Free Software Foundation; either version 2, or (at your option) 8 | # any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Library General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Library General Public 16 | # License along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 18 | # USA. 19 | # 20 | # Written by Bruno Haible . 21 | # 22 | /^# Packages using this file: / { 23 | s/# Packages using this file:// 24 | ta 25 | :a 26 | s/ @PACKAGE@ / @PACKAGE@ / 27 | tb 28 | s/ $/ @PACKAGE@ / 29 | :b 30 | s/^/# Packages using this file:/ 31 | } 32 | -------------------------------------------------------------------------------- /glib/tests/dir.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static void 4 | test_dir_read (void) 5 | { 6 | GDir *dir; 7 | GError *error; 8 | gchar *first; 9 | const gchar *name; 10 | 11 | error = NULL; 12 | dir = g_dir_open (".", 0, &error); 13 | g_assert_no_error (error); 14 | 15 | first = NULL; 16 | while ((name = g_dir_read_name (dir)) != NULL) 17 | { 18 | if (first == NULL) 19 | first = g_strdup (name); 20 | g_assert_cmpstr (name, !=, "."); 21 | g_assert_cmpstr (name, !=, ".."); 22 | } 23 | 24 | g_dir_rewind (dir); 25 | g_assert_cmpstr (g_dir_read_name (dir), ==, first); 26 | 27 | g_free (first); 28 | g_dir_close (dir); 29 | } 30 | 31 | static void 32 | test_dir_nonexisting (void) 33 | { 34 | GDir *dir; 35 | GError *error; 36 | 37 | error = NULL; 38 | dir = g_dir_open ("/pfrkstrf", 0, &error); 39 | g_assert (dir == NULL); 40 | g_assert_error (error, G_FILE_ERROR, G_FILE_ERROR_NOENT); 41 | g_error_free (error); 42 | } 43 | 44 | int 45 | main (int argc, char *argv[]) 46 | { 47 | g_test_init (&argc, &argv, NULL); 48 | 49 | g_test_add_func ("/dir/read", test_dir_read); 50 | g_test_add_func ("/dir/nonexisting", test_dir_nonexisting); 51 | 52 | return g_test_run (); 53 | } 54 | -------------------------------------------------------------------------------- /glib/glib-init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2011 Canonical Limited 3 | * 4 | * This library is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as 6 | * published by the Free Software Foundation; either version 2 of the 7 | * licence, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but 10 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | * 17 | * Author: Ryan Lortie 18 | */ 19 | 20 | #ifndef __GLIB_INIT_H__ 21 | #define __GLIB_INIT_H__ 22 | 23 | #include "gmessages.h" 24 | 25 | extern GLogLevelFlags g_log_always_fatal; 26 | extern GLogLevelFlags g_log_msg_prefix; 27 | 28 | #ifdef G_OS_WIN32 29 | #include 30 | 31 | void g_thread_win32_thread_detach (void); 32 | void g_thread_win32_init (void); 33 | void g_clock_win32_init (void); 34 | extern HMODULE glib_dll; 35 | #endif 36 | 37 | #endif /* __GLIB_INIT_H__ */ 38 | -------------------------------------------------------------------------------- /glib/gnulib/README: -------------------------------------------------------------------------------- 1 | The files 2 | 3 | asnprintf.c 4 | printf-args.c 5 | printf-args.h 6 | printf-parse.c 7 | printf-parse.h 8 | vasnprintf.c 9 | vasnprintf.h 10 | 11 | are taken from the vasnprintf module of the GNUlib package, which can 12 | be found at: 13 | 14 | http://www.gnu.org/software/gnulib/ 15 | 16 | All files have been modified to include g-gnulib.h. 17 | 18 | vasnprintf.c has also been modified to include support for long long 19 | printing if the system printf doesn't. This code is protected by 20 | #ifndef HAVE_LONG_LONG_FORMAT. 21 | 22 | Code has been added to printf-args.[ch], printf-parse.c and vasnprintf.c 23 | to support printing of __int64 values with the I64 format modifier. This 24 | is protected by #ifdef HAVE_INT64_AND_I64. 25 | 26 | The files 27 | 28 | printf.h 29 | printf.c 30 | g-gnulib.h 31 | 32 | have been written by me. printf.[hc] contain implementations of the 33 | remaining functions in the printf family based on vasnprintf. 34 | g-gnulib.h is included by all source files in order to move all 35 | exported functions to the _g_gnulib namespace, replace malloc by 36 | g_malloc and make sure that snprintf is only used if it implements 37 | C99 return value semantics. 38 | 39 | Matthias Clasen 40 | November 1, 2003 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /glib/gi18n.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997, 2002 Peter Mattis, Red Hat, Inc. 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | 18 | #ifndef __G_I18N_H__ 19 | #define __G_I18N_H__ 20 | 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | #define _(String) gettext (String) 27 | #define Q_(String) g_dpgettext (NULL, String, 0) 28 | #define N_(String) (String) 29 | #define C_(Context,String) g_dpgettext (NULL, Context "\004" String, strlen (Context) + 1) 30 | #define NC_(Context, String) (String) 31 | 32 | #endif /* __G_I18N_H__ */ 33 | -------------------------------------------------------------------------------- /glib/gnulib/asnprintf.c: -------------------------------------------------------------------------------- 1 | /* Formatted output to strings. 2 | Copyright (C) 1999, 2002 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program 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 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, see . */ 16 | 17 | #ifdef HAVE_CONFIG_H 18 | # include 19 | #endif 20 | 21 | #include "g-gnulib.h" 22 | 23 | /* Specification. */ 24 | #include "vasnprintf.h" 25 | 26 | #include 27 | 28 | char * 29 | asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) 30 | { 31 | va_list args; 32 | char *result; 33 | 34 | va_start (args, format); 35 | result = vasnprintf (resultbuf, lengthp, format, args); 36 | va_end (args); 37 | return result; 38 | } 39 | -------------------------------------------------------------------------------- /glib/tests/test-spawn-echo.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Red Hat, Inc. 3 | * 4 | * This work is provided "as is"; redistribution and modification 5 | * in whole or in part, in any medium, physical or electronic is 6 | * permitted without restriction. 7 | * 8 | * This work is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | * 12 | * In no event shall the authors or contributors be liable for any 13 | * direct, indirect, incidental, special, exemplary, or consequential 14 | * damages (including, but not limited to, procurement of substitute 15 | * goods or services; loss of use, data, or profits; or business 16 | * interruption) however caused and on any theory of liability, whether 17 | * in contract, strict liability, or tort (including negligence or 18 | * otherwise) arising in any way out of the use of this software, even 19 | * if advised of the possibility of such damage. 20 | * 21 | * Author: Colin Walters 22 | */ 23 | 24 | #include "config.h" 25 | 26 | #include "glib.h" 27 | 28 | int 29 | main (int argc, 30 | char *argv[]) 31 | { 32 | int i; 33 | for (i = 1; i < argc; i++) 34 | { 35 | g_print ("%s", argv[i]); 36 | } 37 | 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /glib/tests/markups/valid-2.gmarkup: -------------------------------------------------------------------------------- 1 | 2 | Παν語 3 | 4 | This is a list of ways to say hello in various languages. Its purpose is to illustrate a number of scripts. 5 | 6 | (Converted into UTF-8) 7 | 8 | --------------------------------------------------------- 9 | Arabic السلام عليكم 10 | Czech (česky) Dobrý den 11 | Danish (Dansk) Hej, Goddag 12 | English Hello 13 | Esperanto Saluton 14 | Estonian Tere, Tervist 15 | FORTRAN PROGRAM 16 | Finnish (Suomi) Hei 17 | French (Français) Bonjour, Salut 18 | German (Deutsch Nord) Guten Tag 19 | German (Deutsch Süd) Grüß Gott 20 | Greek (Ελληνικά) Γειά σας 21 | Hebrew שלום 22 | Hindi नमस्ते, नमस्कार। 23 | Italiano Ciao, Buon giorno 24 | Maltese Ċaw, Saħħa 25 | Nederlands, Vlaams Hallo, Dag 26 | Norwegian (Norsk) Hei, God dag 27 | Polish Dzień dobry, Hej 28 | Russian (Русский) Здравствуйте!‎ 29 | Slovak Dobrý deň 30 | Spanish (Español) ‎¡Hola!‎ 31 | Swedish (Svenska) Hej, Goddag 32 | Thai (ภาษาไทย) สวัสดีครับ, สวัสดีค่ะ 33 | Turkish (Türkçe) Merhaba 34 | Vietnamese (Tiếng Việt) Xin Chào 35 | Yiddish (ײַדישע) דאָס הײַזעלע 36 | 37 | Japanese (日本語) こんにちは, コンニチハ 38 | Chinese (中文,普通话,汉语) 你好 39 | Cantonese (粵語,廣東話) 早晨, 你好 40 | Korean (한글) 안녕하세요, 안녕하십니까 41 | 42 | Difference among chinese characters in GB, JIS, KSC, BIG5:‎ 43 | GB -- 元气 开发 44 | JIS -- 元気 開発 45 | KSC -- 元氣 開發 46 | BIG5 -- 元氣 開發 47 | 48 | 49 | -------------------------------------------------------------------------------- /glib/gwakeup.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2011 Canonical Limited 3 | * 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. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | * 17 | * Author: Ryan Lortie 18 | */ 19 | 20 | #ifndef __G_WAKEUP_H__ 21 | #define __G_WAKEUP_H__ 22 | 23 | #include 24 | 25 | typedef struct _GWakeup GWakeup; 26 | 27 | GWakeup * g_wakeup_new (void); 28 | void g_wakeup_free (GWakeup *wakeup); 29 | 30 | void g_wakeup_get_pollfd (GWakeup *wakeup, 31 | GPollFD *poll_fd); 32 | void g_wakeup_signal (GWakeup *wakeup); 33 | void g_wakeup_acknowledge (GWakeup *wakeup); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /glib/tests/markups/valid-2.expected: -------------------------------------------------------------------------------- 1 | ELEMENT 'foobar' 2 | TEXT ' 3 | Παν語 4 | 5 | This is a list of ways to say hello in various languages. Its purpose is to illustrate a number of scripts. 6 | 7 | (Converted into UTF-8) 8 | 9 | --------------------------------------------------------- 10 | Arabic السلام عليكم 11 | Czech (česky) Dobrý den 12 | Danish (Dansk) Hej, Goddag 13 | English Hello 14 | Esperanto Saluton 15 | Estonian Tere, Tervist 16 | FORTRAN PROGRAM 17 | Finnish (Suomi) Hei 18 | French (Français) Bonjour, Salut 19 | German (Deutsch Nord) Guten Tag 20 | German (Deutsch Süd) Grüß Gott 21 | Greek (Ελληνικά) Γειά σας 22 | Hebrew שלום 23 | Hindi नमस्ते, नमस्कार। 24 | Italiano Ciao, Buon giorno 25 | Maltese Ċaw, Saħħa 26 | Nederlands, Vlaams Hallo, Dag 27 | Norwegian (Norsk) Hei, God dag 28 | Polish Dzień dobry, Hej 29 | Russian (Русский) Здравствуйте!‎ 30 | Slovak Dobrý deň 31 | Spanish (Español) ‎¡Hola!‎ 32 | Swedish (Svenska) Hej, Goddag 33 | Thai (ภาษาไทย) สวัสดีครับ, สวัสดีค่ะ 34 | Turkish (Türkçe) Merhaba 35 | Vietnamese (Tiếng Việt) Xin Chào 36 | Yiddish (ײַדישע) דאָס הײַזעלע 37 | 38 | Japanese (日本語) こんにちは, コンニチハ 39 | Chinese (中文,普通话,汉语) 你好 40 | Cantonese (粵語,廣東話) 早晨, 你好 41 | Korean (한글) 안녕하세요, 안녕하십니까 42 | 43 | Difference among chinese characters in GB, JIS, KSC, BIG5:‎ 44 | GB -- 元气 开发 45 | JIS -- 元気 開発 46 | KSC -- 元氣 開發 47 | BIG5 -- 元氣 開發 48 | 49 | 50 | ' 51 | END 'foobar' 52 | -------------------------------------------------------------------------------- /glib/glib_trace.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * 3 | * Copyright (C) 2009,2010 Red Hat, Inc. 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General 16 | * Public License along with this library; if not, see . 17 | * 18 | * Author: Alexander Larsson 19 | */ 20 | 21 | #ifndef __GLIBTRACE_H__ 22 | #define __GLIBTRACE_H__ 23 | 24 | #ifndef SIZEOF_CHAR 25 | #error "config.h must be included prior to glib_trace.h" 26 | #endif 27 | 28 | #ifdef HAVE_DTRACE 29 | 30 | /* include the generated probes header and put markers in code */ 31 | #include "glib_probes.h" 32 | #define TRACE(probe) probe 33 | 34 | #else 35 | 36 | /* Wrap the probe to allow it to be removed when no systemtap available */ 37 | #define TRACE(probe) 38 | 39 | #endif 40 | 41 | #endif /* __GLIBTRACE_H__ */ 42 | -------------------------------------------------------------------------------- /glib/pcre/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/glib.mk 2 | 3 | noinst_LTLIBRARIES += libpcre.la 4 | 5 | libpcre_la_CPPFLAGS = \ 6 | -DG_LOG_DOMAIN=\"GLib-GRegex\" \ 7 | -DHAVE_CONFIG_H \ 8 | -DHAVE_MEMMOVE \ 9 | -DSUPPORT_UCP \ 10 | -DSUPPORT_UTF \ 11 | -DSUPPORT_UTF8 \ 12 | -DNEWLINE=-1 \ 13 | -DMATCH_LIMIT=10000000 \ 14 | -DMATCH_LIMIT_RECURSION=8192 \ 15 | -DMAX_NAME_SIZE=32 \ 16 | -DMAX_NAME_COUNT=10000 \ 17 | -DMAX_DUPLENGTH=30000 \ 18 | -DLINK_SIZE=2 \ 19 | -DPOSIX_MALLOC_THRESHOLD=10 \ 20 | -DPCRE_STATIC \ 21 | -UBSR_ANYCRLF \ 22 | -UEBCDIC \ 23 | $(glib_INCLUDES) \ 24 | @GLIB_DEBUG_FLAGS@ \ 25 | -DGLIB_COMPILATION \ 26 | $(AM_CPPFLAGS) 27 | 28 | libpcre_la_CFLAGS = \ 29 | $(GLIB_HIDDEN_VISIBILITY_CFLAGS) \ 30 | $(PCRE_WARN_CFLAGS) \ 31 | $(DEP_CFLAGS) \ 32 | $(AM_CFLAGS) 33 | 34 | libpcre_la_LDFLAGS = \ 35 | -no-undefined \ 36 | $(AM_LDFLAGS) 37 | 38 | libpcre_la_SOURCES = \ 39 | pcre_byte_order.c \ 40 | pcre_chartables.c \ 41 | pcre_compile.c \ 42 | pcre_config.c \ 43 | pcre_dfa_exec.c \ 44 | pcre_exec.c \ 45 | pcre_fullinfo.c \ 46 | pcre_get.c \ 47 | pcre_globals.c \ 48 | pcre_jit_compile.c \ 49 | pcre_newline.c \ 50 | pcre_ord2utf8.c \ 51 | pcre_string_utils.c \ 52 | pcre_study.c \ 53 | pcre_tables.c \ 54 | pcre_valid_utf8.c \ 55 | pcre_xclass.c \ 56 | pcre.h \ 57 | pcre_internal.h \ 58 | ucp.h 59 | 60 | libpcre_la_LIBADD = $(DEP_LIBS) 61 | 62 | EXTRA_DIST += \ 63 | COPYING \ 64 | makefile.msc 65 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Below are just a few of the people who have contributed 2 | to GLib. Please don't mail these people about problems you 3 | have with GTK+; see the README file for information about 4 | filing bugs and submitting patches. 5 | 6 | GLib-2.0 Team 7 | ------------- 8 | Hans Breuer 9 | Matthias Clasen 10 | Tor Lillqvist 11 | Tim Janik 12 | Havoc Pennington 13 | Ron Steinke 14 | Owen Taylor 15 | Sebastian Wilhelmi 16 | 17 | GLib-1.2 Team 18 | ------------- 19 | Shawn T. Amundson 20 | Jeff Garzik 21 | Raja R Harinath 22 | Tim Janik 23 | Elliot Lee 24 | Tor Lillqvist 25 | Paolo Molaro 26 | Havoc Pennington 27 | Manish Singh 28 | Owen Taylor 29 | Sebastian Wilhelmi 30 | 31 | The random number generator "Mersenne Twister", which is used by GLib, 32 | was developed and originally coded by: 33 | Makoto Matsumoto 34 | Takuji Nishimura 35 | 36 | Original Authors 37 | ---------------- 38 | Peter Mattis 39 | Spencer Kimball 40 | Josh MacDonald 41 | -------------------------------------------------------------------------------- /glib/gi18n-lib.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997, 2002 Peter Mattis, Red Hat, Inc. 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | 18 | #ifndef __G_I18N_LIB_H__ 19 | #define __G_I18N_LIB_H__ 20 | 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | #ifndef GETTEXT_PACKAGE 27 | #error You must define GETTEXT_PACKAGE before including gi18n-lib.h. Did you forget to include config.h? 28 | #endif 29 | 30 | #define _(String) ((char *) g_dgettext (GETTEXT_PACKAGE, String)) 31 | #define Q_(String) g_dpgettext (GETTEXT_PACKAGE, String, 0) 32 | #define N_(String) (String) 33 | #define C_(Context,String) g_dpgettext (GETTEXT_PACKAGE, Context "\004" String, strlen (Context) + 1) 34 | #define NC_(Context, String) (String) 35 | 36 | #endif /* __G_I18N_LIB_H__ */ 37 | -------------------------------------------------------------------------------- /glib/gcharset.h: -------------------------------------------------------------------------------- 1 | /* gcharset.h - Charset functions 2 | * 3 | * Copyright (C) 2011 Red Hat, Inc. 4 | * 5 | * The GLib Library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * The GLib Library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the Gnome Library; see the file COPYING.LIB. If not, 17 | * see . 18 | */ 19 | 20 | #ifndef __G_CHARSET_H__ 21 | #define __G_CHARSET_H__ 22 | 23 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 24 | #error "Only can be included directly." 25 | #endif 26 | 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | GLIB_AVAILABLE_IN_ALL 32 | gboolean g_get_charset (const char **charset); 33 | GLIB_AVAILABLE_IN_ALL 34 | gchar * g_get_codeset (void); 35 | 36 | GLIB_AVAILABLE_IN_ALL 37 | const gchar * const * g_get_language_names (void); 38 | GLIB_AVAILABLE_IN_ALL 39 | gchar ** g_get_locale_variants (const gchar *locale); 40 | 41 | G_END_DECLS 42 | 43 | #endif /* __G_CHARSET_H__ */ 44 | -------------------------------------------------------------------------------- /glib/glib-mirroring-tab/packtab.h: -------------------------------------------------------------------------------- 1 | /* PackTab - Pack a static table 2 | * Copyright (C) 2001 Behdad Esfahbod. 3 | * 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.1 of the License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with this library, in a file named COPYING; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA 18 | * 19 | * For licensing issues, contact . 20 | */ 21 | 22 | #ifndef PACKTAB_H 23 | #define PACKTAB_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" 27 | { 28 | #endif 29 | 30 | #define packtab_version 3 31 | 32 | int pack_table ( 33 | const signed int *base, 34 | long key_num, 35 | int key_size, 36 | signed int default_key, 37 | int max_depth, 38 | int tab_width, 39 | const char *const *name, 40 | const char *key_type_name, 41 | const char *table_name, 42 | const char *macro_name, 43 | FILE *out 44 | ); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif /* PACKTAB_H */ 51 | -------------------------------------------------------------------------------- /glib/glibintl.h: -------------------------------------------------------------------------------- 1 | #ifndef __GLIBINTL_H__ 2 | #define __GLIBINTL_H__ 3 | 4 | #ifndef SIZEOF_CHAR 5 | #error "config.h must be included prior to glibintl.h" 6 | #endif 7 | 8 | GLIB_AVAILABLE_IN_ALL 9 | const gchar * glib_gettext (const gchar *str) G_GNUC_FORMAT(1); 10 | GLIB_AVAILABLE_IN_ALL 11 | const gchar * glib_pgettext (const gchar *msgctxtid, 12 | gsize msgidoffset) G_GNUC_FORMAT(1); 13 | 14 | #ifdef ENABLE_NLS 15 | 16 | #include 17 | #define _(String) glib_gettext(String) 18 | /* Split out this in the code, but keep it in the same domain for now */ 19 | #define P_(String) glib_gettext(String) 20 | #define C_(Context,String) glib_pgettext (Context "\004" String, strlen (Context) + 1) 21 | 22 | #ifdef gettext_noop 23 | #define N_(String) gettext_noop(String) 24 | #else 25 | #define N_(String) (String) 26 | #endif 27 | #else /* NLS is disabled */ 28 | #define _(String) (String) 29 | #define N_(String) (String) 30 | #define P_(String) (String) 31 | #define C_(Context,String) (String) 32 | #define textdomain(String) ((String) ? (String) : "messages") 33 | #define gettext(String) (String) 34 | #define dgettext(Domain,String) (String) 35 | #define dcgettext(Domain,String,Type) (String) 36 | #define dngettext(Domain,String1,String2,N) ((N) == 1 ? (String1) : (String2)) 37 | #define bindtextdomain(Domain,Directory) (Domain) 38 | #define bind_textdomain_codeset(Domain,Codeset) 39 | #endif 40 | 41 | /* not really I18N-related, but also a string marker macro */ 42 | #define I_(string) g_intern_static_string (string) 43 | 44 | #endif /* __GLIBINTL_H__ */ 45 | -------------------------------------------------------------------------------- /glib/glib-object.h: -------------------------------------------------------------------------------- 1 | /* GObject - GLib Type, Object, Parameter and Signal Library 2 | * Copyright (C) 1998, 1999, 2000 Tim Janik and Red Hat, Inc. 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, see . 16 | */ 17 | #ifndef __GLIB_GOBJECT_H__ 18 | #define __GLIB_GOBJECT_H__ 19 | 20 | #define __GLIB_GOBJECT_H_INSIDE__ 21 | 22 | /* topmost include file for GObject header files */ 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | #undef __GLIB_GOBJECT_H_INSIDE__ 39 | 40 | #endif /* __GLIB_GOBJECT_H__ */ 41 | -------------------------------------------------------------------------------- /glib/glib-private.c: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 2011 Red Hat, Inc. 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | * 17 | * Author: Colin Walters 18 | */ 19 | 20 | #include "config.h" 21 | 22 | #include "glib-private.h" 23 | 24 | /** 25 | * glib__private__: 26 | * @arg: Do not use this argument 27 | * 28 | * Do not call this function; it is used to share private 29 | * API between glib, gobject, and gio. 30 | */ 31 | GLibPrivateVTable * 32 | glib__private__ (void) 33 | { 34 | static GLibPrivateVTable table = { 35 | g_wakeup_new, 36 | g_wakeup_free, 37 | g_wakeup_get_pollfd, 38 | g_wakeup_signal, 39 | g_wakeup_acknowledge, 40 | 41 | g_get_worker_context, 42 | 43 | g_check_setuid, 44 | g_main_context_new_with_next_id, 45 | 46 | g_dir_open_with_errno, 47 | g_dir_new_from_dirp 48 | }; 49 | 50 | return &table; 51 | } 52 | 53 | -------------------------------------------------------------------------------- /glib/gnulib/g-gnulib.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 2003 Matthias Clasen 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | #ifndef __G_GNULIB_H__ 18 | 19 | #include "config.h" 20 | #include 21 | #include "glib/glib.h" 22 | 23 | /* Private namespace for gnulib functions */ 24 | #define asnprintf _g_gnulib_asnprintf 25 | #define vasnprintf _g_gnulib_vasnprintf 26 | #define printf_parse _g_gnulib_printf_parse 27 | #define printf_fetchargs _g_gnulib_printf_fetchargs 28 | 29 | /* Use GLib memory allocation */ 30 | #undef malloc 31 | #undef realloc 32 | #undef free 33 | #define malloc g_malloc 34 | #define realloc g_realloc 35 | #define free g_free 36 | 37 | /* Ensure only C99 snprintf gets used */ 38 | #undef HAVE_SNPRINTF 39 | #ifdef HAVE_C99_SNPRINTF 40 | #define HAVE_SNPRINTF 1 41 | #else 42 | #define HAVE_SNPRINTF 0 43 | #endif 44 | 45 | 46 | #endif /* __G_GNULIB_H__ */ 47 | 48 | -------------------------------------------------------------------------------- /glib/ghostutils.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 2008 Red Hat, Inc. 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, see . 16 | */ 17 | 18 | #ifndef __G_HOST_UTILS_H__ 19 | #define __G_HOST_UTILS_H__ 20 | 21 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | GLIB_AVAILABLE_IN_ALL 30 | gboolean g_hostname_is_non_ascii (const gchar *hostname); 31 | GLIB_AVAILABLE_IN_ALL 32 | gboolean g_hostname_is_ascii_encoded (const gchar *hostname); 33 | GLIB_AVAILABLE_IN_ALL 34 | gboolean g_hostname_is_ip_address (const gchar *hostname); 35 | 36 | GLIB_AVAILABLE_IN_ALL 37 | gchar *g_hostname_to_ascii (const gchar *hostname); 38 | GLIB_AVAILABLE_IN_ALL 39 | gchar *g_hostname_to_unicode (const gchar *hostname); 40 | 41 | G_END_DECLS 42 | 43 | #endif /* __G_HOST_UTILS_H__ */ 44 | -------------------------------------------------------------------------------- /glib/update-pcre/memory.patch: -------------------------------------------------------------------------------- 1 | From acf401f1353a37b6edff9577ff07d055c625e4ca Mon Sep 17 00:00:00 2001 2 | From: Christian Persch 3 | Date: Sun, 12 Feb 2012 19:40:48 +0100 4 | Subject: [PATCH] regex: Use glib memory allocator 5 | 6 | --- 7 | glib/pcre/pcre_globals.c | 10 ++++++---- 8 | 1 files changed, 6 insertions(+), 4 deletions(-) 9 | 10 | diff --git a/glib/pcre/pcre_globals.c b/glib/pcre/pcre_globals.c 11 | index 36e6ddb..93d3af5 100644 12 | --- a/glib/pcre/pcre_globals.c 13 | +++ b/glib/pcre/pcre_globals.c 14 | @@ -58,6 +58,8 @@ global variables are not used. */ 15 | 16 | #include "pcre_internal.h" 17 | 18 | +#include "gmem.h" 19 | + 20 | #if defined _MSC_VER || defined __SYMBIAN32__ 21 | static void* LocalPcreMalloc(size_t aSize) 22 | { 23 | @@ -74,10 +76,10 @@ PCRE_EXP_DATA_DEFN void (*PUBL(stack_free))(void *) = LocalPcreFree; 24 | PCRE_EXP_DATA_DEFN int (*PUBL(callout))(PUBL(callout_block) *) = NULL; 25 | 26 | #elif !defined VPCOMPAT 27 | -PCRE_EXP_DATA_DEFN void *(*PUBL(malloc))(size_t) = malloc; 28 | -PCRE_EXP_DATA_DEFN void (*PUBL(free))(void *) = free; 29 | -PCRE_EXP_DATA_DEFN void *(*PUBL(stack_malloc))(size_t) = malloc; 30 | -PCRE_EXP_DATA_DEFN void (*PUBL(stack_free))(void *) = free; 31 | +PCRE_EXP_DATA_DEFN void *(*PUBL(malloc))(size_t) = g_try_malloc; 32 | +PCRE_EXP_DATA_DEFN void (*PUBL(free))(void *) = g_free; 33 | +PCRE_EXP_DATA_DEFN void *(*PUBL(stack_malloc))(size_t) = g_try_malloc; 34 | +PCRE_EXP_DATA_DEFN void (*PUBL(stack_free))(void *) = g_free; 35 | PCRE_EXP_DATA_DEFN int (*PUBL(callout))(PUBL(callout_block) *) = NULL; 36 | #endif 37 | 38 | -- 39 | 1.7.5.1.217.g4e3aa.dirty 40 | 41 | -------------------------------------------------------------------------------- /glib/gdatasetprivate.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * gdataset-private.h: Internal macros for accessing dataset values 3 | * Copyright (C) 2005 Red Hat 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, see . 17 | */ 18 | 19 | /* 20 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 21 | * file for a list of people on the GLib Team. See the ChangeLog 22 | * files for a list of changes. These files are distributed with 23 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 24 | */ 25 | 26 | #ifndef __G_DATASETPRIVATE_H__ 27 | #define __G_DATASETPRIVATE_H__ 28 | 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | /* GET_FLAGS is implemented via atomic pointer access, to allow memory 34 | * barriers to take effect without acquiring the global dataset mutex. 35 | */ 36 | #define G_DATALIST_GET_FLAGS(datalist) \ 37 | ((gsize) g_atomic_pointer_get (datalist) & G_DATALIST_FLAGS_MASK) 38 | 39 | 40 | G_END_DECLS 41 | 42 | #endif /* __G_DATASETPRIVATE_H__ */ 43 | -------------------------------------------------------------------------------- /glib/libcharset/README: -------------------------------------------------------------------------------- 1 | The sources are derived from Bruno Haible's libcharset library included 2 | with libiconv: 3 | 4 | http//www.gnu.org/software/libiconv 5 | 6 | The 'update.sh' script in this directory, when pointed at 7 | the original sources updates the files in this directory 8 | (and elsewhere in the GLib distribution) to the new version 9 | 10 | The 'make-patch.sh' script in this directory regenerates 11 | the patch files included in this directory from a copy 12 | of the pristine sources and the files in this directory. 13 | 14 | The license on the portions from libiconv portions is reproduced 15 | below. 16 | 17 | Owen Taylor 18 | 26 September 2001 19 | 20 | Updated to libiconv-1.12. 21 | 22 | Behdad Esfahbod 23 | 20 May 2008 24 | 25 | ==== 26 | 27 | /* Determine a canonical name for the current locale's character encoding. 28 | 29 | Copyright (C) 2000-2001 Free Software Foundation, Inc. 30 | 31 | This program is free software; you can redistribute it and/or modify it 32 | under the terms of the GNU Library General Public License as published 33 | by the Free Software Foundation; either version 2, or (at your option) 34 | any later version. 35 | 36 | This program is distributed in the hope that it will be useful, 37 | but WITHOUT ANY WARRANTY; without even the implied warranty of 38 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 39 | Library General Public License for more details. 40 | 41 | You should have received a copy of the GNU Library General Public 42 | License along with this program; if not, see . */ 43 | 44 | /* Written by Bruno Haible . */ 45 | -------------------------------------------------------------------------------- /glib/gqsort.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | 18 | /* 19 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 20 | * file for a list of people on the GLib Team. See the ChangeLog 21 | * files for a list of changes. These files are distributed with 22 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 23 | */ 24 | 25 | #ifndef __G_QSORT_H__ 26 | #define __G_QSORT_H__ 27 | 28 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 29 | #error "Only can be included directly." 30 | #endif 31 | 32 | #include 33 | 34 | G_BEGIN_DECLS 35 | 36 | GLIB_AVAILABLE_IN_ALL 37 | void g_qsort_with_data (gconstpointer pbase, 38 | gint total_elems, 39 | gsize size, 40 | GCompareDataFunc compare_func, 41 | gpointer user_data); 42 | 43 | G_END_DECLS 44 | 45 | #endif /* __G_QSORT_H__ */ 46 | -------------------------------------------------------------------------------- /glib/libcharset/localcharset.h: -------------------------------------------------------------------------------- 1 | /* Determine a canonical name for the current locale's character encoding. 2 | Copyright (C) 2000-2003 Free Software Foundation, Inc. 3 | This file is part of the GNU CHARSET Library. 4 | 5 | This program is free software; you can redistribute it and/or modify it 6 | under the terms of the GNU Library General Public License as published 7 | by the Free Software Foundation; either version 2, or (at your option) 8 | any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this program; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 18 | USA. */ 19 | 20 | #ifndef _LOCALCHARSET_H 21 | #define _LOCALCHARSET_H 22 | 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | 29 | /* Determine the current locale's character encoding, and canonicalize it 30 | into one of the canonical names listed in config.charset. 31 | The result must not be freed; it is statically allocated. 32 | If the canonical name cannot be determined, the result is a non-canonical 33 | name. */ 34 | extern const char * _g_locale_charset_raw (void); 35 | extern const char * _g_locale_charset_unalias (const char *codeset); 36 | extern const char * _g_locale_get_charset_aliases (void); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | 43 | #endif /* _LOCALCHARSET_H */ 44 | -------------------------------------------------------------------------------- /glib/gvariant-core.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2007, 2008 Ryan Lortie 3 | * Copyright © 2010 Codethink Limited 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, see . 17 | */ 18 | 19 | #ifndef __G_VARIANT_CORE_H__ 20 | #define __G_VARIANT_CORE_H__ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | /* gvariant-core.c */ 27 | 28 | GVariant * g_variant_new_from_children (const GVariantType *type, 29 | GVariant **children, 30 | gsize n_children, 31 | gboolean trusted); 32 | 33 | gboolean g_variant_is_trusted (GVariant *value); 34 | 35 | GVariantTypeInfo * g_variant_get_type_info (GVariant *value); 36 | 37 | #endif /* __G_VARIANT_CORE_H__ */ 38 | -------------------------------------------------------------------------------- /gthread/gthread-impl.c: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * gthread.c: thread related functions 5 | * Copyright 1998 Sebastian Wilhelmi; University of Karlsruhe 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, see . 19 | */ 20 | 21 | /* 22 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 23 | * file for a list of people on the GLib Team. See the ChangeLog 24 | * files for a list of changes. These files are distributed with 25 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 26 | */ 27 | 28 | /* 29 | * MT safe 30 | */ 31 | 32 | #include "config.h" 33 | 34 | #include 35 | 36 | void 37 | g_thread_init (gpointer init) 38 | { 39 | if (init != NULL) 40 | g_warning ("GThread system no longer supports custom thread implementations."); 41 | } 42 | 43 | void 44 | g_thread_init_with_errorcheck_mutexes (gpointer vtable) 45 | { 46 | g_assert (vtable == NULL); 47 | g_warning ("GThread system no longer supports errorcheck mutexes."); 48 | } 49 | -------------------------------------------------------------------------------- /glib/libcharset/libcharset.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2003 Free Software Foundation, Inc. 2 | This file is part of the GNU CHARSET Library. 3 | 4 | The GNU CHARSET Library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public License as 6 | published by the Free Software Foundation; either version 2 of the 7 | License, or (at your option) any later version. 8 | 9 | The GNU CHARSET 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 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public License 15 | along with the GNU CHARSET Library; see the file COPYING.LIB. If not, 16 | write to the Free Software Foundation, Inc., 51 Franklin Street, 17 | Fifth Floor, Boston, MA 02110-1301, USA. */ 18 | 19 | #ifndef _LIBCHARSET_H 20 | #define _LIBCHARSET_H 21 | 22 | #include "localcharset.h" 23 | 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | 30 | /* Support for relocatable packages. */ 31 | 32 | /* Sets the original and the current installation prefix of the package. 33 | Relocation simply replaces a pathname starting with the original prefix 34 | by the corresponding pathname with the current prefix instead. Both 35 | prefixes should be directory names without trailing slash (i.e. use "" 36 | instead of "/"). */ 37 | extern void libcharset_set_relocation_prefix (const char *orig_prefix, 38 | const char *curr_prefix); 39 | 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | 46 | #endif /* _LIBCHARSET_H */ 47 | -------------------------------------------------------------------------------- /glib/gprimes.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | 18 | /* 19 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 20 | * file for a list of people on the GLib Team. See the ChangeLog 21 | * files for a list of changes. These files are distributed with 22 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 23 | */ 24 | 25 | #ifndef __G_PRIMES_H__ 26 | #define __G_PRIMES_H__ 27 | 28 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 29 | #error "Only can be included directly." 30 | #endif 31 | 32 | #include 33 | 34 | G_BEGIN_DECLS 35 | 36 | /* Prime numbers. 37 | */ 38 | 39 | /* This function returns prime numbers spaced by approximately 1.5-2.0 40 | * and is for use in resizing data structures which prefer 41 | * prime-valued sizes. The closest spaced prime function returns the 42 | * next largest prime, or the highest it knows about which is about 43 | * MAXINT/4. 44 | */ 45 | GLIB_AVAILABLE_IN_ALL 46 | guint g_spaced_primes_closest (guint num) G_GNUC_CONST; 47 | 48 | G_END_DECLS 49 | 50 | #endif /* __G_PRIMES_H__ */ 51 | -------------------------------------------------------------------------------- /glib/gnulib/printf.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 2003 Matthias Clasen 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | #ifndef __GNULIB_PRINTF_H__ 18 | #define __GNULIB_PRINTF_H__ 19 | 20 | #include 21 | #include 22 | 23 | int _g_gnulib_printf (char const *format, 24 | ...); 25 | int _g_gnulib_fprintf (FILE *file, 26 | char const *format, 27 | ...); 28 | int _g_gnulib_sprintf (char *string, 29 | char const *format, 30 | ...); 31 | int _g_gnulib_snprintf (char *string, 32 | size_t n, 33 | char const *format, 34 | ...); 35 | int _g_gnulib_vprintf (char const *format, 36 | va_list args); 37 | int _g_gnulib_vfprintf (FILE *file, 38 | char const *format, 39 | va_list args); 40 | int _g_gnulib_vsprintf (char *string, 41 | char const *format, 42 | va_list args); 43 | int _g_gnulib_vsnprintf (char *string, 44 | size_t n, 45 | char const *format, 46 | va_list args); 47 | int _g_gnulib_vasprintf (char **result, 48 | char const *format, 49 | va_list args); 50 | 51 | 52 | #endif /* __GNULIB_PRINTF_H__ */ 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /glib/gprintfint.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | 18 | /* 19 | * Modified by the GLib Team and others 2002. See the AUTHORS 20 | * file for a list of people on the GLib Team. See the ChangeLog 21 | * files for a list of changes. These files are distributed with 22 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 23 | */ 24 | 25 | #ifndef __G_PRINTFINT_H__ 26 | #define __G_PRINTFINT_H__ 27 | 28 | #ifdef HAVE_GOOD_PRINTF 29 | 30 | #define _g_printf printf 31 | #define _g_fprintf fprintf 32 | #define _g_sprintf sprintf 33 | #define _g_snprintf snprintf 34 | 35 | #define _g_vprintf vprintf 36 | #define _g_vfprintf vfprintf 37 | #define _g_vsprintf vsprintf 38 | #define _g_vsnprintf vsnprintf 39 | 40 | #else 41 | 42 | #include "gnulib/printf.h" 43 | 44 | #define _g_printf _g_gnulib_printf 45 | #define _g_fprintf _g_gnulib_fprintf 46 | #define _g_sprintf _g_gnulib_sprintf 47 | #define _g_snprintf _g_gnulib_snprintf 48 | 49 | #define _g_vprintf _g_gnulib_vprintf 50 | #define _g_vfprintf _g_gnulib_vfprintf 51 | #define _g_vsprintf _g_gnulib_vsprintf 52 | #define _g_vsnprintf _g_gnulib_vsnprintf 53 | 54 | #endif 55 | 56 | #endif /* __G_PRINTF_H__ */ 57 | 58 | -------------------------------------------------------------------------------- /glib/gpattern.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997, 1999 Peter Mattis, Red Hat, Inc. 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | 18 | #ifndef __G_PATTERN_H__ 19 | #define __G_PATTERN_H__ 20 | 21 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | 30 | typedef struct _GPatternSpec GPatternSpec; 31 | 32 | GLIB_AVAILABLE_IN_ALL 33 | GPatternSpec* g_pattern_spec_new (const gchar *pattern); 34 | GLIB_AVAILABLE_IN_ALL 35 | void g_pattern_spec_free (GPatternSpec *pspec); 36 | GLIB_AVAILABLE_IN_ALL 37 | gboolean g_pattern_spec_equal (GPatternSpec *pspec1, 38 | GPatternSpec *pspec2); 39 | GLIB_AVAILABLE_IN_ALL 40 | gboolean g_pattern_match (GPatternSpec *pspec, 41 | guint string_length, 42 | const gchar *string, 43 | const gchar *string_reversed); 44 | GLIB_AVAILABLE_IN_ALL 45 | gboolean g_pattern_match_string (GPatternSpec *pspec, 46 | const gchar *string); 47 | GLIB_AVAILABLE_IN_ALL 48 | gboolean g_pattern_match_simple (const gchar *pattern, 49 | const gchar *string); 50 | 51 | G_END_DECLS 52 | 53 | #endif /* __G_PATTERN_H__ */ 54 | -------------------------------------------------------------------------------- /glib/libcharset/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | include $(top_srcdir)/glib.mk 3 | 4 | AM_CPPFLAGS = \ 5 | -DLIBDIR=\"$(libdir)\" \ 6 | $(config_h_INCLUDES) 7 | 8 | noinst_LTLIBRARIES += libcharset.la 9 | 10 | libcharset_la_CFLAGS = $(GLIB_HIDDEN_VISIBILITY_CFLAGS) 11 | libcharset_la_SOURCES = \ 12 | libcharset.h \ 13 | localcharset.h \ 14 | localcharset.c 15 | 16 | EXTRA_DIST += \ 17 | README \ 18 | config.charset \ 19 | ref-add.sin \ 20 | ref-del.sin \ 21 | glibc21.m4 \ 22 | codeset.m4 \ 23 | update.sh \ 24 | make-patch.sh \ 25 | libcharset-glib.patch 26 | 27 | charset_alias = $(DESTDIR)$(libdir)/charset.alias 28 | charset_tmp = $(DESTDIR)$(libdir)/charset.tmp 29 | install-exec-local: all-local 30 | $(mkinstalldirs) $(DESTDIR)$(libdir) 31 | if test -f $(charset_alias); then \ 32 | sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \ 33 | $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ 34 | rm -f $(charset_tmp) ; \ 35 | else \ 36 | if test @GLIBC21@ = no; then \ 37 | sed -f ref-add.sed charset.alias > $(charset_tmp) ; \ 38 | $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ 39 | rm -f $(charset_tmp) ; \ 40 | fi ; \ 41 | fi 42 | 43 | uninstall-local: all-local 44 | if test -f $(charset_alias); then \ 45 | sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \ 46 | if grep '^# Packages using this file: $$' $(charset_tmp) \ 47 | > /dev/null; then \ 48 | rm -f $(charset_alias); \ 49 | else \ 50 | $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \ 51 | fi; \ 52 | rm -f $(charset_tmp); \ 53 | fi 54 | 55 | charset.alias: config.charset 56 | $(AM_V_GEN) $(SHELL) $(srcdir)/config.charset '@host@' > t-$@ 57 | @mv t-$@ $@ 58 | 59 | all-local: ref-add.sed ref-del.sed charset.alias 60 | 61 | SUFFIXES = .sed .sin 62 | .sin.sed: 63 | $(AM_V_GEN) $(SED) -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@ 64 | @mv t-$@ $@ 65 | 66 | CLEANFILES += charset.alias ref-add.sed ref-del.sed 67 | -------------------------------------------------------------------------------- /glib/gshell.h: -------------------------------------------------------------------------------- 1 | /* gshell.h - Shell-related utilities 2 | * 3 | * Copyright 2000 Red Hat, Inc. 4 | * 5 | * GLib is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * GLib is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with GLib; see the file COPYING.LIB. If not, write 17 | * to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef __G_SHELL_H__ 22 | #define __G_SHELL_H__ 23 | 24 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 25 | #error "Only can be included directly." 26 | #endif 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define G_SHELL_ERROR g_shell_error_quark () 33 | 34 | typedef enum 35 | { 36 | /* mismatched or otherwise mangled quoting */ 37 | G_SHELL_ERROR_BAD_QUOTING, 38 | /* string to be parsed was empty */ 39 | G_SHELL_ERROR_EMPTY_STRING, 40 | G_SHELL_ERROR_FAILED 41 | } GShellError; 42 | 43 | GLIB_AVAILABLE_IN_ALL 44 | GQuark g_shell_error_quark (void); 45 | 46 | GLIB_AVAILABLE_IN_ALL 47 | gchar* g_shell_quote (const gchar *unquoted_string); 48 | GLIB_AVAILABLE_IN_ALL 49 | gchar* g_shell_unquote (const gchar *quoted_string, 50 | GError **error); 51 | GLIB_AVAILABLE_IN_ALL 52 | gboolean g_shell_parse_argv (const gchar *command_line, 53 | gint *argcp, 54 | gchar ***argvp, 55 | GError **error); 56 | 57 | G_END_DECLS 58 | 59 | #endif /* __G_SHELL_H__ */ 60 | -------------------------------------------------------------------------------- /glib/gvariant-internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2007, 2008 Ryan Lortie 3 | * Copyright © 2009, 2010 Codethink Limited 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the licence, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, see . 17 | * 18 | * Author: Ryan Lortie 19 | */ 20 | 21 | 22 | /* The purpose of this header is to allow certain internal symbols of 23 | * GVariant to be put under test cases. 24 | */ 25 | 26 | #ifndef __G_VARIANT_INTERNAL_H__ 27 | #define __G_VARIANT_INTERNAL_H__ 28 | 29 | /* Hack */ 30 | #define __GLIB_H_INSIDE__ 31 | 32 | #include 33 | #include 34 | 35 | #include "gvariant-serialiser.h" 36 | #include "gvarianttypeinfo.h" 37 | 38 | #undef __GLIB_H_INSIDE__ 39 | 40 | GLIB_AVAILABLE_IN_ALL 41 | gboolean g_variant_format_string_scan (const gchar *string, 42 | const gchar *limit, 43 | const gchar **endptr); 44 | 45 | GLIB_AVAILABLE_IN_ALL 46 | GVariantType * g_variant_format_string_scan_type (const gchar *string, 47 | const gchar *limit, 48 | const gchar **endptr); 49 | 50 | #endif /* __G_VARIANT_INTERNAL_H__ */ 51 | -------------------------------------------------------------------------------- /glib/tests/option-argv0.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Red Hat, Inc. 3 | * 4 | * This work is provided "as is"; redistribution and modification 5 | * in whole or in part, in any medium, physical or electronic is 6 | * permitted without restriction. 7 | * 8 | * This work is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | * 12 | * In no event shall the authors or contributors be liable for any 13 | * direct, indirect, incidental, special, exemplary, or consequential 14 | * damages (including, but not limited to, procurement of substitute 15 | * goods or services; loss of use, data, or profits; or business 16 | * interruption) however caused and on any theory of liability, whether 17 | * in contract, strict liability, or tort (including negligence or 18 | * otherwise) arising in any way out of the use of this software, even 19 | * if advised of the possibility of such damage. 20 | * 21 | * Authors: Colin Walters 22 | */ 23 | 24 | #include 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | #if defined __linux || defined __OpenBSD__ 31 | static void 32 | test_platform_argv0 (void) 33 | { 34 | GOptionContext *context; 35 | gboolean arg; 36 | GOptionEntry entries [] = 37 | { { "test", 't', 0, G_OPTION_ARG_STRING, &arg, NULL, NULL }, 38 | { NULL } }; 39 | gboolean retval; 40 | 41 | context = g_option_context_new (NULL); 42 | g_option_context_add_main_entries (context, entries, NULL); 43 | 44 | retval = g_option_context_parse (context, NULL, NULL, NULL); 45 | g_assert (retval == TRUE); 46 | g_assert (strcmp (g_get_prgname(), "option-argv0") == 0 47 | || strcmp (g_get_prgname (), "lt-option-argv0") == 0); 48 | 49 | g_option_context_free (context); 50 | } 51 | #endif 52 | 53 | int 54 | main (int argc, 55 | char *argv[]) 56 | { 57 | g_test_init (&argc, &argv, "no_g_set_prgname", NULL); 58 | 59 | #if defined __linux || defined __OpenBSD__ 60 | g_test_add_func ("/option/argv0", test_platform_argv0); 61 | #endif 62 | 63 | return g_test_run (); 64 | } 65 | -------------------------------------------------------------------------------- /glib/gversion.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | 18 | /* 19 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 20 | * file for a list of people on the GLib Team. See the ChangeLog 21 | * files for a list of changes. These files are distributed with 22 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 23 | */ 24 | 25 | #ifndef __G_VERSION_H__ 26 | #define __G_VERSION_H__ 27 | 28 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 29 | #error "Only can be included directly." 30 | #endif 31 | 32 | #include 33 | 34 | G_BEGIN_DECLS 35 | 36 | GLIB_VAR const guint glib_major_version; 37 | GLIB_VAR const guint glib_minor_version; 38 | GLIB_VAR const guint glib_micro_version; 39 | GLIB_VAR const guint glib_interface_age; 40 | GLIB_VAR const guint glib_binary_age; 41 | 42 | GLIB_AVAILABLE_IN_ALL 43 | const gchar * glib_check_version (guint required_major, 44 | guint required_minor, 45 | guint required_micro); 46 | 47 | #define GLIB_CHECK_VERSION(major,minor,micro) \ 48 | (GLIB_MAJOR_VERSION > (major) || \ 49 | (GLIB_MAJOR_VERSION == (major) && GLIB_MINOR_VERSION > (minor)) || \ 50 | (GLIB_MAJOR_VERSION == (major) && GLIB_MINOR_VERSION == (minor) && \ 51 | GLIB_MICRO_VERSION >= (micro))) 52 | 53 | G_END_DECLS 54 | 55 | #endif /* __G_VERSION_H__ */ 56 | -------------------------------------------------------------------------------- /glib/gprintf.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997, 2002 Peter Mattis, Red Hat, Inc. 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | 18 | #ifndef __G_PRINTF_H__ 19 | #define __G_PRINTF_H__ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | G_BEGIN_DECLS 26 | 27 | GLIB_AVAILABLE_IN_ALL 28 | gint g_printf (gchar const *format, 29 | ...) G_GNUC_PRINTF (1, 2); 30 | GLIB_AVAILABLE_IN_ALL 31 | gint g_fprintf (FILE *file, 32 | gchar const *format, 33 | ...) G_GNUC_PRINTF (2, 3); 34 | GLIB_AVAILABLE_IN_ALL 35 | gint g_sprintf (gchar *string, 36 | gchar const *format, 37 | ...) G_GNUC_PRINTF (2, 3); 38 | 39 | GLIB_AVAILABLE_IN_ALL 40 | gint g_vprintf (gchar const *format, 41 | va_list args) G_GNUC_PRINTF(1, 0); 42 | GLIB_AVAILABLE_IN_ALL 43 | gint g_vfprintf (FILE *file, 44 | gchar const *format, 45 | va_list args) G_GNUC_PRINTF(2, 0); 46 | GLIB_AVAILABLE_IN_ALL 47 | gint g_vsprintf (gchar *string, 48 | gchar const *format, 49 | va_list args) G_GNUC_PRINTF(2, 0); 50 | GLIB_AVAILABLE_IN_ALL 51 | gint g_vasprintf (gchar **string, 52 | gchar const *format, 53 | va_list args) G_GNUC_PRINTF(2, 0); 54 | 55 | G_END_DECLS 56 | 57 | #endif /* __G_PRINTF_H__ */ 58 | -------------------------------------------------------------------------------- /glib/tests/search-utils.c: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | #include 4 | #include 5 | 6 | typedef struct 7 | { 8 | const gchar *string; 9 | const gchar *prefix; 10 | gboolean should_match; 11 | } SearchTest; 12 | 13 | static void 14 | test_search (void) 15 | { 16 | SearchTest tests[] = 17 | { 18 | /* Test word separators and case */ 19 | { "Hello World", "he", TRUE }, 20 | { "Hello World", "wo", TRUE }, 21 | { "Hello World", "lo", FALSE }, 22 | { "Hello World", "ld", FALSE }, 23 | { "Hello-World", "wo", TRUE }, 24 | { "HelloWorld", "wo", FALSE }, 25 | 26 | /* Test composed chars (accentued letters) */ 27 | { "Jörgen", "jor", TRUE }, 28 | { "Gaëtan", "gaetan", TRUE }, 29 | { "élève", "ele", TRUE }, 30 | { "Azais", "AzaÏs", FALSE }, 31 | { "AzaÏs", "Azais", TRUE }, 32 | 33 | /* Test decomposed chars, they looks the same, but are actually 34 | * composed of multiple unicodes */ 35 | { "Jorgen", "Jör", FALSE }, 36 | { "Jörgen", "jor", TRUE }, 37 | 38 | /* Turkish special case */ 39 | { "İstanbul", "ist", TRUE }, 40 | { "Diyarbakır", "diyarbakir", TRUE }, 41 | 42 | /* Multi words */ 43 | { "Xavier Claessens", "Xav Cla", TRUE }, 44 | { "Xavier Claessens", "Cla Xav", TRUE }, 45 | { "Foo Bar Baz", " b ", TRUE }, 46 | { "Foo Bar Baz", "bar bazz", FALSE }, 47 | 48 | { NULL, NULL, FALSE } 49 | }; 50 | guint i; 51 | 52 | setlocale(LC_ALL, ""); 53 | 54 | g_debug ("Started"); 55 | for (i = 0; tests[i].string != NULL; i ++) 56 | { 57 | gboolean match; 58 | gboolean ok; 59 | 60 | match = g_str_match_string (tests[i].prefix, tests[i].string, TRUE); 61 | ok = (match == tests[i].should_match); 62 | 63 | g_debug ("'%s' - '%s' %s: %s", tests[i].prefix, tests[i].string, 64 | tests[i].should_match ? "should match" : "should NOT match", 65 | ok ? "OK" : "FAILED"); 66 | 67 | g_assert (ok); 68 | } 69 | } 70 | 71 | int 72 | main (int argc, 73 | char **argv) 74 | { 75 | g_test_init (&argc, &argv, NULL); 76 | 77 | g_test_add_func ("/search", test_search); 78 | 79 | return g_test_run (); 80 | } 81 | -------------------------------------------------------------------------------- /glib/gmappedfile.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * gmappedfile.h: Simplified wrapper around the mmap function 3 | * 4 | * Copyright 2005 Matthias Clasen 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, see . 18 | */ 19 | 20 | #ifndef __G_MAPPED_FILE_H__ 21 | #define __G_MAPPED_FILE_H__ 22 | 23 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 24 | #error "Only can be included directly." 25 | #endif 26 | 27 | #include 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | typedef struct _GMappedFile GMappedFile; 33 | 34 | GLIB_AVAILABLE_IN_ALL 35 | GMappedFile *g_mapped_file_new (const gchar *filename, 36 | gboolean writable, 37 | GError **error) G_GNUC_MALLOC; 38 | GLIB_AVAILABLE_IN_ALL 39 | GMappedFile *g_mapped_file_new_from_fd (gint fd, 40 | gboolean writable, 41 | GError **error) G_GNUC_MALLOC; 42 | GLIB_AVAILABLE_IN_ALL 43 | gsize g_mapped_file_get_length (GMappedFile *file); 44 | GLIB_AVAILABLE_IN_ALL 45 | gchar *g_mapped_file_get_contents (GMappedFile *file); 46 | GLIB_AVAILABLE_IN_2_34 47 | GBytes * g_mapped_file_get_bytes (GMappedFile *file); 48 | GLIB_AVAILABLE_IN_ALL 49 | GMappedFile *g_mapped_file_ref (GMappedFile *file); 50 | GLIB_AVAILABLE_IN_ALL 51 | void g_mapped_file_unref (GMappedFile *file); 52 | 53 | GLIB_DEPRECATED_FOR(g_mapped_file_unref) 54 | void g_mapped_file_free (GMappedFile *file); 55 | 56 | G_END_DECLS 57 | 58 | #endif /* __G_MAPPED_FILE_H__ */ 59 | -------------------------------------------------------------------------------- /glib/gdir.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * gdir.c: Simplified wrapper around the DIRENT functions. 5 | * 6 | * Copyright 2001 Hans Breuer 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, see . 20 | */ 21 | 22 | #ifndef __G_DIR_H__ 23 | #define __G_DIR_H__ 24 | 25 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 26 | #error "Only can be included directly." 27 | #endif 28 | 29 | #include 30 | 31 | #ifdef G_OS_UNIX 32 | #include 33 | #endif 34 | 35 | G_BEGIN_DECLS 36 | 37 | typedef struct _GDir GDir; 38 | 39 | GLIB_AVAILABLE_IN_ALL 40 | GDir * g_dir_open (const gchar *path, 41 | guint flags, 42 | GError **error); 43 | GLIB_AVAILABLE_IN_ALL 44 | const gchar * g_dir_read_name (GDir *dir); 45 | GLIB_AVAILABLE_IN_ALL 46 | void g_dir_rewind (GDir *dir); 47 | GLIB_AVAILABLE_IN_ALL 48 | void g_dir_close (GDir *dir); 49 | 50 | #ifdef G_OS_WIN32 51 | #define g_dir_open g_dir_open_utf8 52 | #define g_dir_read_name g_dir_read_name_utf8 53 | 54 | GLIB_AVAILABLE_IN_ALL 55 | GDir *g_dir_open_utf8 (const gchar *path, 56 | guint flags, 57 | GError **error); 58 | GLIB_AVAILABLE_IN_ALL 59 | const gchar *g_dir_read_name_utf8 (GDir *dir); 60 | #endif /* G_OS_WIN32 */ 61 | 62 | G_END_DECLS 63 | 64 | #endif /* __G_DIR_H__ */ 65 | -------------------------------------------------------------------------------- /glib/gstringchunk.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | 18 | /* 19 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 20 | * file for a list of people on the GLib Team. See the ChangeLog 21 | * files for a list of changes. These files are distributed with 22 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 23 | */ 24 | 25 | #ifndef __G_STRINGCHUNK_H__ 26 | #define __G_STRINGCHUNK_H__ 27 | 28 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 29 | #error "Only can be included directly." 30 | #endif 31 | 32 | #include 33 | 34 | G_BEGIN_DECLS 35 | 36 | typedef struct _GStringChunk GStringChunk; 37 | 38 | GLIB_AVAILABLE_IN_ALL 39 | GStringChunk* g_string_chunk_new (gsize size); 40 | GLIB_AVAILABLE_IN_ALL 41 | void g_string_chunk_free (GStringChunk *chunk); 42 | GLIB_AVAILABLE_IN_ALL 43 | void g_string_chunk_clear (GStringChunk *chunk); 44 | GLIB_AVAILABLE_IN_ALL 45 | gchar* g_string_chunk_insert (GStringChunk *chunk, 46 | const gchar *string); 47 | GLIB_AVAILABLE_IN_ALL 48 | gchar* g_string_chunk_insert_len (GStringChunk *chunk, 49 | const gchar *string, 50 | gssize len); 51 | GLIB_AVAILABLE_IN_ALL 52 | gchar* g_string_chunk_insert_const (GStringChunk *chunk, 53 | const gchar *string); 54 | 55 | G_END_DECLS 56 | 57 | #endif /* __G_STRING_H__ */ 58 | -------------------------------------------------------------------------------- /glib/tests/642026.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Simon McVittie 3 | * Copyright © 2011 Nokia Corporation 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * See the included COPYING file for more information. 11 | */ 12 | 13 | #define GLIB_DISABLE_DEPRECATION_WARNINGS 14 | 15 | #include 16 | 17 | /* On smcv's laptop, 1e4 iterations didn't always exhibit the bug, but 1e5 18 | * iterations exhibited it 10/10 times in practice. YMMV. */ 19 | #define ITERATIONS 100000 20 | 21 | static GStaticPrivate sp; 22 | static GMutex *mutex; 23 | static GCond *cond; 24 | static guint i; 25 | 26 | static volatile gint freed = 0; 27 | 28 | static void 29 | notify (gpointer p) 30 | { 31 | if (!g_atomic_int_compare_and_exchange (&freed, 0, 1)) 32 | { 33 | g_error ("someone already freed it after %u iterations", i); 34 | } 35 | } 36 | 37 | static gpointer thread_func (gpointer nil) 38 | { 39 | /* wait for main thread to reach its g_cond_wait call */ 40 | g_mutex_lock (mutex); 41 | 42 | g_static_private_set (&sp, &sp, notify); 43 | g_cond_broadcast (cond); 44 | g_mutex_unlock (mutex); 45 | 46 | return nil; 47 | } 48 | 49 | static void 50 | testcase (void) 51 | { 52 | g_test_bug ("642026"); 53 | 54 | mutex = g_mutex_new (); 55 | cond = g_cond_new (); 56 | 57 | g_mutex_lock (mutex); 58 | 59 | for (i = 0; i < ITERATIONS; i++) 60 | { 61 | GThread *t1; 62 | 63 | g_static_private_init (&sp); 64 | freed = 0; 65 | 66 | t1 = g_thread_create (thread_func, NULL, TRUE, NULL); 67 | 68 | /* wait for t1 to set up its thread-private data */ 69 | g_cond_wait (cond, mutex); 70 | 71 | /* exercise the bug, by racing with t1 to free the private data */ 72 | g_static_private_free (&sp); 73 | g_thread_join (t1); 74 | } 75 | 76 | g_cond_free (cond); 77 | g_mutex_unlock (mutex); 78 | g_mutex_free (mutex); 79 | } 80 | 81 | int 82 | main (int argc, 83 | char **argv) 84 | { 85 | g_test_init (&argc, &argv, NULL); 86 | g_test_bug_base ("https://bugzilla.gnome.org/show_bug.cgi?id="); 87 | 88 | g_test_add_func ("/glib/642026", testcase); 89 | 90 | return g_test_run (); 91 | } 92 | -------------------------------------------------------------------------------- /glib/gnulib/printf-parse.h: -------------------------------------------------------------------------------- 1 | /* Parse printf format string. 2 | Copyright (C) 1999, 2002 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program 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 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, see . */ 16 | 17 | #ifndef _PRINTF_PARSE_H 18 | #define _PRINTF_PARSE_H 19 | 20 | #include "printf-args.h" 21 | 22 | /* Private namespace for gnulib functions */ 23 | #define printf_parse _g_gnulib_printf_parse 24 | 25 | /* Flags */ 26 | #define FLAG_GROUP 1 /* ' flag */ 27 | #define FLAG_LEFT 2 /* - flag */ 28 | #define FLAG_SHOWSIGN 4 /* + flag */ 29 | #define FLAG_SPACE 8 /* space flag */ 30 | #define FLAG_ALT 16 /* # flag */ 31 | #define FLAG_ZERO 32 32 | 33 | /* A parsed directive. */ 34 | typedef struct 35 | { 36 | const char* dir_start; 37 | const char* dir_end; 38 | int flags; 39 | const char* width_start; 40 | const char* width_end; 41 | int width_arg_index; 42 | const char* precision_start; 43 | const char* precision_end; 44 | int precision_arg_index; 45 | char conversion; /* d i o u x X f e E g G c s p n U % but not C S */ 46 | int arg_index; 47 | } 48 | char_directive; 49 | 50 | /* A parsed format string. */ 51 | typedef struct 52 | { 53 | unsigned int count; 54 | char_directive *dir; 55 | unsigned int max_width_length; 56 | unsigned int max_precision_length; 57 | } 58 | char_directives; 59 | 60 | 61 | /* Parses the format string. Fills in the number N of directives, and fills 62 | in directives[0], ..., directives[N-1], and sets directives[N].dir_start 63 | to the end of the format string. Also fills in the arg_type fields of the 64 | arguments and the needed count of arguments. */ 65 | #ifdef STATIC 66 | STATIC 67 | #else 68 | extern 69 | #endif 70 | int printf_parse (const char *format, char_directives *d, arguments *a); 71 | 72 | #endif /* _PRINTF_PARSE_H */ 73 | -------------------------------------------------------------------------------- /glib/gunibreak.c: -------------------------------------------------------------------------------- 1 | /* gunibreak.c - line break properties 2 | * 3 | * Copyright 2000 Red Hat, Inc. 4 | * 5 | * The Gnome Library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * The Gnome Library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the Gnome Library; see the file COPYING.LIB. If not, 17 | * see . 18 | */ 19 | 20 | #include "config.h" 21 | 22 | #include 23 | 24 | #include "gunibreak.h" 25 | 26 | #define TPROP_PART1(Page, Char) \ 27 | ((break_property_table_part1[Page] >= G_UNICODE_MAX_TABLE_INDEX) \ 28 | ? (break_property_table_part1[Page] - G_UNICODE_MAX_TABLE_INDEX) \ 29 | : (break_property_data[break_property_table_part1[Page]][Char])) 30 | 31 | #define TPROP_PART2(Page, Char) \ 32 | ((break_property_table_part2[Page] >= G_UNICODE_MAX_TABLE_INDEX) \ 33 | ? (break_property_table_part2[Page] - G_UNICODE_MAX_TABLE_INDEX) \ 34 | : (break_property_data[break_property_table_part2[Page]][Char])) 35 | 36 | #define PROP(Char) \ 37 | (((Char) <= G_UNICODE_LAST_CHAR_PART1) \ 38 | ? TPROP_PART1 ((Char) >> 8, (Char) & 0xff) \ 39 | : (((Char) >= 0xe0000 && (Char) <= G_UNICODE_LAST_CHAR) \ 40 | ? TPROP_PART2 (((Char) - 0xe0000) >> 8, (Char) & 0xff) \ 41 | : G_UNICODE_BREAK_UNKNOWN)) 42 | 43 | /** 44 | * g_unichar_break_type: 45 | * @c: a Unicode character 46 | * 47 | * Determines the break type of @c. @c should be a Unicode character 48 | * (to derive a character from UTF-8 encoded text, use 49 | * g_utf8_get_char()). The break type is used to find word and line 50 | * breaks ("text boundaries"), Pango implements the Unicode boundary 51 | * resolution algorithms and normally you would use a function such 52 | * as pango_break() instead of caring about break types yourself. 53 | * 54 | * Returns: the break type of @c 55 | **/ 56 | GUnicodeBreakType 57 | g_unichar_break_type (gunichar c) 58 | { 59 | return PROP (c); 60 | } 61 | -------------------------------------------------------------------------------- /glib/gnulib/vasnprintf.h: -------------------------------------------------------------------------------- 1 | /* vsprintf with automatic memory allocation. 2 | Copyright (C) 2002-2003 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU Library General Public License as published 6 | by the Free Software Foundation; either version 2, or (at your option) 7 | any later version. 8 | 9 | This program 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 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this program; if not, see . */ 16 | 17 | #ifndef _VASNPRINTF_H 18 | #define _VASNPRINTF_H 19 | 20 | /* Get va_list. */ 21 | #include 22 | 23 | /* Get size_t. */ 24 | #include 25 | 26 | #ifndef __attribute__ 27 | /* This feature is available in gcc versions 2.5 and later. */ 28 | # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ 29 | # define __attribute__(Spec) /* empty */ 30 | # endif 31 | /* The __-protected variants of `format' and `printf' attributes 32 | are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ 33 | # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) 34 | # define __format__ format 35 | # define __printf__ printf 36 | # endif 37 | #endif 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | /* Write formatted output to a string dynamically allocated with malloc(). 44 | You can pass a preallocated buffer for the result in RESULTBUF and its 45 | size in *LENGTHP; otherwise you pass RESULTBUF = NULL. 46 | If successful, return the address of the string (this may be = RESULTBUF 47 | if no dynamic memory allocation was necessary) and set *LENGTHP to the 48 | number of resulting bytes, excluding the trailing NUL. Upon error, set 49 | errno and return NULL. */ 50 | extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) 51 | __attribute__ ((__format__ (__printf__, 3, 4))); 52 | extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args) 53 | __attribute__ ((__format__ (__printf__, 3, 0))); 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | #endif /* _VASNPRINTF_H */ 60 | -------------------------------------------------------------------------------- /glib/libcharset/libcharset-glib.patch: -------------------------------------------------------------------------------- 1 | # Patch against libcharset version 1.4 2 | --- libiconv-1.12/libcharset//lib/localcharset.c 2006-10-18 07:55:49.000000000 -0400 3 | +++ localcharset.c 2008-05-20 18:36:24.000000000 -0400 4 | @@ -103,8 +103,8 @@ 5 | static const char * volatile charset_aliases; 6 | 7 | /* Return a pointer to the contents of the charset.alias file. */ 8 | -static const char * 9 | -get_charset_aliases (void) 10 | +const char * 11 | +_g_locale_get_charset_aliases (void) 12 | { 13 | const char *cp; 14 | 15 | @@ -280,14 +280,10 @@ 16 | If the canonical name cannot be determined, the result is a non-canonical 17 | name. */ 18 | 19 | -#ifdef STATIC 20 | -STATIC 21 | -#endif 22 | const char * 23 | -locale_charset (void) 24 | +_g_locale_charset_raw (void) 25 | { 26 | const char *codeset; 27 | - const char *aliases; 28 | 29 | #if !(defined WIN32_NATIVE || defined OS2) 30 | 31 | @@ -436,12 +432,20 @@ 32 | 33 | #endif 34 | 35 | + return codeset; 36 | +} 37 | + 38 | +const char * 39 | +_g_locale_charset_unalias (const char *codeset) 40 | +{ 41 | + const char *aliases; 42 | + 43 | if (codeset == NULL) 44 | /* The canonical name cannot be determined. */ 45 | codeset = ""; 46 | 47 | /* Resolve alias. */ 48 | - for (aliases = get_charset_aliases (); 49 | + for (aliases = _g_locale_get_charset_aliases (); 50 | *aliases != '\0'; 51 | aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1) 52 | if (strcmp (codeset, aliases) == 0 53 | --- libiconv-1.12/libcharset//include/libcharset.h.in 2005-05-19 13:14:56.000000000 -0400 54 | +++ libcharset.h 2008-05-20 18:39:44.000000000 -0400 55 | @@ -19,7 +19,7 @@ 56 | #ifndef _LIBCHARSET_H 57 | #define _LIBCHARSET_H 58 | 59 | -#include 60 | +#include "localcharset.h" 61 | 62 | 63 | #ifdef __cplusplus 64 | --- libiconv-1.12/libcharset//include/localcharset.h.in 2005-05-19 13:14:57.000000000 -0400 65 | +++ localcharset.h 2008-05-20 18:36:24.000000000 -0400 66 | @@ -31,8 +31,9 @@ 67 | The result must not be freed; it is statically allocated. 68 | If the canonical name cannot be determined, the result is a non-canonical 69 | name. */ 70 | -extern const char * locale_charset (void); 71 | - 72 | +extern const char * _g_locale_charset_raw (void); 73 | +extern const char * _g_locale_charset_unalias (const char *codeset); 74 | +extern const char * _g_locale_get_charset_aliases (void); 75 | 76 | #ifdef __cplusplus 77 | } 78 | -------------------------------------------------------------------------------- /glib/gthreadprivate.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * 3 | * gthreadprivate.h - GLib internal thread system related declarations. 4 | * 5 | * Copyright (C) 2003 Sebastian Wilhelmi 6 | * 7 | * The Gnome Library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation; either version 2 of the 10 | * License, or (at your option) any later version. 11 | * 12 | * The Gnome Library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with the Gnome Library; see the file COPYING.LIB. If not, 19 | * see . 20 | */ 21 | 22 | #ifndef __G_THREADPRIVATE_H__ 23 | #define __G_THREADPRIVATE_H__ 24 | 25 | #include "deprecated/gthread.h" 26 | typedef struct _GRealThread GRealThread; 27 | struct _GRealThread 28 | { 29 | GThread thread; 30 | 31 | gint ref_count; 32 | gboolean ours; 33 | gchar *name; 34 | gpointer retval; 35 | }; 36 | 37 | /* system thread implementation (gthread-posix.c, gthread-win32.c) */ 38 | void g_system_thread_wait (GRealThread *thread); 39 | 40 | GRealThread * g_system_thread_new (GThreadFunc func, 41 | gulong stack_size, 42 | GError **error); 43 | void g_system_thread_free (GRealThread *thread); 44 | 45 | void g_system_thread_exit (void); 46 | void g_system_thread_set_name (const gchar *name); 47 | 48 | 49 | /* gthread.c */ 50 | GThread * g_thread_new_internal (const gchar *name, 51 | GThreadFunc proxy, 52 | GThreadFunc func, 53 | gpointer data, 54 | gsize stack_size, 55 | GError **error); 56 | 57 | gpointer g_thread_proxy (gpointer thread); 58 | 59 | #endif /* __G_THREADPRIVATE_H__ */ 60 | -------------------------------------------------------------------------------- /glib/gprimes.c: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | 18 | /* 19 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 20 | * file for a list of people on the GLib Team. See the ChangeLog 21 | * files for a list of changes. These files are distributed with 22 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 23 | */ 24 | 25 | /* 26 | * MT safe 27 | */ 28 | 29 | #include "config.h" 30 | 31 | #include "gprimes.h" 32 | 33 | 34 | static const guint g_primes[] = 35 | { 36 | 11, 37 | 19, 38 | 37, 39 | 73, 40 | 109, 41 | 163, 42 | 251, 43 | 367, 44 | 557, 45 | 823, 46 | 1237, 47 | 1861, 48 | 2777, 49 | 4177, 50 | 6247, 51 | 9371, 52 | 14057, 53 | 21089, 54 | 31627, 55 | 47431, 56 | 71143, 57 | 106721, 58 | 160073, 59 | 240101, 60 | 360163, 61 | 540217, 62 | 810343, 63 | 1215497, 64 | 1823231, 65 | 2734867, 66 | 4102283, 67 | 6153409, 68 | 9230113, 69 | 13845163, 70 | }; 71 | 72 | /** 73 | * g_spaced_primes_closest: 74 | * @num: a #guint 75 | * 76 | * Gets the smallest prime number from a built-in array of primes which 77 | * is larger than @num. This is used within GLib to calculate the optimum 78 | * size of a #GHashTable. 79 | * 80 | * The built-in array of primes ranges from 11 to 13845163 such that 81 | * each prime is approximately 1.5-2 times the previous prime. 82 | * 83 | * Returns: the smallest prime number from a built-in array of primes 84 | * which is larger than @num 85 | */ 86 | guint 87 | g_spaced_primes_closest (guint num) 88 | { 89 | gint i; 90 | 91 | for (i = 0; i < G_N_ELEMENTS (g_primes); i++) 92 | if (g_primes[i] > num) 93 | return g_primes[i]; 94 | 95 | return g_primes[G_N_ELEMENTS (g_primes) - 1]; 96 | } 97 | -------------------------------------------------------------------------------- /glib/gbase64.h: -------------------------------------------------------------------------------- 1 | /* gbase64.h - Base64 coding functions 2 | * 3 | * Copyright (C) 2005 Alexander Larsson 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, see . 17 | */ 18 | 19 | #ifndef __G_BASE64_H__ 20 | #define __G_BASE64_H__ 21 | 22 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 23 | #error "Only can be included directly." 24 | #endif 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | GLIB_AVAILABLE_IN_ALL 31 | gsize g_base64_encode_step (const guchar *in, 32 | gsize len, 33 | gboolean break_lines, 34 | gchar *out, 35 | gint *state, 36 | gint *save); 37 | GLIB_AVAILABLE_IN_ALL 38 | gsize g_base64_encode_close (gboolean break_lines, 39 | gchar *out, 40 | gint *state, 41 | gint *save); 42 | GLIB_AVAILABLE_IN_ALL 43 | gchar* g_base64_encode (const guchar *data, 44 | gsize len) G_GNUC_MALLOC; 45 | GLIB_AVAILABLE_IN_ALL 46 | gsize g_base64_decode_step (const gchar *in, 47 | gsize len, 48 | guchar *out, 49 | gint *state, 50 | guint *save); 51 | GLIB_AVAILABLE_IN_ALL 52 | guchar *g_base64_decode (const gchar *text, 53 | gsize *out_len) G_GNUC_MALLOC; 54 | GLIB_AVAILABLE_IN_ALL 55 | guchar *g_base64_decode_inplace (gchar *text, 56 | gsize *out_len); 57 | 58 | 59 | G_END_DECLS 60 | 61 | #endif /* __G_BASE64_H__ */ 62 | -------------------------------------------------------------------------------- /glib/ggettext.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | 18 | /* 19 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 20 | * file for a list of people on the GLib Team. See the ChangeLog 21 | * files for a list of changes. These files are distributed with 22 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 23 | */ 24 | 25 | #ifndef __G_GETTEXT_H__ 26 | #define __G_GETTEXT_H__ 27 | 28 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 29 | #error "Only can be included directly." 30 | #endif 31 | 32 | #include 33 | 34 | G_BEGIN_DECLS 35 | 36 | GLIB_AVAILABLE_IN_ALL 37 | const gchar *g_strip_context (const gchar *msgid, 38 | const gchar *msgval) G_GNUC_FORMAT(1); 39 | 40 | GLIB_AVAILABLE_IN_ALL 41 | const gchar *g_dgettext (const gchar *domain, 42 | const gchar *msgid) G_GNUC_FORMAT(2); 43 | GLIB_AVAILABLE_IN_ALL 44 | const gchar *g_dcgettext (const gchar *domain, 45 | const gchar *msgid, 46 | gint category) G_GNUC_FORMAT(2); 47 | GLIB_AVAILABLE_IN_ALL 48 | const gchar *g_dngettext (const gchar *domain, 49 | const gchar *msgid, 50 | const gchar *msgid_plural, 51 | gulong n) G_GNUC_FORMAT(3); 52 | GLIB_AVAILABLE_IN_ALL 53 | const gchar *g_dpgettext (const gchar *domain, 54 | const gchar *msgctxtid, 55 | gsize msgidoffset) G_GNUC_FORMAT(2); 56 | GLIB_AVAILABLE_IN_ALL 57 | const gchar *g_dpgettext2 (const gchar *domain, 58 | const gchar *context, 59 | const gchar *msgid) G_GNUC_FORMAT(3); 60 | 61 | G_END_DECLS 62 | 63 | #endif /* __G_GETTEXT_H__ */ 64 | -------------------------------------------------------------------------------- /glib/gtimer.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | 18 | /* 19 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 20 | * file for a list of people on the GLib Team. See the ChangeLog 21 | * files for a list of changes. These files are distributed with 22 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 23 | */ 24 | 25 | #ifndef __G_TIMER_H__ 26 | #define __G_TIMER_H__ 27 | 28 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 29 | #error "Only can be included directly." 30 | #endif 31 | 32 | #include 33 | 34 | G_BEGIN_DECLS 35 | 36 | /* Timer 37 | */ 38 | 39 | /* microseconds per second */ 40 | typedef struct _GTimer GTimer; 41 | 42 | #define G_USEC_PER_SEC 1000000 43 | 44 | GLIB_AVAILABLE_IN_ALL 45 | GTimer* g_timer_new (void); 46 | GLIB_AVAILABLE_IN_ALL 47 | void g_timer_destroy (GTimer *timer); 48 | GLIB_AVAILABLE_IN_ALL 49 | void g_timer_start (GTimer *timer); 50 | GLIB_AVAILABLE_IN_ALL 51 | void g_timer_stop (GTimer *timer); 52 | GLIB_AVAILABLE_IN_ALL 53 | void g_timer_reset (GTimer *timer); 54 | GLIB_AVAILABLE_IN_ALL 55 | void g_timer_continue (GTimer *timer); 56 | GLIB_AVAILABLE_IN_ALL 57 | gdouble g_timer_elapsed (GTimer *timer, 58 | gulong *microseconds); 59 | 60 | GLIB_AVAILABLE_IN_ALL 61 | void g_usleep (gulong microseconds); 62 | 63 | GLIB_AVAILABLE_IN_ALL 64 | void g_time_val_add (GTimeVal *time_, 65 | glong microseconds); 66 | GLIB_AVAILABLE_IN_ALL 67 | gboolean g_time_val_from_iso8601 (const gchar *iso_date, 68 | GTimeVal *time_); 69 | GLIB_AVAILABLE_IN_ALL 70 | gchar* g_time_val_to_iso8601 (GTimeVal *time_) G_GNUC_MALLOC; 71 | 72 | G_END_DECLS 73 | 74 | #endif /* __G_TIMER_H__ */ 75 | -------------------------------------------------------------------------------- /glib/gbacktrace.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | 18 | /* 19 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 20 | * file for a list of people on the GLib Team. See the ChangeLog 21 | * files for a list of changes. These files are distributed with 22 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 23 | */ 24 | 25 | #ifndef __G_BACKTRACE_H__ 26 | #define __G_BACKTRACE_H__ 27 | 28 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 29 | #error "Only can be included directly." 30 | #endif 31 | 32 | #include 33 | #include 34 | 35 | G_BEGIN_DECLS 36 | 37 | GLIB_AVAILABLE_IN_ALL 38 | void g_on_error_query (const gchar *prg_name); 39 | GLIB_AVAILABLE_IN_ALL 40 | void g_on_error_stack_trace (const gchar *prg_name); 41 | 42 | /** 43 | * G_BREAKPOINT: 44 | * 45 | * Inserts a breakpoint instruction into the code. 46 | * 47 | * On x86 and alpha systems this is implemented as a soft interrupt 48 | * and on other architectures it raises a `SIGTRAP` signal. 49 | */ 50 | #if (defined (__i386__) || defined (__x86_64__)) && defined (__GNUC__) && __GNUC__ >= 2 51 | # define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("int $03"); }G_STMT_END 52 | #elif (defined (_MSC_VER) || defined (__DMC__)) && defined (_M_IX86) 53 | # define G_BREAKPOINT() G_STMT_START{ __asm int 3h }G_STMT_END 54 | #elif defined (_MSC_VER) 55 | # define G_BREAKPOINT() G_STMT_START{ __debugbreak(); }G_STMT_END 56 | #elif defined (__alpha__) && !defined(__osf__) && defined (__GNUC__) && __GNUC__ >= 2 57 | # define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("bpt"); }G_STMT_END 58 | #else /* !__i386__ && !__alpha__ */ 59 | # define G_BREAKPOINT() G_STMT_START{ raise (SIGTRAP); }G_STMT_END 60 | #endif /* __i386__ */ 61 | 62 | G_END_DECLS 63 | 64 | #endif /* __G_BACKTRACE_H__ */ 65 | -------------------------------------------------------------------------------- /glib/tests/hook.c: -------------------------------------------------------------------------------- 1 | /* Unit tests for hook lists 2 | * Copyright (C) 2011 Red Hat, Inc. 3 | * 4 | * This work is provided "as is"; redistribution and modification 5 | * in whole or in part, in any medium, physical or electronic is 6 | * permitted without restriction. 7 | * 8 | * This work is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | * 12 | * In no event shall the authors or contributors be liable for any 13 | * direct, indirect, incidental, special, exemplary, or consequential 14 | * damages (including, but not limited to, procurement of substitute 15 | * goods or services; loss of use, data, or profits; or business 16 | * interruption) however caused and on any theory of liability, whether 17 | * in contract, strict liability, or tort (including negligence or 18 | * otherwise) arising in any way out of the use of this software, even 19 | * if advised of the possibility of such damage. 20 | * 21 | * Author: Matthias Clasen 22 | */ 23 | 24 | #include "glib.h" 25 | 26 | static void 27 | hook_func (gpointer data) 28 | { 29 | } 30 | 31 | static void 32 | destroy (gpointer data) 33 | { 34 | } 35 | 36 | static void 37 | test_hook1 (void) 38 | { 39 | GHookList *hl; 40 | GHook *hook; 41 | gulong id; 42 | GHook *h; 43 | 44 | hl = g_new (GHookList, 1); 45 | g_hook_list_init (hl, sizeof (GHook)); 46 | 47 | hook = g_hook_alloc (hl); 48 | hook->data = GINT_TO_POINTER(1); 49 | hook->func = hook_func; 50 | hook->flags = G_HOOK_FLAG_ACTIVE; 51 | hook->destroy = destroy; 52 | g_hook_append (hl, hook); 53 | id = hook->hook_id; 54 | 55 | h = g_hook_get (hl, id); 56 | g_assert (h == hook); 57 | 58 | h = hook = g_hook_alloc (hl); 59 | hook->data = GINT_TO_POINTER(2); 60 | hook->func = hook_func; 61 | hook->flags = G_HOOK_FLAG_ACTIVE; 62 | hook->destroy = destroy; 63 | g_hook_prepend (hl, hook); 64 | 65 | g_hook_destroy (hl, id); 66 | 67 | hook = g_hook_alloc (hl); 68 | hook->data = GINT_TO_POINTER(3); 69 | hook->func = hook_func; 70 | hook->flags = G_HOOK_FLAG_ACTIVE; 71 | hook->destroy = destroy; 72 | g_hook_insert_sorted (hl, hook, g_hook_compare_ids); 73 | 74 | hook = g_hook_alloc (hl); 75 | hook->data = GINT_TO_POINTER(4); 76 | hook->func = hook_func; 77 | hook->flags = G_HOOK_FLAG_ACTIVE; 78 | hook->destroy = destroy; 79 | g_hook_insert_before (hl, h, hook); 80 | 81 | g_hook_list_invoke (hl, TRUE); 82 | 83 | g_hook_list_clear (hl); 84 | g_free (hl); 85 | } 86 | 87 | int main (int argc, char *argv[]) 88 | { 89 | g_test_init (&argc, &argv, NULL); 90 | 91 | g_test_add_func ("/hook/test1", test_hook1); 92 | 93 | return g_test_run (); 94 | } 95 | 96 | -------------------------------------------------------------------------------- /glib/gen-script-table.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # 3 | # Script to convert http://www.unicode.org/Public/UNIDATA/Scripts.txt 4 | # into a machine-readable table. 5 | # 6 | ###################################################################### 7 | 8 | if (@ARGV != 1) { 9 | die "Usage: gen-script-table.pl Scripts.txt > gscripttable.h\n"; 10 | } 11 | 12 | open IN, $ARGV[0] || die "Cannot open $ARGV[0]: $!\n"; 13 | 14 | my @ranges; 15 | my $file; 16 | my $easy_range; 17 | my $i; 18 | my $start; 19 | my $end; 20 | my $script; 21 | 22 | 23 | while () { 24 | if (/^\#\s+(Scripts-.*.txt)/) { 25 | $file = $1; 26 | } 27 | 28 | s/#.*//; 29 | next if /^\s*$/; 30 | if (!/^([0-9A-F]+)(?:\.\.([0-9A-F]+))?\s*;\s*([A-Za-z_]+)\s*$/) { 31 | die "Cannot parse line: '$_'\n"; 32 | } 33 | 34 | if (defined $2) { 35 | push @ranges, [ hex $1, hex $2, uc $3 ]; 36 | } else { 37 | push @ranges, [ hex $1, hex $1, uc $3 ]; 38 | } 39 | } 40 | 41 | @ranges = sort { $a->[0] <=> $b->[0] } @ranges; 42 | $date = gmtime; 43 | 44 | print <<"EOT"; 45 | /* gscripttable.h: Generated by gen-script-table.pl 46 | * 47 | * Date: $date 48 | * Source: $file 49 | * 50 | * Do not edit. 51 | */ 52 | 53 | EOT 54 | 55 | $easy_range = 0x2000; 56 | 57 | print <<"EOT"; 58 | #define G_EASY_SCRIPTS_RANGE $easy_range 59 | 60 | static const guchar g_script_easy_table[$easy_range] = { 61 | EOT 62 | 63 | $i = 0; 64 | $end = -1; 65 | 66 | for (my $c = 0; $c < $easy_range; $c++) { 67 | 68 | if ($c % 3 == 0) { 69 | printf "\n "; 70 | } 71 | 72 | if ($c > $end) { 73 | $start = $ranges[$i]->[0]; 74 | $end = $ranges[$i]->[1]; 75 | $script = $ranges[$i]->[2]; 76 | $i++; 77 | } 78 | 79 | if ($c < $start) { 80 | printf " G_UNICODE_SCRIPT_UNKNOWN,"; 81 | } else { 82 | printf " G_UNICODE_SCRIPT_%s,", $script; 83 | } 84 | } 85 | 86 | if ($end >= $easy_range) { 87 | $i--; 88 | $ranges[$i]->[0] = $easy_range; 89 | } 90 | 91 | 92 | print <<"EOT"; 93 | 94 | }; 95 | 96 | static const struct { 97 | gunichar start; 98 | guint16 chars; 99 | guint16 script; 100 | } g_script_table[] = { 101 | EOT 102 | 103 | for (; $i <= $#ranges; $i++) { 104 | $start = $ranges[$i]->[0]; 105 | $end = $ranges[$i]->[1]; 106 | $script = $ranges[$i]->[2]; 107 | 108 | while ($i <= $#ranges - 1 && 109 | $ranges[$i + 1]->[0] == $end + 1 && 110 | $ranges[$i + 1]->[2] eq $script) { 111 | $i++; 112 | $end = $ranges[$i]->[1]; 113 | } 114 | 115 | printf " { %#06x, %5d, G_UNICODE_SCRIPT_%s },\n", $start, $end - $start + 1, $script; 116 | } 117 | 118 | printf "};\n"; 119 | 120 | -------------------------------------------------------------------------------- /glib/tests/timeout.c: -------------------------------------------------------------------------------- 1 | #include 2 | #ifdef G_OS_UNIX 3 | #include 4 | #endif 5 | 6 | static GMainLoop *loop; 7 | 8 | static gboolean 9 | stop_waiting (gpointer data) 10 | { 11 | g_main_loop_quit (loop); 12 | 13 | return G_SOURCE_REMOVE; 14 | } 15 | 16 | static gboolean 17 | function (gpointer data) 18 | { 19 | g_assert_not_reached (); 20 | 21 | return G_SOURCE_REMOVE; 22 | } 23 | 24 | static void 25 | test_seconds (void) 26 | { 27 | guint id; 28 | 29 | /* Bug 642052 mentions that g_timeout_add_seconds(21475) schedules a 30 | * job that runs once per second. 31 | * 32 | * Test that that isn't true anymore by scheduling two jobs: 33 | * - one, as above 34 | * - another that runs in 2100ms 35 | * 36 | * If everything is working properly, the 2100ms one should run first 37 | * (and exit the mainloop). If we ever see the 21475 second job run 38 | * then we have trouble (since it ran in less than 2 seconds). 39 | * 40 | * We need a timeout of at least 2 seconds because 41 | * g_timeout_add_second can add as much as an additional second of 42 | * latency. 43 | */ 44 | loop = g_main_loop_new (NULL, FALSE); 45 | 46 | g_timeout_add (2100, stop_waiting, NULL); 47 | id = g_timeout_add_seconds (21475, function, NULL); 48 | 49 | g_main_loop_run (loop); 50 | g_main_loop_unref (loop); 51 | 52 | g_source_remove (id); 53 | } 54 | 55 | static gint64 last_time; 56 | static gint count; 57 | 58 | static gboolean 59 | test_func (gpointer data) 60 | { 61 | gint64 current_time; 62 | 63 | current_time = g_get_monotonic_time (); 64 | 65 | /* We accept 2 on the first iteration because _add_seconds() can 66 | * have an initial latency of 1 second, see its documentation. 67 | */ 68 | if (count == 0) 69 | g_assert (current_time / 1000000 - last_time / 1000000 <= 2); 70 | else 71 | g_assert (current_time / 1000000 - last_time / 1000000 == 1); 72 | 73 | last_time = current_time; 74 | count++; 75 | 76 | /* Make the timeout take up to 0.1 seconds. 77 | * We should still get scheduled for the next second. 78 | */ 79 | g_usleep (count * 10000); 80 | 81 | if (count < 10) 82 | return TRUE; 83 | 84 | g_main_loop_quit (loop); 85 | 86 | return FALSE; 87 | } 88 | 89 | static void 90 | test_rounding (void) 91 | { 92 | loop = g_main_loop_new (NULL, FALSE); 93 | 94 | last_time = g_get_monotonic_time (); 95 | g_timeout_add_seconds (1, test_func, NULL); 96 | 97 | g_main_loop_run (loop); 98 | g_main_loop_unref (loop); 99 | } 100 | 101 | int 102 | main (int argc, char *argv[]) 103 | { 104 | g_test_init (&argc, &argv, NULL); 105 | 106 | g_test_add_func ("/timeout/seconds", test_seconds); 107 | g_test_add_func ("/timeout/rounding", test_rounding); 108 | 109 | return g_test_run (); 110 | } 111 | -------------------------------------------------------------------------------- /glib/tests/error.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static void 4 | test_overwrite (void) 5 | { 6 | GError *error, *dest, *src; 7 | 8 | if (!g_test_undefined ()) 9 | return; 10 | 11 | error = g_error_new_literal (G_MARKUP_ERROR, G_MARKUP_ERROR_EMPTY, "bla"); 12 | 13 | g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, 14 | "*set over the top*"); 15 | g_set_error_literal (&error, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "bla"); 16 | g_test_assert_expected_messages (); 17 | 18 | g_assert_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_EMPTY); 19 | g_error_free (error); 20 | 21 | 22 | dest = g_error_new_literal (G_MARKUP_ERROR, G_MARKUP_ERROR_EMPTY, "bla"); 23 | src = g_error_new_literal (G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, "bla"); 24 | 25 | g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, 26 | "*set over the top*"); 27 | g_propagate_error (&dest, src); 28 | g_test_assert_expected_messages (); 29 | 30 | g_assert_error (dest, G_MARKUP_ERROR, G_MARKUP_ERROR_EMPTY); 31 | g_error_free (dest); 32 | } 33 | 34 | static void 35 | test_prefix (void) 36 | { 37 | GError *error; 38 | GError *dest, *src; 39 | 40 | error = NULL; 41 | g_prefix_error (&error, "foo %d %s: ", 1, "two"); 42 | g_assert (error == NULL); 43 | 44 | error = g_error_new_literal (G_MARKUP_ERROR, G_MARKUP_ERROR_EMPTY, "bla"); 45 | g_prefix_error (&error, "foo %d %s: ", 1, "two"); 46 | g_assert_cmpstr (error->message, ==, "foo 1 two: bla"); 47 | g_error_free (error); 48 | 49 | dest = NULL; 50 | src = g_error_new_literal (G_MARKUP_ERROR, G_MARKUP_ERROR_EMPTY, "bla"); 51 | g_propagate_prefixed_error (&dest, src, "foo %d %s: ", 1, "two"); 52 | g_assert_cmpstr (dest->message, ==, "foo 1 two: bla"); 53 | g_error_free (dest); 54 | } 55 | 56 | static void 57 | test_literal (void) 58 | { 59 | GError *error; 60 | 61 | error = NULL; 62 | g_set_error_literal (&error, G_MARKUP_ERROR, G_MARKUP_ERROR_EMPTY, "%s %d %x"); 63 | g_assert_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_EMPTY); 64 | g_assert_cmpstr (error->message, ==, "%s %d %x"); 65 | g_error_free (error); 66 | } 67 | 68 | static void 69 | test_copy (void) 70 | { 71 | GError *error; 72 | GError *copy; 73 | 74 | error = NULL; 75 | g_set_error_literal (&error, G_MARKUP_ERROR, G_MARKUP_ERROR_EMPTY, "%s %d %x"); 76 | copy = g_error_copy (error); 77 | 78 | g_assert_error (copy, G_MARKUP_ERROR, G_MARKUP_ERROR_EMPTY); 79 | g_assert_cmpstr (copy->message, ==, "%s %d %x"); 80 | 81 | g_error_free (error); 82 | g_error_free (copy); 83 | } 84 | 85 | int 86 | main (int argc, char *argv[]) 87 | { 88 | g_test_init (&argc, &argv, NULL); 89 | 90 | g_test_add_func ("/error/overwrite", test_overwrite); 91 | g_test_add_func ("/error/prefix", test_prefix); 92 | g_test_add_func ("/error/literal", test_literal); 93 | g_test_add_func ("/error/copy", test_copy); 94 | 95 | return g_test_run (); 96 | } 97 | 98 | -------------------------------------------------------------------------------- /glib/glib-private.h: -------------------------------------------------------------------------------- 1 | /* glib-private.h - GLib-internal private API, shared between glib, gobject, gio 2 | * Copyright (C) 2011 Red Hat, Inc. 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 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 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, see . 16 | */ 17 | 18 | #ifndef __GLIB_PRIVATE_H__ 19 | #define __GLIB_PRIVATE_H__ 20 | 21 | #include 22 | #include "gwakeup.h" 23 | 24 | #if defined(__GNUC__) 25 | # define _g_alignof(type) (__alignof__ (type)) 26 | #else 27 | # define _g_alignof(type) (G_STRUCT_OFFSET (struct { char a; type b; }, b)) 28 | #endif 29 | 30 | GMainContext * g_get_worker_context (void); 31 | gboolean g_check_setuid (void); 32 | GMainContext * g_main_context_new_with_next_id (guint next_id); 33 | 34 | #ifdef G_OS_WIN32 35 | gchar *_glib_get_dll_directory (void); 36 | GLIB_AVAILABLE_IN_ALL 37 | gchar *_glib_get_locale_dir (void); 38 | #endif 39 | 40 | GDir * g_dir_open_with_errno (const gchar *path, guint flags); 41 | GDir * g_dir_new_from_dirp (gpointer dirp); 42 | 43 | #define GLIB_PRIVATE_CALL(symbol) (glib__private__()->symbol) 44 | 45 | typedef struct { 46 | /* See gwakeup.c */ 47 | GWakeup * (* g_wakeup_new) (void); 48 | void (* g_wakeup_free) (GWakeup *wakeup); 49 | void (* g_wakeup_get_pollfd) (GWakeup *wakeup, 50 | GPollFD *poll_fd); 51 | void (* g_wakeup_signal) (GWakeup *wakeup); 52 | void (* g_wakeup_acknowledge) (GWakeup *wakeup); 53 | 54 | /* See gmain.c */ 55 | GMainContext * (* g_get_worker_context) (void); 56 | 57 | gboolean (* g_check_setuid) (void); 58 | GMainContext * (* g_main_context_new_with_next_id) (guint next_id); 59 | 60 | GDir * (* g_dir_open_with_errno) (const gchar *path, 61 | guint flags); 62 | GDir * (* g_dir_new_from_dirp) (gpointer dirp); 63 | 64 | /* Add other private functions here, initialize them in glib-private.c */ 65 | } GLibPrivateVTable; 66 | 67 | GLIB_AVAILABLE_IN_ALL 68 | GLibPrivateVTable *glib__private__ (void); 69 | 70 | #endif /* __G_MAIN_H__ */ 71 | -------------------------------------------------------------------------------- /glib/gquark.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | 18 | /* 19 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 20 | * file for a list of people on the GLib Team. See the ChangeLog 21 | * files for a list of changes. These files are distributed with 22 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 23 | */ 24 | 25 | #ifndef __G_QUARK_H__ 26 | #define __G_QUARK_H__ 27 | 28 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 29 | #error "Only can be included directly." 30 | #endif 31 | 32 | #include 33 | 34 | G_BEGIN_DECLS 35 | 36 | typedef guint32 GQuark; 37 | 38 | /* Quarks (string<->id association) 39 | */ 40 | GLIB_AVAILABLE_IN_ALL 41 | GQuark g_quark_try_string (const gchar *string); 42 | GLIB_AVAILABLE_IN_ALL 43 | GQuark g_quark_from_static_string (const gchar *string); 44 | GLIB_AVAILABLE_IN_ALL 45 | GQuark g_quark_from_string (const gchar *string); 46 | GLIB_AVAILABLE_IN_ALL 47 | const gchar * g_quark_to_string (GQuark quark) G_GNUC_CONST; 48 | 49 | #define G_DEFINE_QUARK(QN, q_n) \ 50 | GQuark \ 51 | q_n##_quark (void) \ 52 | { \ 53 | static GQuark q; \ 54 | \ 55 | if G_UNLIKELY (q == 0) \ 56 | q = g_quark_from_static_string (#QN); \ 57 | \ 58 | return q; \ 59 | } 60 | 61 | GLIB_AVAILABLE_IN_ALL 62 | const gchar * g_intern_string (const gchar *string); 63 | GLIB_AVAILABLE_IN_ALL 64 | const gchar * g_intern_static_string (const gchar *string); 65 | 66 | G_END_DECLS 67 | 68 | #endif /* __G_QUARK_H__ */ 69 | -------------------------------------------------------------------------------- /glib/gurifuncs.h: -------------------------------------------------------------------------------- 1 | /* GIO - GLib Input, Output and Streaming Library 2 | * 3 | * Copyright (C) 2006-2007 Red Hat, Inc. 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General 16 | * Public License along with this library; if not, see . 17 | * 18 | * Author: Alexander Larsson 19 | */ 20 | 21 | #ifndef __G_URI_FUNCS_H__ 22 | #define __G_URI_FUNCS_H__ 23 | 24 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 25 | #error "Only can be included directly." 26 | #endif 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | /** 33 | * G_URI_RESERVED_CHARS_GENERIC_DELIMITERS: 34 | * 35 | * Generic delimiters characters as defined in RFC 3986. Includes ":/?#[]@". 36 | **/ 37 | #define G_URI_RESERVED_CHARS_GENERIC_DELIMITERS ":/?#[]@" 38 | 39 | /** 40 | * G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS: 41 | * 42 | * Subcomponent delimiter characters as defined in RFC 3986. Includes "!$&'()*+,;=". 43 | **/ 44 | #define G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS "!$&'()*+,;=" 45 | 46 | /** 47 | * G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT: 48 | * 49 | * Allowed characters in path elements. Includes "!$&'()*+,;=:@". 50 | **/ 51 | #define G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS ":@" 52 | 53 | /** 54 | * G_URI_RESERVED_CHARS_ALLOWED_IN_PATH: 55 | * 56 | * Allowed characters in a path. Includes "!$&'()*+,;=:@/". 57 | **/ 58 | #define G_URI_RESERVED_CHARS_ALLOWED_IN_PATH G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT "/" 59 | 60 | /** 61 | * G_URI_RESERVED_CHARS_ALLOWED_IN_USERINFO: 62 | * 63 | * Allowed characters in userinfo as defined in RFC 3986. Includes "!$&'()*+,;=:". 64 | **/ 65 | #define G_URI_RESERVED_CHARS_ALLOWED_IN_USERINFO G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS ":" 66 | 67 | GLIB_AVAILABLE_IN_ALL 68 | char * g_uri_unescape_string (const char *escaped_string, 69 | const char *illegal_characters); 70 | GLIB_AVAILABLE_IN_ALL 71 | char * g_uri_unescape_segment (const char *escaped_string, 72 | const char *escaped_string_end, 73 | const char *illegal_characters); 74 | GLIB_AVAILABLE_IN_ALL 75 | char * g_uri_parse_scheme (const char *uri); 76 | GLIB_AVAILABLE_IN_ALL 77 | char * g_uri_escape_string (const char *unescaped, 78 | const char *reserved_chars_allowed, 79 | gboolean allow_utf8); 80 | 81 | G_END_DECLS 82 | 83 | #endif /* __G_URI_FUNCS_H__ */ 84 | -------------------------------------------------------------------------------- /glib/gtrashstack.c: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1998 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | 18 | /* 19 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 20 | * file for a list of people on the GLib Team. See the ChangeLog 21 | * files for a list of changes. These files are distributed with 22 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 23 | */ 24 | 25 | #include "config.h" 26 | 27 | /** 28 | * SECTION:trash_stack 29 | * @title: Trash Stacks 30 | * @short_description: maintain a stack of unused allocated memory chunks 31 | * 32 | * A #GTrashStack is an efficient way to keep a stack of unused allocated 33 | * memory chunks. Each memory chunk is required to be large enough to hold 34 | * a #gpointer. This allows the stack to be maintained without any space 35 | * overhead, since the stack pointers can be stored inside the memory chunks. 36 | * 37 | * There is no function to create a #GTrashStack. A %NULL #GTrashStack* 38 | * is a perfectly valid empty stack. 39 | */ 40 | 41 | /** 42 | * GTrashStack: 43 | * @next: pointer to the previous element of the stack, 44 | * gets stored in the first `sizeof (gpointer)` 45 | * bytes of the element 46 | * 47 | * Each piece of memory that is pushed onto the stack 48 | * is cast to a GTrashStack*. 49 | */ 50 | 51 | /** 52 | * g_trash_stack_push: 53 | * @stack_p: a #GTrashStack 54 | * @data_p: the piece of memory to push on the stack 55 | * 56 | * Pushes a piece of memory onto a #GTrashStack. 57 | */ 58 | 59 | /** 60 | * g_trash_stack_pop: 61 | * @stack_p: a #GTrashStack 62 | * 63 | * Pops a piece of memory off a #GTrashStack. 64 | * 65 | * Returns: the element at the top of the stack 66 | */ 67 | 68 | /** 69 | * g_trash_stack_peek: 70 | * @stack_p: a #GTrashStack 71 | * 72 | * Returns the element at the top of a #GTrashStack 73 | * which may be %NULL. 74 | * 75 | * Returns: the element at the top of the stack 76 | */ 77 | 78 | /** 79 | * g_trash_stack_height: 80 | * @stack_p: a #GTrashStack 81 | * 82 | * Returns the height of a #GTrashStack. 83 | * 84 | * Note that execution of this function is of O(N) complexity 85 | * where N denotes the number of items on the stack. 86 | * 87 | * Returns: the height of the stack 88 | */ 89 | 90 | #define G_IMPLEMENT_INLINES 1 91 | #define __G_TRASH_STACK_C__ 92 | #include "gtrashstack.h" 93 | -------------------------------------------------------------------------------- /glib/tests/markup.c: -------------------------------------------------------------------------------- 1 | /* Unit tests for GMarkup 2 | * Copyright (C) 2013 Red Hat, Inc. 3 | * 4 | * This work is provided "as is"; redistribution and modification 5 | * in whole or in part, in any medium, physical or electronic is 6 | * permitted without restriction. 7 | * 8 | * This work is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | * 12 | * In no event shall the authors or contributors be liable for any 13 | * direct, indirect, incidental, special, exemplary, or consequential 14 | * damages (including, but not limited to, procurement of substitute 15 | * goods or services; loss of use, data, or profits; or business 16 | * interruption) however caused and on any theory of liability, whether 17 | * in contract, strict liability, or tort (including negligence or 18 | * otherwise) arising in any way out of the use of this software, even 19 | * if advised of the possibility of such damage. 20 | * 21 | * Author: Matthias Clasen 22 | */ 23 | 24 | #include "glib.h" 25 | 26 | typedef struct { 27 | GSList *stack; 28 | } ParseData; 29 | 30 | static void 31 | start (GMarkupParseContext *context, 32 | const gchar *element_name, 33 | const gchar **attribute_names, 34 | const gchar **attribute_values, 35 | gpointer user_data, 36 | GError **error) 37 | { 38 | ParseData *data = user_data; 39 | 40 | data->stack = g_slist_prepend (data->stack, g_strdup (element_name)); 41 | } 42 | 43 | static void 44 | end (GMarkupParseContext *context, 45 | const gchar *element_name, 46 | gpointer user_data, 47 | GError **error) 48 | { 49 | ParseData *data = user_data; 50 | const GSList *stack; 51 | const GSList *s1, *s2; 52 | GSList *s; 53 | 54 | stack = g_markup_parse_context_get_element_stack (context); 55 | for (s1 = stack, s2 = data->stack; s1 && s2; s1 = s1->next, s2 = s2->next) 56 | g_assert_cmpstr (s1->data, ==, s2->data); 57 | g_assert (s1 == NULL && s2 == NULL); 58 | 59 | s = data->stack; 60 | data->stack = data->stack->next; 61 | s->next = NULL; 62 | g_slist_free_full (s, g_free); 63 | } 64 | 65 | const gchar content[] = 66 | " bla fff"; 67 | 68 | static void 69 | test_markup_stack (void) 70 | { 71 | GMarkupParser parser = { 72 | start, 73 | end, 74 | NULL, 75 | NULL, 76 | NULL 77 | }; 78 | GMarkupParseContext *context; 79 | ParseData data = { NULL }; 80 | gboolean res; 81 | GError *error = NULL; 82 | 83 | context = g_markup_parse_context_new (&parser, 0, &data, NULL); 84 | res = g_markup_parse_context_parse (context, content, -1, &error); 85 | g_assert (res); 86 | g_assert_no_error (error); 87 | g_markup_parse_context_free (context); 88 | } 89 | 90 | int 91 | main (int argc, char *argv[]) 92 | { 93 | g_test_init (&argc, &argv, NULL); 94 | 95 | g_test_add_func ("/markup/stack", test_markup_stack); 96 | 97 | return g_test_run (); 98 | } 99 | -------------------------------------------------------------------------------- /glib/deprecated/gcache.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | 18 | /* 19 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 20 | * file for a list of people on the GLib Team. See the ChangeLog 21 | * files for a list of changes. These files are distributed with 22 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 23 | */ 24 | 25 | #ifndef __G_CACHE_H__ 26 | #define __G_CACHE_H__ 27 | 28 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 29 | #error "Only can be included directly." 30 | #endif 31 | 32 | #include 33 | 34 | G_BEGIN_DECLS 35 | 36 | #ifndef G_DISABLE_DEPRECATED 37 | 38 | typedef struct _GCache GCache; 39 | 40 | typedef gpointer (*GCacheNewFunc) (gpointer key); 41 | typedef gpointer (*GCacheDupFunc) (gpointer value); 42 | typedef void (*GCacheDestroyFunc) (gpointer value); 43 | 44 | /* Caches 45 | */ 46 | GLIB_DEPRECATED 47 | GCache* g_cache_new (GCacheNewFunc value_new_func, 48 | GCacheDestroyFunc value_destroy_func, 49 | GCacheDupFunc key_dup_func, 50 | GCacheDestroyFunc key_destroy_func, 51 | GHashFunc hash_key_func, 52 | GHashFunc hash_value_func, 53 | GEqualFunc key_equal_func); 54 | GLIB_DEPRECATED 55 | void g_cache_destroy (GCache *cache); 56 | GLIB_DEPRECATED 57 | gpointer g_cache_insert (GCache *cache, 58 | gpointer key); 59 | GLIB_DEPRECATED 60 | void g_cache_remove (GCache *cache, 61 | gconstpointer value); 62 | GLIB_DEPRECATED 63 | void g_cache_key_foreach (GCache *cache, 64 | GHFunc func, 65 | gpointer user_data); 66 | GLIB_DEPRECATED 67 | void g_cache_value_foreach (GCache *cache, 68 | GHFunc func, 69 | gpointer user_data); 70 | 71 | #endif 72 | 73 | G_END_DECLS 74 | 75 | #endif /* __G_CACHE_H__ */ 76 | -------------------------------------------------------------------------------- /glib/genviron.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 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 License, or (at your option) any later version. 8 | * 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. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, see . 16 | */ 17 | 18 | /* 19 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 20 | * file for a list of people on the GLib Team. See the ChangeLog 21 | * files for a list of changes. These files are distributed with 22 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 23 | */ 24 | 25 | #ifndef __G_ENVIRON_H__ 26 | #define __G_ENVIRON_H__ 27 | 28 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 29 | #error "Only can be included directly." 30 | #endif 31 | 32 | #include 33 | 34 | G_BEGIN_DECLS 35 | 36 | GLIB_AVAILABLE_IN_ALL 37 | const gchar * g_getenv (const gchar *variable); 38 | GLIB_AVAILABLE_IN_ALL 39 | gboolean g_setenv (const gchar *variable, 40 | const gchar *value, 41 | gboolean overwrite); 42 | GLIB_AVAILABLE_IN_ALL 43 | void g_unsetenv (const gchar *variable); 44 | GLIB_AVAILABLE_IN_ALL 45 | gchar ** g_listenv (void); 46 | 47 | GLIB_AVAILABLE_IN_ALL 48 | gchar ** g_get_environ (void); 49 | GLIB_AVAILABLE_IN_ALL 50 | const gchar * g_environ_getenv (gchar **envp, 51 | const gchar *variable); 52 | GLIB_AVAILABLE_IN_ALL 53 | gchar ** g_environ_setenv (gchar **envp, 54 | const gchar *variable, 55 | const gchar *value, 56 | gboolean overwrite) G_GNUC_WARN_UNUSED_RESULT; 57 | GLIB_AVAILABLE_IN_ALL 58 | gchar ** g_environ_unsetenv (gchar **envp, 59 | const gchar *variable) G_GNUC_WARN_UNUSED_RESULT; 60 | 61 | #ifdef G_OS_WIN32 62 | #define g_getenv g_getenv_utf8 63 | #define g_setenv g_setenv_utf8 64 | #define g_unsetenv g_unsetenv_utf8 65 | 66 | GLIB_AVAILABLE_IN_ALL 67 | const gchar *g_getenv_utf8 (const gchar *variable); 68 | GLIB_AVAILABLE_IN_ALL 69 | gboolean g_setenv_utf8 (const gchar *variable, 70 | const gchar *value, 71 | gboolean overwrite); 72 | GLIB_AVAILABLE_IN_ALL 73 | void g_unsetenv_utf8 (const gchar *variable); 74 | #endif 75 | 76 | G_END_DECLS 77 | 78 | #endif /* __G_ENVIRON_H__ */ 79 | -------------------------------------------------------------------------------- /glib/gbitlock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008 Ryan Lortie 3 | * Copyright © 2010 Codethink Limited 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the licence, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, see . 17 | * 18 | * Author: Ryan Lortie 19 | */ 20 | 21 | #ifndef __G_BITLOCK_H__ 22 | #define __G_BITLOCK_H__ 23 | 24 | #include 25 | 26 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 27 | #error "Only can be included directly." 28 | #endif 29 | 30 | G_BEGIN_DECLS 31 | 32 | GLIB_AVAILABLE_IN_ALL 33 | void g_bit_lock (volatile gint *address, 34 | gint lock_bit); 35 | GLIB_AVAILABLE_IN_ALL 36 | gboolean g_bit_trylock (volatile gint *address, 37 | gint lock_bit); 38 | GLIB_AVAILABLE_IN_ALL 39 | void g_bit_unlock (volatile gint *address, 40 | gint lock_bit); 41 | 42 | GLIB_AVAILABLE_IN_ALL 43 | void g_pointer_bit_lock (volatile void *address, 44 | gint lock_bit); 45 | GLIB_AVAILABLE_IN_ALL 46 | gboolean g_pointer_bit_trylock (volatile void *address, 47 | gint lock_bit); 48 | GLIB_AVAILABLE_IN_ALL 49 | void g_pointer_bit_unlock (volatile void *address, 50 | gint lock_bit); 51 | 52 | #ifdef __GNUC__ 53 | 54 | #define g_pointer_bit_lock(address, lock_bit) \ 55 | (G_GNUC_EXTENSION ({ \ 56 | G_STATIC_ASSERT (sizeof *(address) == sizeof (gpointer)); \ 57 | g_pointer_bit_lock ((address), (lock_bit)); \ 58 | })) 59 | 60 | #define g_pointer_bit_trylock(address, lock_bit) \ 61 | (G_GNUC_EXTENSION ({ \ 62 | G_STATIC_ASSERT (sizeof *(address) == sizeof (gpointer)); \ 63 | g_pointer_bit_trylock ((address), (lock_bit)); \ 64 | })) 65 | 66 | #define g_pointer_bit_unlock(address, lock_bit) \ 67 | (G_GNUC_EXTENSION ({ \ 68 | G_STATIC_ASSERT (sizeof *(address) == sizeof (gpointer)); \ 69 | g_pointer_bit_unlock ((address), (lock_bit)); \ 70 | })) 71 | 72 | #endif 73 | 74 | G_END_DECLS 75 | 76 | #endif /* __G_BITLOCK_H_ */ 77 | --------------------------------------------------------------------------------